CVE-2026-97040: Go linker arbitrary flag injection via crafted .syso files

CVE-2026-97040 · Severity: info · Published 2026-11-11

Go's build system can be tricked into injecting arbitrary linker flags when building packages that include specially crafted ".syso" object files. An attacker could craft a package with a malicious ".syso" file to execute arbitrary commands during the build process, potentially compromising the compiled binary or the build environment.

Technologies: toolchain (Go), Google Go. Vendors: Go, Google.

Quick answers

Is CVE-2026-97040 exploited in the wild?
No. Junglewise Threat Intelligence has no report of CVE-2026-97040 being exploited in the wild.
How severe is CVE-2026-97040?
Informational severity, published 11 November 2026.
Which products and versions are affected?
toolchain (Go) SEMVER:introduced=0,fixed=1.26.11,introduced=1.27.0-0,fixed=1.27.4; Google Go versions prior to the fix.
Is there a fix for CVE-2026-97040?
Yes. toolchain (Go): upgrade to 1.27.4 or later. Until then: Update Go to a patched version that rejects ".syso" files not recognized as valid host object formats (ELF, Mach-O, PE, XCOFF) and preserves the ".syso" suffix when truncating long archive member names.</anigation> <parameter name="timeline">[{"kind": "disclosed", "at": "2026-11-11"}] Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
How is CVE-2026-97040 attacked?
It is attacked with local access, in a software library.
Am I affected by CVE-2026-97040?
Check whether you run toolchain (Go) or Google Go at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

How to fix

  • toolchain (Go): upgrade to 1.27.4 or later
    go get toolchain@v1.27.4

Update Go to a patched version that rejects ".syso" files not recognized as valid host object formats (ELF, Mach-O, PE, XCOFF) and preserves the ".syso" suffix when truncating long archive member names.</anigation> <parameter name="timeline">[{"kind": "disclosed", "at": "2026-11-11"}]

Technical details

The vulnerability exists in Go's linker and package build tools, which failed to properly validate ".syso" (system object) files before parsing them as Go compiler objects. By crafting a ".syso" file with a "go object" header containing untrusted cgo directives like "cgo_ldflag" or "cgo_dynamic_linker", an attacker could bypass flag validation and inject arbitrary flags to the external linker. The issue also affected filename truncation in archive headers where ".syso" extensions were lost for filenames longer than 16 bytes.

Affected products

  • Google Go versions prior to the fix

Identifiers

  • CVE-2026-97040
  • GO-2026-6851

References

This page as Markdown. Free to reuse under CC BY 4.0 with a link back.