GHSA-6f8j-v7cw-qxpp
Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessPublish malicious cgo module
-
DeliveryVictim fetches and builds with Clang/GCC
-
ExploitCrafted #cgo -gen-*/-gnat* flags bypass allowlist
-
ExecutionDesynchronized parser passes positional args to linker
-
ImpactArbitrary code execution and file writes at build time
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V1 - Encoding and Sanitization Argument sanitization
|
| Exploitation Conditions | Exploitation requires that the victim build a malicious package that uses cgo, with Clang or GCC acting as the C compiler/linker, so that attacker-controlled '#cgo' directives can inject the two-argument '-gen-cdb-fragment-path <dir>' (Clang) or '-gnatO <file>' (GCC) flags that the old '-g*' allowlist wildcard mistakenly permitted. The decisive limiting factor is UI:R: an operator or CI pipeline must fetch and invoke a build on the untrusted package - there is no passive or network-service trigger. Exploitation is further constrained to toolchains using Clang or GCC (the specific flags are Clang/GCC-specific) and to vulnerable cmd/go versions (before 1.26.11, and 1.27.0 through before 1.27.4); updating to 1.26.11 or 1.27.4, which disallow '-gen-*' and '-gnat*' in '#cgo' flags, removes the condition. |
| Impact | This is a genuine build-time argument-injection flaw (CWE-88) in the Go toolchain's cmd/go, where the '-g*' wildcard in the cgo compiler/linker flag allowlist over-matched Clang's two-argument '-gen-cdb-fragment-path <dir>' and GCC's two-argument '-gnatO <file>' flags, allowing a malicious package's '#cgo' directives to write files to arbitrary directories and desynchronize argument parsing so later tokens reach the linker as unvalidated positional inputs, culminating in code execution at build time. The CVSS vector (AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H = 8.8) is internally consistent with a supply-chain trigger: network delivery of the package, low complexity, no attacker privileges, but required victim action (UI:R) because someone must actually build the hostile package. Signals pull in different directions on urgency: EPSS is low at 0.25% (17th percentile), there is no CISA KEV listing and no public exploit in the provided data, yet the vuln.today decision label is 'this_week' and the impact is full code execution on developer/CI hosts. The low EPSS likely reflects that exploitation is gated on a victim choosing to build untrusted cgo code with Clang or GCC rather than any mass-exploitable network service - treat this as a prompt-patch supply-chain hygiene item for build/CI fleets rather than an internet-facing emergency. No signals here conflict with the description; the main caveat is that 'network' vector describes package distribution, not a remotely reachable listening service. |
| Exploit ScenarioDerived | An attacker publishes or compromises a Go module containing cgo '#cgo' directives that smuggle '-gen-cdb-fragment-path' (Clang) or '-gnatO' (GCC) flags; when a developer or CI pipeline runs 'go build' against that dependency with Clang or GCC as the C compiler, the desynchronized flag parsing causes files to be written to attacker-chosen directories and arbitrary code to execute on the build host. No public exploit identified at time of analysis, but the mechanism is fully described in the vendor advisory. The attack succeeds only once the victim actually builds the malicious package (UI:R). |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv2 – Nov 16, 2026
Build-time code execution and arbitrary file writes in the Go toolchain's cmd/go affect Go releases before 1.26.11 and 1.27.0 through before 1.27.4 whenever a package using cgo is compiled with Clang or GCC as the C compiler/linker. The over-broad '-g*' wildcard in the cgo compiler and linker flag allowlists also matched Clang's two-argument '-gen-cdb-fragment-path <dir>' and GCC's two-argument '-gnatO <file>' flags, letting a malicious package's '#cgo' directives drop compilation-database fragments or sidecar output into arbitrary directories and desynchronize flag parsing so later tokens reach the linker as unvalidated positional inputs. Exploitation is not passive: it requires user interaction (UI:R), because an operator or CI pipeline must fetch and build the untrusted package, and there is no public exploit identified at time of analysis; EPSS is 0.25% (17th percentile), and the vendor has released fixed versions.
Earlier versions of this analysis (1)
The Go security team has pre-announced releases Go 1.27.4 and Go 1.26.11, and CVE-2026-97035 is one of twelve identifiers bundled into that pre-announcement with no technical detail attached. The affected package, deployment mode, and configuration are not named, and no CVSS vector, CWE class, or exploit status is provided, so it is not possible to say what an attacker gains or who is specifically exposed beyond users of the Go toolchain and standard library who have not yet moved to the fixed releases. There is no public exploit identified at time of analysis, and vulnerability intelligence feeds currently flag this entry as awaiting data pending the full advisory.
RemediationAI
Vendor-released patch: upgrade to Go 1.26.11 or Go 1.27.4, the releases that disallow '-gen-*' and '-gnat*' flags in '#cgo' compiler and linker flags and thereby close the parsing gap; both branches must be patched separately, so confirm the toolchain version used by every CI runner and build image rather than only developer machines. Advisory details and the fix review are at https://go.dev/cl/862148, https://go.dev/issue/82575, https://pkg.go.dev/vuln/GO-2026-6856 and https://groups.google.com/g/golang-announce/c/iY8TY0wWgbM. If the upgrade cannot be staged immediately, note that exposure exists only where a malicious package using cgo is built with Clang or GCC as the C compiler/linker, so builds that do not invoke cgo are not affected; restricting which external C toolchain is configured (or gating builds of untrusted third-party modules to an already-upgraded toolchain) reduces exposure, at the cost of breaking packages that legitimately require cgo with those drivers. Be aware that the fixed releases deliberately reject the previously accepted '-gen-*' and '-gnat*' flags, so any internal package that relied on them in '#cgo' directives will fail to build and must be reworked.
Affected VersionsENISA
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 2 packages in go, euvd
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
cgo lets Go packages embed C/C++/Fortran code and, through '#cgo' directives, pass compiler and linker flags to the external C toolchain. Because those flags come from the package source, cmd/go filters them against an allowlist; the allowlist entry '-g*' was intended to permit debug-info flags but was a prefix wildcard, so it also admitted Clang's '-gen-cdb-fragment-path <dir>' and GCC's '-gnatO <file>', both of which take a second argument naming an output path. This is a CWE-88 argument-injection class defect: the go command and the compiler driver disagree about how many tokens a flag consumes, so the path argument is interpreted one way by cmd/go and another by the driver, and the residual tokens are then treated as positional inputs to the linker. The concrete effects are writes of compilation-database fragments and sidecar output files to arbitrary directories and, through the linker argument desynchronization, code execution at build time. Only toolchains that actually use Clang or GCC are exposed, since the two-argument flags are specific to those drivers, and only vulnerable cmd/go versions; current releases reject '-gen-*' and '-gnat*' in '#cgo' compiler and linker flags.
Know when Golang gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
Malicious package is network-delivered (AV:N) and reliably triggers on a normal build (AC:L, PR:N), but a victim must choose to build it (UI:R), yielding full code execution (C/I/A:H).
Primary rating from Vendor (CNA).
CVSS VectorVendor
Lifecycle Timeline
4Description PRE-NVD
Executive ViewAI
CVE-2026-97035 is a high-severity (CVSS 8.8) build-time code execution vulnerability in the Go toolchain's cgo component that affects Go versions before 1.26.11 and 1.27.x before 1.27.4. It requires an operator or CI pipeline to build an untrusted package, allowing arbitrary file writes and potential compromise of build environments. Leadership should prioritize this because it can lead to code execution in CI/CD systems, risking supply chain integrity and data confidentiality.
Apply vendor patch.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
Remote Code Execution represents the critical moment when an attacker successfully runs arbitrary code on a target system without physical access.
Denial of service against HTTP/2 server implementations allows remote unauthenticated attackers to exhaust server resour
The SSH transport protocol with certain OpenSSH extensions, found in OpenSSH before 9.6 and other products, allows remot
The net/http package in Go through 1.6 does not attempt to address RFC 3875 section 4.1.18 namespace conflicts and there
Erugo file-sharing platform up to version 0.2.14 has a CVSS 10.0 path traversal allowing authenticated users to read any
Critical certificate validation bypass in Go crypto/tls during session resumption. If ClientCAs or RootCAs fields are mu
WAGO PFC200 G2 PLC (firmware affected) allows privilege escalation through cookie manipulation. Users can modify cookie
Authentication bypass in WeGIA charitable institution management system before 3.6.5. The adicionar_tipo_docs_atendido.p
CGI path splitting vulnerability in FrankenPHP before 1.11.2 — Unicode characters bypass path validation during CGI proc
net/url in Go before 1.11.13 and 1.12.x before 1.12.8 mishandles malformed hosts in URLs, leading to an authorization by
Free5gc NRF 1.4.0 has an authorization bypass in access token generation that allows authenticated users to request toke
Algo 8028 Control Panel version 3.3.3 contains a command injection vulnerability in the fm-data.lua endpoint that allows
Denial of service in PocketBase versions prior to 0.22.48 (0.22.x branch) and 0.23.0 through 0.39.6 (0.23.0+ branch) all
EUVD-2026-123110
NVD
CVE.org
EPSS
VulDB
Exploit-DB