CVE-2026-97034: Go compiler arbitrary command execution via untrusted GCC spec files

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

Go's compiler can execute arbitrary commands at build time when compiling packages that use cgo with certain GCC linking flags, if an attacker can place malicious GCC spec files in directories searched during the build process. An attacker who controls build artifacts or dependencies could achieve code execution on developer machines or build systems during the compilation of a Go package.

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

Quick answers

Is CVE-2026-97034 exploited in the wild?
No. Junglewise Threat Intelligence has no report of CVE-2026-97034 being exploited in the wild.
How severe is CVE-2026-97034?
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.
Is there a fix for CVE-2026-97034?
Yes. toolchain (Go): upgrade to 1.27.4 or later. Until then: Do not build untrusted Go packages or place untrusted code in build directories where GCC spec files could be injected. Ensure build systems isolate dependency compilation in restricted directories. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
How is CVE-2026-97034 attacked?
It is attacked with local access, in a software library.
Am I affected by CVE-2026-97034?
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

Do not build untrusted Go packages or place untrusted code in build directories where GCC spec files could be injected. Ensure build systems isolate dependency compilation in restricted directories.

Technical details

When Go uses GCC to link code with "-fopenmp", "-fopenacc", or "-fsanitize=" flags via cgo, GCC searches for and evaluates spec files from "-L" directories, sysroot directories, and the working directory. An attacker can place malicious spec files in these locations to inject arbitrary link commands. The Go compiler now rejects such directories containing spec files and restricts "-fsanitize=" flag syntax to prevent this attack.

Affected products

  • Google Go

Identifiers

  • CVE-2026-97034
  • GO-2026-6857

Timeline

  • 2026-11-11: disclosed

References

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