CVE-2026-97036: Arbitrary code execution during build on darwin via "-l to_library" in cgo in cmd/go
Published 2026-11-11 · Updated 2026-11-27 · Also known as BIT-golang-2026-97036, GO-2026-6855
Summary
A flaw in the Go toolchain on Darwin allows arbitrary code execution during the build process via malicious #cgo LDFLAGS. Developers building packages with cgo on macOS should update their Go toolchain to the specified patched versions.
Who is affected
The vulnerability affects Go toolchain users on Darwin systems when processing malicious packages that leverage the Apple linker. By providing specific flags in #cgo LDFLAGS, an attacker can trick the linker into loading an arbitrary LTO plugin, leading to code execution during the compilation phase.
Exploitability
The vulnerability is currently unrated with no official CVSS vector provided. While the EPSS score of 0.007 suggests a relatively low probability of widespread exploitation, it is not listed on the CISA Known Exploited Vulnerabilities catalog.
Remediation
- Upgrade Go toolchain to version 1.26.11 if using the 1.26.x series.
- Upgrade Go toolchain to version 1.27.4 if using the 1.27.x series.
How to check your project
- Run 'go version' in the terminal to verify the currently installed toolchain version.
- Audit codebase for #cgo LDFLAGS directives that pass '-l', '-lazy_library', '-lazy_framework', '-load_hidden', '-library', or '-library-path'.
Automated analysis of the published advisory data, generated 2026-11-27. 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
Does this affect all platforms?
No, the vulnerability specifically impacts the Darwin (macOS) platform because it relies on specific behavior of the Apple linker.
Is there active exploitation?
There is no indication of active exploitation, as the vulnerability is not included in the CISA Known Exploited Vulnerabilities catalog.
What specifically is blocked in the fix?
The fix disallows '-l' followed by 'to_library' and rejects specific linker flags including '-lazy_library', '-lazy_framework', '-load_hidden', '-library', and '-library-path'.
Original advisory description
References
- FIX https://go.dev/cl/862149
- REPORT https://go.dev/issue/82574
- WEB https://groups.google.com/g/golang-announce/c/iY8TY0wWgbM
Source records: GO-2026-6855 (OSV.dev) · EPSS by FIRST, 2026-11-27.