CVE-2026-97043: 
Golang vulnerability analysis and mitigation

Overview

CVE-2026-97043 is a cgo LDFLAGS validation bypass vulnerability in the Go toolchain (cmd/go and cmd/compile) that allows a malicious package to execute arbitrary code at build time or cause the go command to panic. The flaw stems from a mismatch in how cmd/cgo encodes #cgo LDFLAGS arguments (using strconv.Quote) versus how cmd/compile and cmd/go parse the resulting //go:cgo_ldflag directives (splitting on raw quote characters without handling backslash escapes). Affected versions include cmd/go and cmd/compile prior to Go 1.26.11 and prior to Go 1.27.4 (in the 1.27.x series). The vulnerability was published on November 11, 2026, with patches available in the same release. The CVSS category is estimated as High (GitHub Advisory, Feedly).

Technical details

The root cause is an argument injection flaw (CWE-88) arising from a parsing mismatch in the Go toolchain's cgo pipeline. When cmd/cgo generates _cgo_gotypes.go, it encodes each #cgo LDFLAGS argument using strconv.Quote, embedding backslash-escaped quotes in //go:cgo_ldflag directives. However, cmd/compile and cmd/go parsed these directives by naively splitting on raw double-quote characters, without unquoting or handling backslash escapes — allowing crafted quoting sequences to smuggle disallowed linker flags or unvalidated linker search paths past the toolchain's security checks and deliver them directly to the external linker. A secondary bug in processCgoOutputs caused an out-of-bounds slice panic when deduplicating LDFLAGS if a prefix of the flag list matched near the end of the slice. The fix applies strconv.Unquote when parsing //go:cgo_* pragma strings and corrects the slice bounds check (GitHub Advisory, Go Issue).

Impact

A developer or automated build system that builds a malicious Go package using cgo could have arbitrary code executed on their machine at build time — without any runtime deployment of the package being necessary. This makes the vulnerability particularly dangerous in supply chain attack scenarios, where a compromised or malicious dependency could silently compromise developer workstations and CI/CD build infrastructure. Additionally, the out-of-bounds slice panic can be triggered to crash the go command, causing denial of service to build pipelines (GitHub Advisory, Feedly).

Exploitability

As of the publication date, there is no public proof-of-concept exploit and no evidence of in-the-wild exploitation (Feedly). The EPSS score is 0.0, indicating a currently low probability of exploitation in the near term. The vulnerability is not listed in the CISA Known Exploited Vulnerabilities (KEV) catalog. Exploitation requires an attacker to craft and distribute a malicious Go package that a victim then builds locally — a realistic supply chain attack vector, but one requiring social engineering or repository compromise to deliver the payload.

Exploitation steps

  1. Craft a malicious Go package: Create a Go package that uses cgo and includes a #cgo LDFLAGS directive with carefully crafted backslash-escaped quoting sequences in the C preamble, designed to smuggle disallowed linker flags (e.g., -rpath with an attacker-controlled path, or flags that load a malicious shared library) past the Go toolchain's validation.
  2. Exploit the parsing mismatch: When cmd/cgo processes the package, it encodes the LDFLAGS argument with strconv.Quote. The resulting //go:cgo_ldflag directive contains backslash-escaped quotes that cmd/compile/cmd/go parse incorrectly by splitting on raw quote characters, allowing the smuggled flags to pass validation.
  3. Distribute the package: Publish the malicious package to a public or private Go module proxy/repository, or introduce it as a dependency in a supply chain attack (e.g., typosquatting, dependency confusion, or compromising an existing package).
  4. Trigger victim build: When a developer or CI/CD system runs go build or go get on a project that depends on the malicious package, the smuggled linker flags are passed to the external linker.
  5. Achieve code execution: The external linker processes the attacker-controlled flags, potentially loading a malicious shared library or executing attacker-supplied code at build time on the victim's machine (GitHub Advisory, Go Issue).

Indicators of compromise

  • Build Logs: Unexpected or unrecognized linker flags appearing in go build verbose output (-v or -x flags); linker invocations referencing unusual -rpath values or external shared library paths.
  • File System: Unexpected shared libraries (.so, .dylib, .dll) created or loaded from non-standard directories during a Go build; new executables or scripts written to the build cache or temp directories.
  • Process: Unusual child processes spawned by the go or linker process (e.g., shell commands, network utilities) during a go build invocation; go command crashing with an out-of-bounds panic traceback referencing processCgoOutputs.
  • Network: Outbound network connections from the build host to unexpected external IPs initiated during or immediately after a go build operation.
  • Logs: Go build output containing panic stack traces referencing cmd/go internal cgo processing functions, particularly processCgoOutputs (GitHub Advisory).

Mitigation and workarounds

Update the Go toolchain to Go 1.26.11 (for the 1.26.x series) or Go 1.27.4 (for the 1.27.x series), which fix both the quote-parsing mismatch and the out-of-bounds slice panic in processCgoOutputs. As a workaround prior to patching, avoid building Go packages from untrusted or unverified sources, and implement supply chain security controls (e.g., module verification via GONOSUMCHECK, GOFLAGS=-mod=vendor, or dependency pinning with checksums). Organizations using automated build pipelines should audit their Go dependency trees for unexpected cgo-using packages (GitHub Advisory, Go CL).

Community reactions

The vulnerability was announced via the official golang-announce mailing list and discussed on oss-sec, following standard Go security disclosure practices (golang-announce, oss-sec). No notable independent researcher commentary or significant social media discussion has been identified beyond standard vulnerability tracking and aggregation sites.

Additional resources

Linux Distribution fix status

Fix availability across major Linux distributions and their releases.

Debian

Affected

bookworm

golang-1.19

Affected

sid

golang-1.27: 1.27.4-1

Fixed

trixie

golang-1.24

Affected

RHEL / CentOS

Affected

OpenShift

openshift4/ose-operator-sdk-rhel8

Affected

RHEL 8

Not Affected

RHEL 9

Not Affected

RHEL 10

Not Affected

Source: This report was generated using AI

Related Golang vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2026-97043NONEN/A
  • Golang logoGolang
  • go-toolset:rhel8::golang-bin
NoYesNov 11, 2026
CVE-2026-97042NONEN/A
  • Golang logoGolang
  • golang
NoYesNov 11, 2026
CVE-2026-97041NONEN/A
  • Golang logoGolang
  • go-toolset:rhel8::golang-src
NoYesNov 11, 2026
CVE-2026-97040NONEN/A
  • Golang logoGolang
  • cpe:2.3:a:golang:go
NoYesNov 11, 2026
CVE-2026-97039NONEN/A
  • Golang logoGolang
  • go-toolset:rhel8::golang-bin
NoYesNov 11, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Additional Wiz resources

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management