CVE-2026-97043 json
Unexpected code execution via escaped quotes in //go:cgo_ldflag in cmd/go and cmd/compile
published yesterday modified yesterday also EUVD-2026-123102 , GO-2026-6848
- cvss
- —
- not scored
- cisa kev
- Not listed
- not in CISA's catalog
- epss
- 0.3%
- EPSS 0.3% chance of exploitation in 30 days, percentile 18%
- public exploits
- 0
- none known
Summary
Building a malicious package that uses cgo could bypass "#cgo LDFLAGS" validation and cause unexpected code execution at build time, or cause the go command to panic, via crafted quoting in "//go:cgo_ldflag" directives. When "cmd/cgo" generates "_cgo_gotypes.go", it quotes each "#cgo LDFLAGS" argument with strconv.Quote in a "//go:cgo_ldflag" directive, but "cmd/compile" and "cmd/go" parsed those directives by splitting on raw quote characters without handling backslash escapes or unquoting the string. This mismatch allowed disallowed linker flags or unvalidated linker search paths to be smuggled past the go command's flag checks and passed to the external linker. In addition, deduplicating LDFLAGS in the go command could panic with an out-of-bounds slice index when a prefix of the flag list matched near the end of the slice. "cmd/compile" and "cmd/go" now properly handle backslash-escaped quotes and unquote "//go:cgo_*" pragma strings with strconv.Unquote, and the slice bounds check in processCgoOutputs has been fixed.
Patch / fix
- go toolchain 1.26.11, 1.27.4
- Go toolchain cmd/go 1.26.11, 1.27.4
- Go toolchain cmd/compile 1.26.11, 1.27.4
- go.dev/cl/862156 patch
Is CVE-2026-97043 in your dependencies? Fencer shows which of your repositories are affected as soon as an advisory lands, and opens the fix as a pull request.
Check with FencerExploit prediction
0.26% chance of exploitation in the next 30 days, higher than 18% of all scored CVEs (FIRST EPSS, 2026-11-11).
Affected packages
| ecosystem | package | affected | fixed in |
|---|---|---|---|
| go | toolchain | <1.26.11 >=1.27.0-0, <1.27.4 |
1.26.11 1.27.4 |
Affected products
- Go toolchain cmd/go
- Go toolchain cmd/compile
Classification
- Weakness
-
- CWE-88 Improper Neutralization of Argument Delimiters in a Command
References
Sources
- CVE List CVE-2026-97043
- NVD CVE-2026-97043
- OSV GO-2026-6848
Fencer Intel keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.