Patchfirst
CVE-2026-97040 Critical · 9.8 EPSS 0.8%

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

Fix:upgrade toolchain to 1.27.4 or later Details ↓

Go toolchain · cmd/go

Summary

The flaw lies in the Go toolchain's cmd/go and cmd/link components: when a package contains a ".syso" file that begins with a Go object header, the linker parses it as a Go object and passes embedded cgo directives such as "cgo_ldflag" or "cgo_dynamic_linker" to the external linker without validation. An attacker who can get a crafted ".syso" file into a package that is then built, with no further authentication or user interaction required, can inject arbitrary linker flags during the build.

Official description · NVD

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.

Breakdown
20.4 / 100
Exploited
Not confirmed
Reports
0
Tactics
0/15

Disclosed on 11 Nov 2026. No public exploit code or confirmed exploitation is recorded.

Affected versions and fixes

as published in the CVE record

Go toolchain cmd/go

Affected: < 1.26.11 · >= 1.27.0-0, < 1.27.4

Go toolchain cmd/link

Affected: < 1.26.11 · >= 1.27.0-0, < 1.27.4

Am I affected? What do I upgrade to?

From GitHub Security Advisories and OSV

1 package in 1 ecosystem. Main package: toolchain.

GotoolchainGO-2026-6851

Upgrade to 1.27.4 or later

Set the version to Go 1.27.4 or later in your Go toolchain.

The first fix for CVE-2026-97040.

Affected versions, by release line

If you runUpgrade to
1.27.0-0 up to 1.27.41.27.4
All versions before 1.26.111.26.11

“Up to” means the second version is the fix and is not affected.

Check your lockfile against all CVEs

What security researchers reported

Not named in any threat report yet

Also mentioned in 7 community threat pulses (AlienVault OTX)

Weaker evidence

Pulses are indicator collections that anyone can publish. A mention is not confirmation of exploitation.

References

4 links, grouped by NVD tag
↑ ↓ chooseEnter openEsc close