All vulnerabilities

Go

CVE-2026-97040

Cgo directive injection via .syso files disguised as Go object files in cmd/go and cmd/link

Severity
Critical 9.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.8% in the next 30 daysHigher than 57% of CVEs. EPSS by FIRST, 24 Nov 2026
Weakness
Code injection (CWE-94)
Attack
Over the network · No login needed · No user action needed
Attacker can
Read data · Change data · Take it down
CVSS vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Sources
CVE Program

Description

Building a package containing a crafted ".syso" file could bypass cgo flag validation and inject arbitrary linker flags when linking. When loading ".syso" entries from a package archive, the linker only checked for recognized host object headers (ELF, Mach-O, PE, and XCOFF) before falling through to Go object parsing. A ".syso" file beginning with a "go object" header was parsed as a Go compiler object, allowing untrusted cgo metadata directives (such as "cgo_ldflag" or "cgo_dynamic_linker") embedded in the ".syso" file to be passed to the external linker without validation. Additionally, ".syso" filenames longer than 16 bytes lost their ".syso" extension when truncated in archive headers, and unrecognized ".syso" formats forced external linking in pure-Go builds. The linker now rejects ".syso" files that are not recognized host object formats, and "cmd/go" and "cmd/pack" preserve the ".syso" suffix when truncating long archive member names.

From the CVE Program.

Affected software

SoftwareAffected versions
cmd/goGo · osv:Go:cmd/go
  • 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/go

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