All vulnerabilities

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.

From the CVE Program. Shortened; the full text is there.

Affected software

SoftwareAffected versions
cmd/compileGo · osv:Go:cmd/compile
  • Every version before 1.26.11
  • From 1.27.0-0 before 1.27.4
cmd/linkGo · osv:Go:cmd/link
  • Every version before 1.26.11
  • From 1.27.0-0 before 1.27.4

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
Search the list for cmd/compile

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
Search the list for cmd/link

References

  • CVE.org https://www.cve.org/CVERecord?id=CVE-2026-97041