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

Goal: 1000 CNY · Raised: 1359 CNY

100%

CVE-2026-97040— Cgo directive injection via .syso files disguised as Go object files in cmd/go and cmd/link

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.

构建包含恶意构造的".syso"文件的包,可绕过 cgo 标志验证,并在链接时注入任意链接器标志。当从包归档中加载".syso"条目时,链接器仅检查是否识别主机的目标文件头(ELF、Mach-O、PE 和 XCOFF);若未识别,则回退到 Go 对象解析流程。若".syso"文件以"Go 对象”头开始,会被解析为 Go 编译器生成的目标文件,导致其中嵌入的不可信 cgo 元数据指令(如"cgo_ldflag"或"cgo_dynamic_linker")未经验证即被传递给外部链接器。此外,长度超过 16 字节的".s

AI Predicted 8.8 Difficulty: Moderate EPSS 0.63% · P51

Possible ATT&CK Techniques 1 AI

T1190 · Exploit Public-Facing Application

Affected Version Matrix 4

VendorProduct Version RangeStatus
Go toolchain cmd/go < 1.26.11 affected
1.27.0-0< 1.27.4 affected
Go toolchain cmd/link < 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-97040

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
Cgo directive injection via .syso files disguised as Go object files in cmd/go and cmd/link
Source: CVE Program / CVE List V5
Vulnerability Description
Building a package containing a crafted ".syso" file could bypass cgo flag validation and inject arbitrary linker flags when linking. When loading ".syso" entries from a package archive, the linker only checked for recognized host object headers (ELF, Mach-O, PE, and XCOFF) before falling through to Go object parsing. A ".syso" file beginning with a "go object" header was parsed as a Go compiler object, allowing untrusted cgo metadata directives (such as "cgo_ldflag" or "cgo_dynamic_linker") embedded in the ".syso" file to be passed to the external linker without validation. Additionally, ".syso" filenames longer than 16 bytes lost their ".syso" extension when truncated in archive headers, and unrecognized ".syso" formats forced external linking in pure-Go builds. The linker now rejects ".syso" files that are not recognized host object formats, and "cmd/go" and "cmd/pack" preserve the ".syso" suffix when truncating long archive member names.
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 -
Go toolchain cmd/link 0 ~ 1.26.11 -

II. Public POCs for CVE-2026-97040

# 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-97040

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

Vendor Advisories for CVE-2026-97040 (2)

Vendor Pages for CVE-2026-97040 (1)

Other References for CVE-2026-97040 (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-97038 Arbitrary code execution via crafted .syso files and cgo linker input files in cmd/go
CVE-2026-97034 Arbitrary command execution via GCC spec files in cgo linker search directories 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