CVE-2026-97043
High 8.8No known exploitationFix availableUnexpected code execution via escaped quotes in //go:cgo_ldflag in cmd/go and cmd/compile
Record last updated
CVSS score
High on a 0 to 10 scale
EPSS, chance of exploitation in 30 days
Higher than 48% of scored CVEs. A prediction, not evidence.
CISA remediation deadline
Not in the KEV catalog
Description
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.
Weakness: CWE-88
Patching and mitigation
- Patch status
- Fix available (source: Microsoft MSRC)
- Fix documented (source date)
- Mitigation
- None documented
- Vendor guidance
- msrc.microsoft.com (opens in a new tab)
Affected products
| Vendor | Product | Affected versions | Fixed in | Per |
|---|---|---|---|---|
| Microsoft | azl3 golang 1.26.10-1 on Azure Linux 3.0 | Not documented | Not documented | Microsoft MSRC |
| Microsoft | azl3 golang 1.26.11-1 on Azure Linux 3.0 | Not documented | Not documented | Microsoft MSRC |
| Microsoft | azl3 golang 1.27.3-1 on Azure Linux 3.0 | Not documented | Not documented | Microsoft MSRC |
| Microsoft | azl3 golang 1.27.4-1 on Azure Linux 3.0 | Not documented | Not documented | Microsoft MSRC |
| Microsoft | azl4 cross-gcc 15.2.1-1.azl4 on Azure Linux 4.0 | Not documented | Not documented | Microsoft MSRC |
| Microsoft | azl4 gcc 15.3.1-2.azl4 on Azure Linux 4.0 | Not documented | Not documented | Microsoft MSRC |
| Microsoft | azl4 golang 1.26.10-3.azl4 on Azure Linux 4.0 | Not documented | Not documented | Microsoft MSRC |
Timeline
Advisory
Microsoft advisory published
Advisory change
Microsoft advisory revised (2.0): Information published.
Advisory change
Microsoft advisory revised (3.0): Information published.
Advisory change
Microsoft advisory revised (4.0): Information published.
Patch
Fix documented by Microsoft MSRC