CVE-2026-97033: Go cgo arbitrary code execution via compiler flags

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

Go's cgo tool allows C/C++ code to be compiled and linked with Go programs. A malicious Go package can exploit overly permissive compiler and linker flags in cgo directives to execute arbitrary code during the build process, potentially compromising any system that builds the package. This affects developers and build systems that compile untrusted or compromised Go dependencies.

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

Quick answers

Is CVE-2026-97033 exploited in the wild?
No. Junglewise Threat Intelligence has no report of CVE-2026-97033 being exploited in the wild.
How severe is CVE-2026-97033?
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-97033?
Yes. toolchain (Go): upgrade to 1.27.4 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
How is CVE-2026-97033 attacked?
It is attacked with local access.
Am I affected by CVE-2026-97033?
Check whether you run go (Go) or toolchain (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

Technical details

The vulnerability arises from insufficient validation of compiler and linker flags passed through "#cgo" directives. Attackers can abuse flags like "--sysroot" (redirects compiler infrastructure), "-target" (fallback to current directory for helpers), "-isysroot"/"−Wl,−syslibroot" (interpret regular files as linker scripts), and "-x" (specify arbitrary input languages) to achieve code execution at build time. The fix restricts these flags: "--sysroot" and "-target" are disallowed, "-isysroot" and "-Wl,-syslibroot" are validated against regular files, and "-x" is limited to C, C++, Objective-C, and assembler.

Affected products

  • Go Go

Identifiers

  • CVE-2026-97033
  • GO-2026-6858

Timeline

  • 2026-11-11: disclosed

References

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