Unexpected code execution via escaped quotes in //go:cgo_ldflag in cmd/go and cmd/compile
CVE-2026-97043 · GHSA-26gx-chjm-8pq7 · EUVD-2026-123102 · GO-2026-6848 · published 11 Nov 2026
How serious is it
- Severity: high, CVSS score 8.8 out of 10.
- No exploit prediction (EPSS) score yet.
- Not on the CISA list of exploited vulnerabilities.
- No public exploit in Exploit-DB.
Is your app affected by CVE-2026-97043?
Paste this prompt into Claude Code, Cursor or any AI coding tool: it runs a free Shippable scan of your project and fixes what it finds. Built with Lovable, Bolt or v0? Scan your live app. Or upload your package file.
Who is affected
toolchain(Go) < 1.26.11toolchain(Go) >= 1.27.0-0, < 1.27.4
How to check
- Run
go list -m toolchainin your project to see the installed version, including copies pulled in by other packages. - Or paste your lockfile into the checker: it lists every package with a known vulnerability, this one included.
How to fix
Copies a prompt for Claude Code, Cursor or Codex: it checks your lockfiles for this and upgrades it.
- On < 1.26.11: Upgrade
toolchainto 1.26.11 or later, commit the lockfile and redeploy. - On >= 1.27.0-0, < 1.27.4: Upgrade
toolchainto 1.27.4 or later, commit the lockfile and redeploy. - If a vulnerable version was live, check your logs and rotate the secrets that server could read.
The advisory
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.
Check your whole app
Dependencies are only half of it. Free and read-only: before you push, run npx shippable-dev scan localhost:3000 in your project folder, no account needed. For your live app, you prove it's yours with a one-line tag first.
References
- go.dev/cl/862156
- go.dev/issue/82567
- groups.google.com/g/golang-announce/c/iY8TY0wWgbM
- pkg.go.dev/vuln/GO-2026-6848
Merged from ENISA EUVD, OSV. Last updated 17 Nov 2026. All vulnerabilities · RSS · JSON