Patch Ticker
EnglishEN
Urgent

Go toolchain cgo flaws allow code execution at build time

CVE-2026-97040 and 10 more

Building a malicious package with the Go language build tool can secretly run programs on your PC!

CVE
CVE-2026-97040 and 10 more
Score
CVSS 9.8 · CVE-2026-97040
First seen
9.8
Products
Disclosed together Windows macOS Linux cmd/go
Show 3 morecmd/compile cmd/link cmd/cgo

Mitigation

Update to Go 1.26.11 or later on the 1.26 line, and to Go 1.27.4 or later on the 1.27 line.

Update to at least the version for your product:

  • Go toolchain 1.26 1.26.11 or later
  • Go toolchain 1.27 1.27.4 or later

Summary

A cgo handling flaw in the Go toolchain lets a malicious package run unexpected code at build time. Versions before 1.26.11 and from 1.27.0 before 1.27.4 are affected. The same release also fixes linker flag checks that could be bypassed and a crash in the go command.

Affected when

  • Building a malicious package (cgo in use)
  • CVE-2026-97036 Apple linker used on Darwin
  • CVE-2026-97034 GCC used
  • CVE-2026-97035 Clang or GCC used
  • CVE-2026-97033 GCC or Clang used
  • CVE-2026-97041 ELF platforms such as Linux
  • CVE-2026-97042 PE object linked on Windows
  • CVE-2026-97037 GNU ld.bfd used

Incidents by product: cmd/cgo · cmd/compile · cmd/go · cmd/link

All Incidents of 2026-11-11

Distribution packages (22) (every link below opens in a new tab)

Sources: Debian Security Tracker · Alpine Linux secdb · Red Hat Security Data (CC BY 4.0) · SUSE CSAF VEX (CC BY 4.0)

11 CVEs (every link below opens in a new tab)

Read the CVE record · cve.org (opens in a new tab)

Each of the 11 CVEs (every link below opens in a new tab)

  • CVE-2026-97040Crafted .syso files can pass unchecked cgo directives to the external linker. CVSS 9.8
  • CVE-2026-97043Bypasses linker flag checks at build time, allowing unexpected code to run or the go command to crash. CVSS 8.8
  • CVE-2026-97041On ELF platforms such as Linux, comma-containing names can inject arbitrary flags into the external linker. CVSS 8.8
Show 8 more
  • CVE-2026-97042On Windows, a crafted DLL name can pass arbitrary files on disk to the linker. CVSS 8.8
  • CVE-2026-97038Crafted .syso files or libraries can run arbitrary code during linking. CVSS 8.8
  • CVE-2026-97035Clang or GCC flags can run code at build time or write files to arbitrary folders. CVSS 8.8
  • CVE-2026-97036On macOS, the Apple linker can load a malicious library and run code at build time. CVSS 8.8
  • CVE-2026-97037Linker script files can be passed to the host linker, running code at link time. CVSS 8.8
  • CVE-2026-97033Flags such as --sysroot can run arbitrary code at build time. CVSS 8.8
  • CVE-2026-97034Planted GCC spec files can run arbitrary commands at link time. CVSS 8.8
  • CVE-2026-97039Bypasses pkg-config checks, loading untrusted .pc files or injecting flags. CVSS 8.3