CVE-2026-97042 json
Linker flag injection via cgo_import_dynamic and PE DLL names in cmd/cgo, cmd/compile, and cmd/link
published yesterday modified yesterday also EUVD-2026-123103 , GO-2026-6849
- cvss
- —
- not scored
- cisa kev
- Not listed
- not in CISA's catalog
- epss
- 0.2%
- EPSS 0.2% chance of exploitation in 30 days, percentile 14%
- public exploits
- 0
- none known
Summary
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 "@".
Patch / fix
- go toolchain 1.26.11, 1.27.4
- Go toolchain cmd/cgo 1.26.11, 1.27.4
- Go toolchain cmd/compile 1.26.11, 1.27.4
- Go toolchain cmd/link 1.26.11, 1.27.4
- go.dev/cl/862155 patch
Is CVE-2026-97042 in your dependencies? Fencer shows which of your repositories are affected as soon as an advisory lands, and opens the fix as a pull request.
Check with FencerExploit prediction
0.23% chance of exploitation in the next 30 days, higher than 14% of all scored CVEs (FIRST EPSS, 2026-11-11).
Affected packages
| ecosystem | package | affected | fixed in |
|---|---|---|---|
| go | toolchain | <1.26.11 >=1.27.0-0, <1.27.4 |
1.26.11 1.27.4 |
Affected products
- Go toolchain cmd/cgo
- Go toolchain cmd/compile
- Go toolchain cmd/link
Classification
- Weakness
-
- CWE-88 Improper Neutralization of Argument Delimiters in a Command
References
Sources
- CVE List CVE-2026-97042
- NVD CVE-2026-97042
- OSV GO-2026-6849
Fencer Intel keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.