CVE-2026-97040: Cgo directive injection via .syso files disguised as Go object files in cmd/go and cmd/link
Published 2026-11-11 · Updated 2026-11-25 · Also known as GO-2026-6851
Summary
A flaw in the Go toolchain allows crafted `.syso` files disguised as Go compiler objects to bypass cgo flag validation and inject arbitrary linker flags. Engineering teams using affected Go toolchain versions should update their environments.
Who is affected
This flaw impacts environments building Go packages that include untrusted or crafted `.syso` files. When processed, files starting with a Go object header pass unvalidated cgo metadata directives, such as `cgo_ldflag` or `cgo_dynamic_linker`, to the external linker. In addition, long `.syso` filenames lost their extensions when truncated in archive headers, and unrecognized `.syso` formats forced external linking in pure-Go builds.
Exploitability
CVSS metrics and vector details are not provided for this entry. The EPSS score is 0.008, representing the 0.573 percentile. CISA KEV indicates that active exploitation is not documented.
Remediation
- Upgrade the Go toolchain to version 1.26.11 (for the 1.26.x series).
- Upgrade the Go toolchain to version 1.27.4 (for the 1.27.x series).
How to check your project
- Run `go version` in your build environment to verify whether the installed Go toolchain is below 1.26.11 or between 1.27.0-0 and 1.27.3.
Automated analysis of the published advisory data, generated 2026-11-25. Not human-reviewed; verify against the official advisory. How this works.
Affected packages
| Ecosystem | Package | Affected versions | Fixed in | Upgrade |
|---|---|---|---|---|
| Go | toolchain |
>= 0, < 1.26.11 | 1.26.11 | go get [email protected] |
| Go | toolchain |
>= 1.27.0-0, < 1.27.4 | 1.27.4 | go get [email protected] |
FAQ
What caused `.syso` files to bypass cgo flag validation?
The linker checked only for recognized host object headers before falling back to Go object parsing. A `.syso` file starting with a Go object header was parsed as a Go compiler object, exposing unvalidated cgo metadata directives directly to the external linker.
Are there any documented workarounds for this vulnerability?
Workarounds are not documented; affected systems must be remediated by upgrading to the fixed Go toolchain versions.
Is CVE-2026-97040 actively exploited in the wild?
No active exploitation is reported; the CISA KEV status for this record is set to 'no'.
Original advisory description
References
- FIX https://go.dev/cl/862153
- REPORT https://go.dev/issue/82570
- WEB https://groups.google.com/g/golang-announce/c/iY8TY0wWgbM
Source records: GO-2026-6851 (OSV.dev) · EPSS by FIRST, 2026-11-25.