CVE-2026-97039: Flag sanitization bypass via "#cgo pkg-config:" directives in cmd/go
Vulnerability summary
CVE-2026-97039 is a high (CVSS 8.3) vulnerability in go toolchain cmd/go. EPSS estimates a 0.49% chance of exploitation in the next 30 days, higher than 43.6% of scored vulnerabilities.
Not severe (CVSS 8.3, network access); no exploitation reported by the 5 checked sources
Source freshness unavailable
How is this decided?Advisory lineage
Upstream 0 · Downstream 20 · Related 20Timeline
- 11-11-2026PublishedVulnerability first disclosed.
- 16-11-2026Last modifiedVulnerability information updated.
Description
Building a malicious package that uses "#cgo pkg-config:" directives could load untrusted pkg-config ".pc" files or inject unvalidated compiler and linker flags. The pkg-config flag allowlist previously permitted "--with-path=" and "--personality=", allowed "--define-variable=" values beginning with "=" or "$" (which can rewrite paths in system ".pc" files into sysroot-prefixed "-L=" or "-L$SYSROOT" linker search paths), and allowed package arguments ending in ".pc" or containing path separators or "..", which caused pkg-config to load local ".pc" files directly from the package directory. In addition, flags returned by "pkg-config --cflags" in cgoCPPFLAGS were not checked when determining whether internal linking is safe. The go command now disallows "--with-path=", "--personality=", leading "=" or "$" characters in "--define-variable=" values, and local ".pc" paths in "#cgo pkg-config:" directives, and inspects cgoCPPFLAGS when checking internal linking compatibility.
CVSS metrics
5 scores · 5 sources · 1 version- NVDNIST8.3HighCVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:L
- OSV · AlpineEcosystem advisory · calculated8.3HighCVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:L
- OSV · DebianEcosystem advisory · calculated8.3HighCVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:L
- OSV · UbuntuEcosystem advisory · calculated8.3HighCVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:L
EPSS trend
Probability
0.49%
Chance of exploitation in the next 30 days
Percentile
44%
Versus all other CVEs
30-day change
Change unavailable
Change unavailable
Known exploited
Compare KEV catalogsNot in the CISA KEV catalog.
Not in the ENISA CNW catalog.
Not in the CIRCL catalog.
Public exploits
0 foundNo public exploits indexed.
Weaknesses
CWE · root causeAffected systems
Known conditions: network-reachable, no authentication, user interaction (CVSS vector). Other conditions: not stated in public data.
Chainguard74 products
- azure-service-operatorAll versions (No fix recorded)
- commercial-chainloop-backendAll versions (No fix recorded)
- commercial-chainloop-cliAll versions (No fix recorded)
- commercial-expanso-edgeAll versions (No fix recorded)
- commercial-gitlab-rails-ee-19.1All versions (No fix recorded) | < 19.1.11-r0
Ubuntu17 products
- golang-1.10All versions (No fix recorded)
- golang-1.13All versions (No fix recorded)
- golang-1.14All versions (No fix recorded)
- golang-1.16All versions (No fix recorded)
- golang-1.17All versions (No fix recorded)
Wolfi7 products
- azure-service-operatorAll versions (No fix recorded)
- go-1.25All versions (No fix recorded)
- go-1.25-asmAll versions (No fix recorded)
- go-1.25-coverAll versions (No fix recorded)
- go-1.25-docAll versions (No fix recorded)
Debian4 products
- golang-1.19All versions (No fix recorded)
- golang-1.24All versions (No fix recorded)
- golang-1.26All versions (No fix recorded) | < 1.26.11-1
- golang-1.27All versions (No fix recorded) | < 1.27.4-1
Alpine1 product
- go< 1.26.11-r0 | < 1.27.4-r0
Go1 product
- toolchain≥ 1.27.0-0, < 1.27.4
Go toolchain1 product
- cmd/go< 1.26.11 | ≥ 1.27.0-0, < 1.27.4
7 vendors · 105 products
References
12 links- go.dev/issue/82571REPORT