CVE-2026-97034: Arbitrary command execution via GCC spec files in cgo linker search directories in cmd/go
Published 2026-11-11 · Updated 2026-11-27 · Also known as BIT-golang-2026-97034, GO-2026-6857
Summary
The Go toolchain is vulnerable to arbitrary command execution during the build process when using cgo with specific GCC flags. Developers using Go versions prior to the fixed releases should upgrade their toolchain immediately to mitigate the risk of malicious package exploitation.
Who is affected
This vulnerability affects Go environments where cgo is utilized to link code via GCC, specifically when using flags like -fopenmp, -fopenacc, or -fsanitize=. An attacker can leverage untrusted GCC spec files within build directories or search paths to execute arbitrary commands on the host machine at link time. The vulnerability exists because the compiler search mechanism can be tricked into evaluating malicious spec files.
Exploitability
The vulnerability's severity is currently unknown, with no provided CVSS vector or base score. However, an EPSS score of 0.008 indicates a low probability of exploitation. There is no evidence of active exploitation as the vulnerability is not listed in the CISA Known Exploited Vulnerabilities catalog.
Remediation
- Upgrade Go toolchain to version 1.26.11 or later for the 1.26 branch.
- Upgrade Go toolchain to version 1.27.4 or later for the 1.27 branch.
- Avoid building untrusted Go packages that utilize cgo and external GCC compiler flags.
How to check your project
- Run 'go version' to determine the currently installed Go toolchain version.
- Check go.mod files to identify if cgo is being utilized in the project builds.
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
What is the primary risk of this vulnerability?
The primary risk is arbitrary command execution during the compilation and linking process, allowing a malicious package to run code on the developer's or build server's system.
Does this affect all Go programs?
No, it specifically affects projects using cgo that also include specific compiler flags like -fopenmp, -fopenacc, or -fsanitize=.
Is this vulnerability actively being exploited?
Not documented by the CISA KEV catalog; there is no current evidence of active exploitation.
Original advisory description
References
- FIX https://go.dev/cl/862147
- REPORT https://go.dev/issue/82576
- WEB https://groups.google.com/g/golang-announce/c/iY8TY0wWgbM
Source records: GO-2026-6857 (OSV.dev) · EPSS by FIRST, 2026-11-27.