Arbitrary command execution via GCC spec files in cmd/go cgo builds
Key facts
- Attack vector
- Network
- Privileges required
- None
- User interaction
- Required
- Attack complexity
- Low
- Impact type
- Code execution
- Confidentiality · integrity · availability
- High · High · High
- Fix status
- Fixed
Attack profile from CVSS 3.1 · CISA ADP. Fix status from CNA. Impact type from CWE-77.
Summary
The Go command (cmd/go) can run arbitrary commands at link time when it builds a malicious package that uses cgo with GCC. GCC's built-in link spec loads spec files from -L, sysroot and working directories, and an untrusted spec file can execute commands. Affected are cmd/go versions before 1.26.11 and from 1.27.0-0 before 1.27.4. The weakness is CWE-77, with a CVSS 3.1 base score of 8.8 (HIGH); CISA has not added it to KEV.
Written with Claude Haiku 5.5 from the sources below · 2026-11-16
Description from the CNA
When using GCC, building a malicious package that uses cgo could cause arbitrary command execution at link time via untrusted GCC spec files ("specs" or "*.spec"). When linking with "-fopenmp", "-fopenacc", or "-fsanitize=" in "#cgo LDFLAGS", GCC's built-in link spec evaluates "%:include(libgomp.spec)" or "%:include(libsanitizer.spec)" and searches for spec files in "-L" and sysroot directories (including subdirectories and multilib sibling directories such as "../lib64"), as well as the working directory when "-fopenmp" or "-fopenacc" is used or when "-fsanitize=" is combined with "-static" or "-static-lib*". The go command now rejects "-L", "-isysroot", and "-Wl,-syslibroot" directories (and the working and package directories when applicable) that contain GCC spec files, and disallows "@" and "-" prefixes in "-fsanitize=" compiler flag values.
Why it matters now
SSVC decision points
CISA ADP · SSVC 2.0.3
- Exploitation
- None
- Automatable
- No
- Technical impact
- Total
The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| Go standard library | cmd/go | before 1.26.11; 1.27.0-0 to before 1.27.4 | 1.26.11, 1.27.4 | Patch available | CNA |
- cmd/go VendorGo standard library Affected before 1.26.11; 1.27.0-0 to before 1.27.4 Fixed in 1.26.11, 1.27.4 Patch available CNA
CPE names Threatist (inferred) · 1
Inferred from how NVD named this product before; not given by a source.
| CPE | Versions | Role | Vendor |
|---|---|---|---|
| cpe:2.3:a:golang:go:*:*:*:*:*:*:*:* | — | — | Go standard library |
- cpe:2.3:a:golang:go:*:*:*:*:*:*:*:* Versions — — ·Go standard library
Remediation
Upgrade to Go 1.26.11 or 1.27.4. The fixed cmd/go rejects -L, -isysroot and -Wl,-syslibroot directories that contain GCC spec files, and rejects @ and - prefixes in -fsanitize= flag values.
Written with Claude Haiku 5.5 from the sources below · 2026-11-16
- Fix · CNA cmd/go (Go toolchain) Fixed in 1.26.11, 1.27.4
Fixed in the same release
Records fixed by the same vendor advisory or release, as the CNA lists them.
- Release ·
Go toolchain cmd/go 1.26.11, 1.27.4
9 records Highest priority Priority MEDIUM 8 MEDIUM, 1 LOW
Other records, highest priority first
- TI-2026-89559 Crafted .syso files inject cgo linker flags in Go cmd/go and cmd/linkPriority MEDIUM 48
- TI-2026-89562 Quoting flaw in Go cgo directives allows code execution at build timePriority MEDIUM 40
- TI-2026-89557 Arbitrary code execution via crafted .syso files in Go cmd/goPriority MEDIUM 40
Timeline
- 2026-11-11 Threatist record created from CVE-2026-97034
- 2026-11-11 Alias added: GHSA-775q-r7gv-cr2x
- 2026-11-16 CVSS score added · CISA ADP
- 2026-11-16 Weakness changed · CISA ADP
- 2026-11-16 CISA SSVC decision points changed
- 2026-11-17 CISA SSVC decision points changed
References
More Go standard library vulnerabilities
- TI-2020-00578 Spoofing in Windows CryptoAPI ECC certificate validation KEVCVSS 3.1HIGH 8.1
- TI-2023-23979 HTTP/2 request cancellation lets attackers exhaust server resources KEVCVSS 3.1HIGH 7.5
- TI-2023-24278 HTTP/2 CONTINUATION flood in net/http CVSS 3.1HIGH 7.5
- TI-2018-05208 The "go get" implementation in Go 1.9.4, when the -insecure command-line option is used… CVSS 3.1HIGH 8.8
- TI-2024-16309 Panic when parsing invalid palette-color images in golang.org/x/image CVSS 3.1HIGH 7.5
- TI-2022-20112 Request smuggling due to improper request handling in golang.org/x/net/http2/h2c CVSS 3.1HIGH 7.5
Sources
- CVE-2026-97034 · CVE Program
- CVE-2026-97034 · NVD
- FIRST EPSS
- GHSA-775q-r7gv-cr2x · GitHub Advisory Database · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences