high · 8.8 Patched

Unexpected code execution and arbitrary file write via Clang -gen-* and GCC -gnat* flags in cgo in cmd/go

CVE-2026-97035 · GHSA-6f8j-v7cw-qxpp · EUVD-2026-123110 · GO-2026-6856 · published 11 Nov 2026

How serious is it

  • Severity: high, CVSS score 8.8 out of 10.
  • No exploit prediction (EPSS) score yet.
  • Not on the CISA list of exploited vulnerabilities.
  • No public exploit in Exploit-DB.

Is your app affected by CVE-2026-97035?

Paste this prompt into Claude Code, Cursor or any AI coding tool: it runs a free Shippable scan of your project and fixes what it finds. Built with Lovable, Bolt or v0? Scan your live app. Or upload your package file.

Who is affected

  • toolchain (Go) < 1.26.11
  • toolchain (Go) >= 1.27.0-0, < 1.27.4

How to check

  1. Run go list -m toolchain in your project to see the installed version, including copies pulled in by other packages.
  2. Or paste your lockfile into the checker: it lists every package with a known vulnerability, this one included.

How to fix

Copies a prompt for Claude Code, Cursor or Codex: it checks your lockfiles for this and upgrades it.
  1. On < 1.26.11: Upgrade toolchain to 1.26.11 or later, commit the lockfile and redeploy.
  2. On >= 1.27.0-0, < 1.27.4: Upgrade toolchain to 1.27.4 or later, commit the lockfile and redeploy.
  3. If a vulnerable version was live, check your logs and rotate the secrets that server could read.

The advisory

When using Clang or GCC, building a malicious package that uses cgo could cause unexpected code execution at build time or write files to arbitrary directories via "-gen-*" or "-gnat*" flags in "#cgo" directives. The "-g*" wildcard in the compiler and linker flag allowlists previously matched Clang's two-argument "-gen-cdb-fragment-path <dir>" flag and GCC's two-argument "-gnatO <file>" flag, permitting compilation database fragments and sidecar output files to be written to arbitrary directories and desynchronizing flag argument parsing between the go command and the compiler driver so that subsequent arguments could be passed as unvalidated positional inputs to the linker. "-gen-*" and "-gnat*" flags are now disallowed in "#cgo" compiler and linker flags.

Check your whole app

Dependencies are only half of it. Free and read-only: before you push, run npx shippable-dev scan localhost:3000 in your project folder, no account needed. For your live app, you prove it's yours with a one-line tag first.

References

Merged from ENISA EUVD, OSV. Last updated 17 Nov 2026. All vulnerabilities · RSS · JSON