Vulnerability
CVE-2026-97033
Building a malicious package that uses cgo could cause arbitrary code execution at build time through several compiler and linker flags permitted in "#cgo" directives. Specifically, "--sysroot" in GCC and Clang relocates compiler subprograms, spec files, and CRT startup objects to an attacker-controlled directory; "-target" in Clang falls back to executing target helper tools from the current working directory when not found in PATH; "-isysroot" and "-Wl,-syslibroot" can pass a regular file on disk to GNU ld.bfd, which interprets it as a positional linker script; and "-x" permitted specifying arbitrary compiler input languages beyond those supported by cgo. "--sysroot" and "-target" are now disallowed in "#cgo" flags, "-isysroot" and "-Wl,-syslibroot" are verified not to point to regular files, and "-x" is restricted to the C, C++, Objective-C, and assembler languages supported by cgo.
357 advisories report this vulnerability, across 14 ecosystems.
Advisories in Wolfi
- CGA-2cj8-2f49-c4h4
- CGA-2r7r-pxgv-hr58
- CGA-35gx-c262-64pg
- CGA-38m4-7w88-m6mm
- CGA-3frr-5w4v-gg5g
- CGA-3x4c-p4vf-27h3
- CGA-56g5-vw2p-fc23
- CGA-64r5-fp9q-3268
- CGA-6hhc-g26j-34q3
- CGA-6whq-4f8p-jjm2
- CGA-76g5-32x2-cm69
- CGA-7x2q-5935-rcpm
- CGA-8cgm-4wm9-jmq5
- CGA-9c2p-vvpq-qv3h
- CGA-9wgw-fpqv-hfh3
- CGA-c39v-q8w9-mrj5
- CGA-c4f9-jcpm-m5mj
- CGA-c552-rx42-rrxc
- CGA-cw5g-mm84-337x
- CGA-f485-p9gq-gv9q
- CGA-fpfv-gvjh-vr64
- CGA-fx63-r5h6-m82x
- CGA-g2xj-689m-hfq8
- CGA-g4jj-449r-6rf7
- CGA-ggjr-8p27-j339
- CGA-gq3r-qrh4-432x
- CGA-h8w4-wvmp-rq45
- CGA-hg5x-m96c-372f
- CGA-hgq3-hq9v-pw4x
- CGA-hmhf-whjq-j2w7
- CGA-j283-fj9q-375m
- CGA-j32h-jp55-5h4w
- CGA-jgwx-fmjq-vjfc
- CGA-mrvg-2jmg-4xw9
- CGA-pv92-c6mw-693j
- CGA-q5xp-8q6c-42qx
- CGA-r86r-jpph-w47r
- CGA-rrch-pvh2-jf2p
- CGA-vpx6-jmcg-vvq5
- CGA-vw3p-j3fp-fgjq