CVE-2026-97042: Linker flag injection via cgo_import_dynamic and PE DLL names in cmd/cgo, cmd/compile, and cmd/link
Vulnerability summary
CVE-2026-97042 is a high (CVSS 8.8) vulnerability in go toolchain cmd/cgo. EPSS estimates a 0.57% chance of exploitation in the next 30 days, higher than 48.8% of scored vulnerabilities.
Not severe (CVSS 8.8, 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 "//go:cgo_import_dynamic" or links against a crafted PE object on Windows could pass unsafe library arguments to the external linker. The compiler only checked the first character of the library name in "//go:cgo_import_dynamic" directives and skipped validation in cgo-generated files. In addition, on Windows, "cmd/cgo" and "cmd/link" did not validate imported DLL names extracted from PE object files before emitting "-l<name>" flags for the external linker, allowing a crafted DLL name containing ".." path traversal or special characters to reference arbitrary files on disk. The compiler now validates every character of the library name in "//go:cgo_import_dynamic" directives (including in cgo-generated files on Windows) and rejects ".." path traversal, and "cmd/cgo" and "cmd/link" reject PE imported DLL names containing path separators, "..", ":", or leading "-" or "@".
CVSS metrics
5 scores · 5 sources · 1 version- NVDNIST8.8HighCVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
- OSV · AlpineEcosystem advisory · calculated8.8HighCVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
- OSV · DebianEcosystem advisory · calculated8.8HighCVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
- OSV · UbuntuEcosystem advisory · calculated8.8HighCVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
EPSS trend
Probability
0.57%
Chance of exploitation in the next 30 days
Percentile
49%
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.
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)
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
Go toolchain3 products
- cmd/cgo< 1.26.11 | ≥ 1.27.0-0, < 1.27.4
- cmd/compile< 1.26.11 | ≥ 1.27.0-0, < 1.27.4
- cmd/link< 1.26.11 | ≥ 1.27.0-0, < 1.27.4
Alpine1 product
- go< 1.26.11-r0 | < 1.27.4-r0
Go1 product
- toolchain≥ 1.27.0-0, < 1.27.4
5 vendors · 26 products
References
12 links- go.dev/issue/82568REPORT