Go
CVE-2026-97040
Cgo directive injection via .syso files disguised as Go object files in cmd/go and cmd/link
- Severity
- Critical 9.8
- Published
- 11 Nov 2026
- Last changed
- 16 Nov 2026
- Added to UpHeron
- 23 Nov 2026
- Fixed in
- 1.26.11, 1.27.4
- Exploit chance
- 0.8% in the next 30 daysHigher than 57% of CVEs. EPSS by FIRST, 24 Nov 2026
- Weakness
- Code injection (CWE-94)
- Attack
- Over the network · No login needed · No user action needed
- Attacker can
- Read data · Change data · Take it down
- CVSS vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H- Sources
- CVE Program
Description
Building a package containing a crafted ".syso" file could bypass cgo flag validation and inject arbitrary linker flags when linking. When loading ".syso" entries from a package archive, the linker only checked for recognized host object headers (ELF, Mach-O, PE, and XCOFF) before falling through to Go object parsing. A ".syso" file beginning with a "go object" header was parsed as a Go compiler object, allowing untrusted cgo metadata directives (such as "cgo_ldflag" or "cgo_dynamic_linker") embedded in the ".syso" file to be passed to the external linker without validation. Additionally, ".syso" filenames longer than 16 bytes lost their ".syso" extension when truncated in archive headers, and unrecognized ".syso" formats forced external linking in pure-Go builds. The linker now rejects ".syso" files that are not recognized host object formats, and "cmd/go" and "cmd/pack" preserve the ".syso" suffix when truncating long archive member names.
Affected software
| Software | Affected versions |
|---|---|
cmd/goGo · osv:Go:cmd/go |
|
cmd/linkGo · osv:Go:cmd/link |
|
About cmd/go
Vulnerabilities in cmd/go
- In our list
- 9
- Published in the last 12 months
- 9
- Critical, last 12 months
- 1
- High, last 12 months
- 8
- Known exploited
- 0
- CVE-2026-97033Unexpected code execution via --sysroot, -target, -isysroot, -Wl,-syslibroot, and -x cgo flags in cmd/goHigh 8.8 11 Nov 2026
- CVE-2026-97034Arbitrary command execution via GCC spec files in cgo linker search directories in cmd/goHigh 8.8 11 Nov 2026
- CVE-2026-97035Unexpected code execution and arbitrary file write via Clang -gen-* and GCC -gnat* flags in cgo in cmd/goHigh 8.8 11 Nov 2026
- CVE-2026-97036Arbitrary code execution during build on darwin via "-l to_library" in cgo in cmd/goHigh 8.8 11 Nov 2026
- CVE-2026-97037Linker script injection via split -Wl, flags and Darwin or symbol linker flags in cgo in cmd/goHigh 8.8 11 Nov 2026
- CVE-2026-97038Arbitrary code execution via crafted .syso files and cgo linker input files in cmd/goHigh 8.8 11 Nov 2026
About cmd/link
Vulnerabilities in cmd/link
- In our list
- 3
- Published in the last 12 months
- 3
- Critical, last 12 months
- 1
- High, last 12 months
- 2
- Known exploited
- 0
- CVE-2026-97041Host linker flag injection via //go:cgo_* directives in cmd/compile and cmd/linkHigh 8.8 11 Nov 2026
- CVE-2026-97042Linker flag injection via cgo_import_dynamic and PE DLL names in cmd/cgo, cmd/compile, and cmd/linkHigh 8.8 11 Nov 2026
References
- CVE.org https://www.cve.org/CVERecord?id=CVE-2026-97040