All vulnerabilities

Go

CVE-2026-97043

Unexpected code execution via escaped quotes in //go:cgo_ldflag in cmd/go and cmd/compile

Severity
High 8.8
Published
11 Nov 2026
Last changed
17 Nov 2026
Added to UpHeron
23 Nov 2026
Fixed in
1.26.11, 1.27.4
Exploit chance
0.7% in the next 30 daysHigher than 54% of CVEs. EPSS by FIRST, 24 Nov 2026
Weakness
Argument injection (CWE-88)
Attack
Over the network · No login needed · Needs someone to click or open something
Attacker can
Read data · Change data · Take it down
CVSS vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
Sources
CVE Program

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.

From the CVE Program. Shortened; the full text is there.

Affected software

SoftwareAffected versions
cmd/compileGo · osv:Go:cmd/compile
  • Every version before 1.26.11
  • From 1.27.0-0 before 1.27.4
cmd/goGo · osv:Go:cmd/go
  • Every version before 1.26.11
  • From 1.27.0-0 before 1.27.4

About cmd/compile

Vulnerabilities in cmd/compile

In our list
3
Published in the last 12 months
3
Critical, last 12 months
0
High, last 12 months
3
Known exploited
0
Search the list for cmd/compile

About cmd/go

References

  • CVE.org https://www.cve.org/CVERecord?id=CVE-2026-97043