cve.bz

CVE-2026-97043 Unexpected code execution via escaped quotes in //go:cgo_ldflag in cmd/go and cmd/compile

no score yetEPSS 0.3%Fix available

go toolchain: no CVSS score yet. EPSS 0.3% estimated probability of exploitation activity in the next 30 days. Fixed in toolchain 1.26.11, 1.27.4.

On this page
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.
EPSS
0.3% estimated probability of exploitation activity in the next 30 days; 19th percentile. Scored 2026-11-13. A forecast for this CVE across the internet, not for your own systems.
Published
Modified
Assigned by
Go (CNA)
NVD analysis
Awaiting analysis
Record from
the NVD, synced

Ask an AI about this CVE

Show the promptExplain CVE-2026-97043 for an engineer deciding whether to act. Use https://cve.bz/api/public/cves/CVE-2026-97043?via=ask-ai-copy and https://cve.bz/cve/CVE-2026-97043?via=ask-ai-copy as the source of truth: what is affected and which versions fix it, whether it is in CISA KEV, public exploits, and its EPSS (an internet-wide 30-day estimate of exploitation activity, not a forecast for my systems). If they give no fixed versions, use the CVE record https://cveawg.mitre.org/api/cve/CVE-2026-97043 or the vendor advisory, not third-party mirrors. Tell me how to check whether I am affected and how to verify a fix. Cite the sources and say where they are uncertain.

Opens a third-party assistant; its answer is its own, not cve.bz's. The prompt holds only this CVE's id and public links.

Badge for a README or a site

CVE-2026-97043

An image that stays current: it is drawn from the data each time it is fetched (a host that proxies images, as GitHub does, may show its copy for a while). Markdown:

[![CVE-2026-97043](https://cve.bz/cve/badge/CVE-2026-97043.svg)](https://cve.bz/cve/CVE-2026-97043)

HTML:

<a href="https://cve.bz/cve/CVE-2026-97043"><img src="https://cve.bz/cve/badge/CVE-2026-97043.svg" alt="CVE-2026-97043"></a>

Affected

  • go toolchain:cmd/compile
  • go toolchain:cmd/go

Versions

From the CNA's record in the CVE List.

ProductAffected
Go toolchain cmd/gobefore 1.26.11
Go toolchain cmd/gofrom 1.27.0-0 before 1.27.4
Go toolchain cmd/compilebefore 1.26.11
Go toolchain cmd/compilefrom 1.27.0-0 before 1.27.4

Fix and patched versions

Packages (OSV)

AdvisoryEcosystemPackageAffectedFixed in
GO-2026-6848Gotoolchain<1.26.11
>=1.27.0-0 <1.27.4
1.26.11, 1.27.4

Linux distributions

DistributionReleasePackageFixed inAdvisory
Debian12golang-1.19no fix listedDEBIAN-CVE-2026-97043
Debian13golang-1.24no fix listedDEBIAN-CVE-2026-97043
Debian14golang-1.261.26.11-1DEBIAN-CVE-2026-97043
Debian14golang-1.271.27.4-1DEBIAN-CVE-2026-97043
Ubuntu14.04:LTSgolang-1.10no fix listedUBUNTU-CVE-2026-97043
Ubuntu16.04:LTSgolang-1.6, golang-1.10no fix listedUBUNTU-CVE-2026-97043
Ubuntu18.04:LTSgolang-1.8, golang-1.9, golang-1.10no fix listedUBUNTU-CVE-2026-97043
Ubuntu20.04:LTSgolang-1.13, golang-1.14, golang-1.18 and 3 moreno fix listedUBUNTU-CVE-2026-97043
Ubuntu22.04:LTSgolang-1.17, golang-1.18, golang-1.20 and 6 moreno fix listedUBUNTU-CVE-2026-97043
Ubuntu24.04:LTSgolang-1.21, golang-1.22, golang-1.23 and 3 moreno fix listedUBUNTU-CVE-2026-97043
Ubuntu26.04:LTSgolang-1.23, golang-1.24, golang-1.25 and 1 moreno fix listedUBUNTU-CVE-2026-97043
Ubuntu26.10golang-1.26, golang-1.27no fix listedUBUNTU-CVE-2026-97043
UbuntuPro:16.04:LTSgolang-1.13, golang-1.18no fix listedUBUNTU-CVE-2026-97043
UbuntuPro:18.04:LTSgolang-1.13, golang-1.16, golang-1.18no fix listedUBUNTU-CVE-2026-97043
UbuntuPro:20.04:LTSgolang-1.16no fix listedUBUNTU-CVE-2026-97043
UbuntuPro:22.04:LTSgolang-1.13no fix listedUBUNTU-CVE-2026-97043
SUSELinux Enterprise High Performance Computing 15 SP4-ESPOS, Linux Enterprise High Performance Computing 15 SP4-LTSS, Linux Enterprise High Performance Computing 15 SP5-ESPOS and 8 morego1.261.26.11-150000.1.39.1SUSE-SU-2026:5227-1
SUSELinux Enterprise High Performance Computing 15 SP4-ESPOS, Linux Enterprise High Performance Computing 15 SP4-LTSS, Linux Enterprise High Performance Computing 15 SP5-ESPOS and 8 morego1.271.27.4-150000.1.18.1SUSE-SU-2026:5226-1
openSUSETumbleweedgo1.261.26.11-1.1openSUSE-SU-2026:12529-1
Alpinev3.24go1.26.11-r0ALPINE-CVE-2026-97043
Azure Linux3gccno fix listedAZL-113392
Azure Linux3golangno fix listedAZL-113420 AZL-113465
Azure Linux3python-tensorboardno fix listedAZL-113594
Azure Linux3tensorflowno fix listedAZL-113642

From the distributions' data via OSV.dev: the Debian Security Tracker; Ubuntu Security Notices © Canonical Ltd., CC BY-SA 4.0; SUSE security data, CC BY 4.0; the Alpine secdb, CC BY-SA 4.0; Microsoft's Azure Linux vulnerability data, MIT. Modified: reformatted and linked to CVE records. Credits. On the distributions' own pages: Debian · Ubuntu · SUSE · openSUSE · Alpine.

References

Check your stackJSON