TOOLCHAIN · CVE-2026-97043 · Runtime
FIX → 1.27.4 +1
The Go toolchain mishandles escaped quotes in //go:cgo_ldflag directives, so a malicious package using cgo can smuggle disallowed linker flags past validation. The same flaw can also make the go command panic during LDFLAGS deduplication.
first public Nov 11, 2026 · 1 source
Could this affect your app?
Free first check from your website. Connect your repo for the full answer.
Anyone building Go code with the affected toolchain, especially when compiling third-party packages that use cgo. Builds that use only pure Go code or trusted cgo sources are less exposed. unknown for further detail on specific build pipelines.
Not affected if pure-go-only, trusted-sources-only
Who cares cgo, ci, go
go version and compare against the fixed releases listed in the sources.#cgo LDFLAGS from third-party modules.Upgrade to 1.27.4 +1
1.26.111.27.4Building 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.
Go Vulnerability Database, CC-BY 4.0. Posts quoted belong to their authors.
Check it with your coding agent
It reads this page and tells you if your code is affected.
Are you affected?
Ask from here. InfraStack checks the affected versions against your stack and answers in your inbox.
InfraStack checks the affected versions against your stack and answers in Slack, with the evidence and the fix.