GHSA-4x3g-87c5-vq62
Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessPublish malicious Go module with #cgo pkg-config directive
-
ExploitVictim builds/imports package with cgo enabled
-
ExecutionUntrusted .pc files loaded or compiler/linker flags injected
-
ImpactArbitrary code or path redirection executes during build
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 a victim build or compile an attacker-controlled Go package that uses a '#cgo pkg-config:' directive, with cgo enabled in the build. Specific triggering conditions named in the advisory: a '.pc' package argument ending in '.pc' or containing path separators or '..' (causing pkg-config to load a local '.pc' file directly from the package directory), or use of previously-allowlisted flags '--with-path=' or '--personality=', or a '--define-variable=' value beginning with '=' or '$' that rewrites system '.pc' paths into sysroot-prefixed '-L=' / '-L$SYSROOT' search paths; flags from 'pkg-config --cflags' in cgoCPPFLAGS were also unchecked for internal-linking safety. Limiting factors: the victim must actively build the untrusted package (UI:R), cgo must be enabled and pkg-config in use, and the affected toolchain versions (cmd/go < 1.26.11 or 1.27.0 through < 1.27.4) must be present; patched toolchains now disallow these flags and paths. |
| Impact | Signals are mixed and point to a real but conditional risk. The CVSS 3.1 vector (AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:L, 8.3 High) reflects that a remote, unauthenticated attacker can achieve high confidentiality and integrity impact, but only if a victim takes action (UI:R) - namely building/compiling an attacker-controlled Go package with cgo. EPSS is low (0.23%, 14th percentile), and the vuln.today decision label is 'this_week' (not act_now/emergency), consistent with a serious issue that is not under mass exploitation. There is no CISA KEV listing and no confirmed public exploit code, so this is not confirmed active exploitation. The practical risk is highest in CI/CD and developer environments that build third-party or untrusted Go modules; the UI:R requirement and build-time (rather than runtime) nature limit the blast radius compared with a remotely reachable service flaw. Net: a genuine supply-chain/toolchain priority to patch promptly, but not an emergency drop-everything event given low EPSS, no KEV, and the required victim build action. |
| Exploit ScenarioDerived | An attacker publishes a malicious Go module containing a '#cgo pkg-config:' directive crafted to load an attacker-supplied local '.pc' file or to inject compiler/linker flags (e.g. via '--with-path=', '--personality=', or a '--define-variable=' value beginning with '=' or '$'). When a developer or CI pipeline imports and builds that module with cgo enabled, the go command passes the attacker-controlled flags to the compiler/linker, leading to code execution or path redirection at build time. No public exploit code is identified at time of analysis, though the attack is straightforward given the detailed advisory. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv2 – Nov 16, 2026
Malicious Go packages that embed crafted "#cgo pkg-config:" directives can force the cmd/go build tool to load attacker-supplied pkg-config ".pc" files and to inject unvalidated compiler and linker flags, giving a booby-trapped dependency influence over how a victim's binary is compiled and linked (CWE-88 argument injection). The flaw affects cmd/go versions before 1.26.11 and 1.27.0 through 1.27.4, and only triggers when a victim builds an untrusted package with cgo enabled and pkg-config in use (CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:L, 8.3). No public exploit code was identified at time of analysis and EPSS is low at 0.23% (14th percentile), but vendor patches are available and the priority signal is to remediate this week.
Earlier versions of this analysis (1)
Go 1.27.4 and Go 1.26.11 are pre-announced security releases that will fix CVE-2026-97039 together with eleven other CVEs, and this entry currently carries no description, no CWE, no CVSS score and no CVSS vector. Consequently the affected Go feature, package or deployment mode, the attack vector, and any privilege or user-interaction prerequisites for CVE-2026-97039 cannot be established from the available data, and risk cannot be meaningfully quantified. The only confirmed fact is that a fix ships in Go 1.27.4 and Go 1.26.11; no public exploit code or exploitation reference was identified at time of analysis, and the technical details remain embargoed until the release advisory is published.
RemediationAI
Vendor-released patches are available: upgrade the Go toolchain to 1.26.11 or 1.27.4, which disallow "--with-path=", "--personality=", leading "=" or "$" characters in "--define-variable=" values and local ".pc" paths in "#cgo pkg-config:" directives, and which now inspect cgoCPPFLAGS when checking internal-linking compatibility. Confirm the running version with "go version" in every build environment, including CI runners and container base images, since a stale toolchain silently retains the vulnerable allowlist. To reduce exposure before patching, avoid building untrusted third-party Go packages with CGO_ENABLED=1 and prefer CGO_ENABLED=0 builds where the project permits it, at the cost of losing cgo-dependent functionality and any packages that require pkg-config; note that the vendor's fix is the complete remedy and that no other workaround is described in the available sources. Detections and version guidance are published in GO-2026-6852 (https://pkg.go.dev/vuln/GO-2026-6852) and the golang-announce advisory (https://groups.google.com/g/golang-announce/c/iY8TY0wWgbM).
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
The Go toolchain's cgo integration consults pkg-config to resolve compiler and linker flags declared in a package's "#cgo pkg-config:" directive, and pkg-config in turn parses ".pc" metadata files that carry include paths, library search paths and variable definitions. cmd/go maintained an allowlist of permitted pkg-config flags, and that allowlist was too permissive: it accepted "--with-path=" and "--personality=", it accepted "--define-variable=" values beginning with "=" or "$" (which can rewrite paths inside system ".pc" files into sysroot-prefixed "-L=" or "-L$SYSROOT" linker search paths), and it accepted package arguments ending in ".pc" or containing path separators or "..", which made pkg-config load a local ".pc" file straight out of the untrusted package directory. Separately, flags returned by "pkg-config --cflags" and placed into cgoCPPFLAGS were not inspected when the toolchain decided whether internal linking was safe, so a package could alter that decision. This is a classic argument-injection weakness (CWE-88): untrusted directive content reaches a downstream tool without adequate sanitisation, and the fix hardens the allowlist and extends the internal-linking check to cgoCPPFLAGS. Exploitation is conditional - the victim must actually build the attacker-controlled package with cgo and pkg-config active - but when those conditions hold the attacker gains high confidentiality and integrity impact with limited availability impact.
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:L
Malicious package is fetched over the network (AV:N) but must be built by the victim (UI:R) with no auth (PR:N); build-time flag/code injection yields high confidentiality and integrity impact.
Primary rating from Vendor (CNA).
CVSS VectorVendor
Lifecycle Timeline
4Description PRE-NVD
Executive ViewAI
CVE-2026-97039 is a high-severity argument injection vulnerability in the Go build tool (cmd/go) that could allow an attacker to manipulate the compilation and linking of software when developers build untrusted packages with cgo enabled. This poses a risk to any development team using affected Go versions, particularly those integrating third-party dependencies, and could lead to code injection or supply chain compromise.
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
Code injection occurs when an application accepts user input and passes it directly into a language interpreter or evaluator without proper sanitization.
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-123106
NVD
CVE.org
EPSS
VulDB
Exploit-DB