Goal Reached Thanks to every supporter — we hit 100%!

Goal: 1000 CNY · Raised: 1359 CNY

100%

CVE-2026-97034— Arbitrary command execution via GCC spec files in cgo linker search directories in cmd/go

Quick assessment

Affected
Go toolchain cmd/go
Exploitation
No confirmed in-the-wild exploitation; assess based on exposure
Recommended action
Check the vendor advisory and references for a fixed version. If immediate upgrade is impossible, restrict exposure and increase monitoring.

在使用 GCC 时,构建一个使用了 cgo 的恶意包,可能通过不可信的 GCC spec 文件(即"specs"或"*.spec"文件),在链接阶段触发任意命令执行。当在 中链接时使用了 、 或 选项时,GCC 内置的链接 spec 会评估 或 ,并在 目录、sysroot 目录(包括其子目录及多架构兄弟目录,如 )中搜索 spec 文件;此外,若使用了 或 ,或者将 与 或 组合使用时,GCC 还会在当前工作目录中搜索 spec 文件。 为缓解该风险, 命令现已拒绝在包含 GCC spec 文件的目录中使用 、

AI Predicted 7.8 Difficulty: Moderate EPSS 0.65% · P52

Affected Version Matrix 2

VendorProduct Version RangeStatus
Go toolchain cmd/go < 1.26.11 affected
1.27.0-0< 1.27.4 affected
Get alerts for future matching vulnerabilities Log in to subscribe

I. Basic Information for CVE-2026-97034

Vulnerability Information

Have questions about the vulnerability? See if Shenlong's analysis helps!
View Shenlong Deep Dive ↗

Although we use advanced large model technology, its output may still contain inaccurate or outdated information.Shenlong tries to ensure data accuracy, but please verify and judge based on the actual situation.

Vulnerability Title
Arbitrary command execution via GCC spec files in cgo linker search directories in cmd/go
Source: CVE Program / CVE List V5
Vulnerability Description
When using GCC, building a malicious package that uses cgo could cause arbitrary command execution at link time via untrusted GCC spec files ("specs" or "*.spec"). When linking with "-fopenmp", "-fopenacc", or "-fsanitize=" in "#cgo LDFLAGS", GCC's built-in link spec evaluates "%:include(libgomp.spec)" or "%:include(libsanitizer.spec)" and searches for spec files in "-L" and sysroot directories (including subdirectories and multilib sibling directories such as "../lib64"), as well as the working directory when "-fopenmp" or "-fopenacc" is used or when "-fsanitize=" is combined with "-static" or "-static-lib*". The go command now rejects "-L", "-isysroot", and "-Wl,-syslibroot" directories (and the working and package directories when applicable) that contain GCC spec files, and disallows "@" and "-" prefixes in "-fsanitize=" compiler flag values.
Source: CVE Program / CVE List V5
CVSS Information
N/A
Source: CVE Program / CVE List V5
Vulnerability Type
N/A
Source: CVE Program / CVE List V5

Affected Products

Vendor Product Affected Versions CPE Subscribe
Go toolchain cmd/go 0 ~ 1.26.11 -

II. Public POCs for CVE-2026-97034

# POC Description Source Link Shenlong Link
AI-Generated POC Premium

No public POC found.

Login to generate AI POC

III. Intelligence Information for CVE-2026-97034

请登录查看更多情报信息。

Vendor Advisories for CVE-2026-97034 (2)

Vendor Pages for CVE-2026-97034 (1)

Other References for CVE-2026-97034 (1)

Same Patch Batch · Go toolchain · 2026-11-11 · 11 CVEs total

CVE-2026-97043 Unexpected code execution via escaped quotes in //go:cgo_ldflag in cmd/go and cmd/compile
CVE-2026-97040 Cgo directive injection via .syso files disguised as Go object files in cmd/go and cmd/lin
CVE-2026-97038 Arbitrary code execution via crafted .syso files and cgo linker input files in cmd/go
CVE-2026-97042 Linker flag injection via cgo_import_dynamic and PE DLL names in cmd/cgo, cmd/compile, and
CVE-2026-97036 Arbitrary code execution during build on darwin via "-l to_library" in cgo in cmd/go
CVE-2026-97039 Flag sanitization bypass via "#cgo pkg-config:" directives in cmd/go
CVE-2026-97037 Linker script injection via split -Wl, flags and Darwin or symbol linker flags in cgo in c
CVE-2026-97035 Unexpected code execution and arbitrary file write via Clang -gen-* and GCC -gnat* flags i
CVE-2026-97033 Unexpected code execution via --sysroot, -target, -isysroot, -Wl,-syslibroot, and -x cgo f
CVE-2026-97041 Host linker flag injection via //go:cgo_* directives in cmd/compile and cmd/link

IV. Related Vulnerabilities