ZeroDay Brief
CVE-2026-97043

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…

CVSS
8.8High
Chance of exploitation (EPSS)
0.72%
Published
Nov 11, 2026
In the news
Not yet
More from this vendor

What to do

A serious security flaw in Go Toolchain Cmd Compile and Go Toolchain Cmd Go that can be attacked over the network without logging in, if someone is tricked into an action. No attacks are reported yet; it can go in your normal patch cycle.

Action: Check the vendor's advisory in the references and apply updates as soon as they are available.

Fixed in: 1.26.11, 1.27.4

Affected versions
Go Toolchain Cmd Compile
Before 1.26.11; 1.27.0-0 to before 1.27.4
Go Toolchain Cmd Go
Before 1.26.11; 1.27.0-0 to before 1.27.4

Description

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.

CWE-88

Affected products

Get alerts for these →

Timeline 21

Latest change: Tenable Cloud Security plugin 498938: Google: dev-lang/go: security update to 20346.0.42 (Dec 2, 2026)

News, advisories, exploit code, scanner detection and exploitation, newest first.

Wed, Nov 11, 2026

  1. CVECVE-2026-97043 published (CVSS 8.8)CVE Program · 05:19 UTC

References 4

You are leaving ZeroDay Brief

This link goes to exploit code on a third-party site. We find these links automatically and do not test, review or vouch for them. They may contain malware or fake exploits.

We are not responsible for anything that happens if you open the page or run its code. Never run exploit code on systems you care about.

↑ ↓ moveEnter openEsc closeTry “CVE-2026”, “fortinet” or “ivanti”