All vulnerabilities

Go

CVE-2026-97042

Linker flag injection via cgo_import_dynamic and PE DLL names in cmd/cgo, 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 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" 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 "@".

From the CVE Program.

Affected software

SoftwareAffected versions
cmd/cgoGo · osv:Go:cmd/cgo
  • Every version before 1.26.11
  • From 1.27.0-0 before 1.27.4
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/cgo

This is the only vulnerability in cmd/cgo in our list.

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-97042