Unexpected code execution via escaped quotes in //go:cgo_ldflag in cmd/go and cmd/compile
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.
Recorded fixes — toolchain: 1.26.11 or 1.27.4. Check your release branch.
Exploitation not established
| Affected range | Recorded fix |
|---|---|
| Earlier releases before 1.26.11Semantic versions | 1.26.11 |
| From 1.27.0-0 before 1.27.4Semantic versions | 1.27.4 |
Version evidence: OSV · GO-2026-6848
View original version evidence
{
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "1.26.11"
},
{
"introduced": "1.27.0-0"
},
{
"fixed": "1.27.4"
}
],
"type": "SEMVER"
}
],
"versions": []
}