SEVERITY NOT PROVIDED EPSS 0.8% · 57th percentile

CVE-2026-97040: Cgo directive injection via .syso files disguised as Go object files in cmd/go and cmd/link

Published 2026-11-11 · Updated 2026-11-25 · Also known as GO-2026-6851

Summary

A flaw in the Go toolchain allows crafted `.syso` files disguised as Go compiler objects to bypass cgo flag validation and inject arbitrary linker flags. Engineering teams using affected Go toolchain versions should update their environments.

Who is affected

This flaw impacts environments building Go packages that include untrusted or crafted `.syso` files. When processed, files starting with a Go object header pass unvalidated cgo metadata directives, such as `cgo_ldflag` or `cgo_dynamic_linker`, to the external linker. In addition, long `.syso` filenames lost their extensions when truncated in archive headers, and unrecognized `.syso` formats forced external linking in pure-Go builds.

Exploitability

CVSS metrics and vector details are not provided for this entry. The EPSS score is 0.008, representing the 0.573 percentile. CISA KEV indicates that active exploitation is not documented.

Remediation

How to check your project

Automated analysis of the published advisory data, generated 2026-11-25. Not human-reviewed; verify against the official advisory. How this works.

Affected packages

EcosystemPackageAffected versionsFixed inUpgrade
Go toolchain >= 0, < 1.26.11 1.26.11 go get [email protected]
Go toolchain >= 1.27.0-0, < 1.27.4 1.27.4 go get [email protected]

FAQ

What caused `.syso` files to bypass cgo flag validation?

The linker checked only for recognized host object headers before falling back to Go object parsing. A `.syso` file starting with a Go object header was parsed as a Go compiler object, exposing unvalidated cgo metadata directives directly to the external linker.

Are there any documented workarounds for this vulnerability?

Workarounds are not documented; affected systems must be remediated by upgrading to the fixed Go toolchain versions.

Is CVE-2026-97040 actively exploited in the wild?

No active exploitation is reported; the CISA KEV status for this record is set to 'no'.

Original advisory 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.

References

Source records: GO-2026-6851 (OSV.dev) · EPSS by FIRST, 2026-11-25.