Go
CVE-2026-97041
Host linker flag injection via //go:cgo_* directives in cmd/compile and cmd/link
- Severity
- High 8.8
- Published
- 11 Nov 2026
- Last changed
- 16 Nov 2026
- Added to UpHeron
- 23 Nov 2026
- Fixed in
- 1.26.11, 1.27.4
- Exploit chance
- 0.6% in the next 30 daysHigher than 48% of CVEs. EPSS by FIRST, 24 Nov 2026
- Weakness
- Argument injection (CWE-88)
- Attack
- Over the network · No login needed · Needs someone to click or open something
- Attacker can
- Read data · Change data · Take it down
- CVSS vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H- Sources
- CVE Program
Description
Building a malicious package containing "//go:cgo_*" compiler directives could inject arbitrary flags into the external linker invocation on ELF platforms. The compiler and linker did not reject commas in "//go:cgo_import_dynamic", "//go:cgo_export_dynamic", "//go:cgo_export_static", "//go:cgo_import_static", and "//go:cgo_dynamic_linker" directives, and the linker passed the dynamic linker path using "-Wl,--dynamic-linker,". Furthermore, the two-argument form of "//go:cgo_import_dynamic" (which is permitted in non-cgo Go source files) could overwrite the external symbol name of a symbol already marked for cgo export. A symbol name or dynamic linker path containing a comma or leading "@" could split "-Wl,--export-dynamic-symbol=" or "-Wl,--dynamic-linker," into arbitrary host linker flags or response file arguments.
Affected software
| Software | Affected versions |
|---|---|
cmd/compileGo · osv:Go:cmd/compile |
|
cmd/linkGo · osv:Go:cmd/link |
|
About cmd/compile
Vulnerabilities in cmd/compile
- In our list
- 3
- Published in the last 12 months
- 3
- Critical, last 12 months
- 0
- High, last 12 months
- 3
- Known exploited
- 0
- CVE-2026-97042Linker flag injection via cgo_import_dynamic and PE DLL names in cmd/cgo, cmd/compile, and cmd/linkHigh 8.8 11 Nov 2026
- CVE-2026-97043Unexpected code execution via escaped quotes in //go:cgo_ldflag in cmd/go and cmd/compileHigh 8.8 11 Nov 2026
About cmd/link
Vulnerabilities in cmd/link
- In our list
- 3
- Published in the last 12 months
- 3
- Critical, last 12 months
- 1
- High, last 12 months
- 2
- Known exploited
- 0
- CVE-2026-97040Cgo directive injection via .syso files disguised as Go object files in cmd/go and cmd/linkCritical 9.8 11 Nov 2026
- CVE-2026-97042Linker flag injection via cgo_import_dynamic and PE DLL names in cmd/cgo, cmd/compile, and cmd/linkHigh 8.8 11 Nov 2026
References
- CVE.org https://www.cve.org/CVERecord?id=CVE-2026-97041