CVE-2026-97042: Linker flag injection via cgo_import_dynamic and PE DLL names in cmd/cgo, cmd/compile, and cmd/link
Published 2026-11-11 · Updated 2026-11-25 · Also known as GO-2026-6849
Summary
A linker flag injection vulnerability in the Go toolchain (cmd/cgo, cmd/compile, and cmd/link) allows unsafe library arguments and path traversal sequences to be passed to the external linker. Development and build teams using vulnerable Go toolchain releases should update to patched versions.
Who is affected
The flaw affects environments using vulnerable versions of the Go toolchain when compiling packages containing crafted //go:cgo_import_dynamic directives or linking against malicious PE object files on Windows. Lack of validation on imported DLL names allows unvalidated flags containing path traversal ('..') or special characters to be passed to the external linker. This enables referencing arbitrary files on disk during the compilation process.
Exploitability
The CVSS vector and base score are not documented for this vulnerability. The EPSS score is 0.006, placing it in the 0.481 percentile. CISA Known Exploited Vulnerabilities lists active exploitation as no.
Remediation
- Upgrade the Go toolchain to version 1.26.11 or later for 1.26.x releases.
- Upgrade the Go toolchain to version 1.27.4 or later for 1.27.x releases.
How to check your project
- Check the currently installed Go toolchain version using `go version` and verify if it falls within affected ranges (prior to 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 component of the Go toolchain is vulnerable?
The vulnerability exists in cmd/cgo, cmd/compile, and cmd/link due to incomplete validation of library names in //go:cgo_import_dynamic directives and unvalidated PE imported DLL names on Windows.
Is there any documented workaround for this issue?
No workarounds are documented; affected installations should upgrade to fixed Go toolchain versions.
Is this issue known to be actively exploited?
No, according to CISA's Known Exploited Vulnerabilities status, active exploitation is not documented.
Original advisory description
References
- FIX https://go.dev/cl/862155
- REPORT https://go.dev/issue/82568
- WEB https://groups.google.com/g/golang-announce/c/iY8TY0wWgbM
Source records: GO-2026-6849 (OSV.dev) · EPSS by FIRST, 2026-11-25.