{"id":"CVE-2026-97033","aliases":["DEBIAN-CVE-2026-97033","EUVD-2026-123112","GHSA-428h-9j26-5fcf","GO-2026-6858","openSUSE-SU-2026:12529-1"],"status":"published","title":"Unexpected code execution via --sysroot, -target, -isysroot, -Wl,-syslibroot, and -x cgo flags in cmd/go","description":"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.","epss":{"day":"2026-11-12","score":0.00252,"percentile":0.16818,"model":"v2026.06.15"},"facts":{"in_kev":false,"known_exploited":false,"public_exploit":false,"fix_available":true},"published":"2026-11-11T00:00:00Z","modified":"2026-11-12T17:23:23Z","fixes":[{"ecosystem":"Go","package":"toolchain","fixed_in":["1.26.11","1.27.4"],"sources":["osv"]}],"affected":[{"source":"osv","ecosystem":"Debian:12","package":"golang-1.19","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["1.19.10-1","1.19.10-2","1.19.11-1","1.19.12-1","1.19.12-2","1.19.12-2~bpo11+1","1.19.12-2~bpo12+1","1.19.13-1","1.19.13-1~bpo11+1","1.19.13-1~bpo12+1","1.19.8-2","1.19.9-1"]},{"source":"osv","ecosystem":"Debian:13","package":"golang-1.24","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["1.24.12-1","1.24.13-1","1.24.13-2","1.24.4-1","1.24.4-2","1.24.4-3","1.24.4-4","1.24.7-1","1.24.8-1","1.24.9-1"]},{"source":"osv","ecosystem":"Debian:14","package":"golang-1.26","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["1.26.0-1","1.26.1-1","1.26.10-1","1.26.10-1~bpo13+1","1.26.11-1","1.26.2-1","1.26.2-2","1.26.2-3","1.26.3-1","1.26.3-1~bpo13+1","1.26.3-2","1.26.3-2~bpo13+1","1.26.4-1","1.26.4-1~bpo13+1","1.26.5-1","1.26.5-1~bpo13+1","1.26.6-1","1.26.6-2","1.26.7-1","1.26.7-1~bpo13+1","1.26.8-1","1.26.8-1~bpo13+1","1.26.8-2","1.26.9-1","1.26.9-1~bpo13+1","1.26~rc2-1","1.26~rc3-1","1.26~rc3-2"]},{"source":"osv","ecosystem":"Debian:14","package":"golang-1.27","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["1.27.0-1","1.27.0-1~bpo13+1","1.27.1-1","1.27.1-2","1.27.1-2~bpo13+1","1.27.2-1","1.27.2-1~bpo13+1","1.27.2-1~bpo13+2","1.27.3-1","1.27.3-1~bpo13+1","1.27.4-1","1.27~rc1-1","1.27~rc2-1","1.27~rc3-1"]},{"source":"osv","ecosystem":"Go","package":"toolchain","ranges":[{"type":"SEMVER","events":[{"introduced":"0"},{"fixed":"1.26.11"},{"introduced":"1.27.0-0"},{"fixed":"1.27.4"}]}]},{"source":"osv","ecosystem":"openSUSE:Tumbleweed","package":"go1.26","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"1.26.11-1.1"}]}],"bundled":12}],"products":[{"vendor":"go toolchain","product":"cmd/go"}],"references":[{"url":"https://go.dev/cl/862146","tags":["fix"]},{"url":"https://go.dev/issue/82577","tags":["report"]},{"url":"https://groups.google.com/g/golang-announce/c/iY8TY0wWgbM","tags":["web"]},{"url":"https://pkg.go.dev/vuln/GO-2026-6858"},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-97033"},{"url":"https://github.com/advisories/GHSA-428h-9j26-5fcf"},{"url":"https://security-tracker.debian.org/tracker/CVE-2026-97033","tags":["advisory"]},{"url":"","tags":["advisory"]},{"url":"https://www.suse.com/security/cve/CVE-2026-97033","tags":["web"]},{"url":"https://www.suse.com/security/cve/CVE-2026-97034","tags":["web"]},{"url":"https://www.suse.com/security/cve/CVE-2026-97035","tags":["web"]},{"url":"https://www.suse.com/security/cve/CVE-2026-97036","tags":["web"]},{"url":"https://www.suse.com/security/cve/CVE-2026-97037","tags":["web"]},{"url":"https://www.suse.com/security/cve/CVE-2026-97038","tags":["web"]},{"url":"https://www.suse.com/security/cve/CVE-2026-97039","tags":["web"]},{"url":"https://www.suse.com/security/cve/CVE-2026-97040","tags":["web"]},{"url":"https://www.suse.com/security/cve/CVE-2026-97041","tags":["web"]},{"url":"https://www.suse.com/security/cve/CVE-2026-97042","tags":["web"]},{"url":"https://www.suse.com/security/cve/CVE-2026-97043","tags":["web"]},{"url":"https://www.suse.com/security/cve/CVE-2026-97054","tags":["web"]}],"sources":{"cve":[{"id":"CVE-2026-97033","title":"Unexpected code execution via --sysroot, -target, -isysroot, -Wl,-syslibroot, and -x cgo flags in cmd/go","description":"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.","status":"published","published":"2026-11-11T03:13:17.601Z","modified":"2026-11-11T03:13:17.601Z","updated_at":"2026-11-11T04:22:54.647883Z"}],"euvd":[{"id":"EUVD-2026-123112","description":"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.","status":"published","published":"2026-11-11T03:13:17Z","modified":"2026-11-11T03:13:17Z","updated_at":"2026-11-11T08:27:52.334831Z"}],"ghsa":[{"id":"GHSA-428h-9j26-5fcf","title":"Building a malicious package that uses cgo could cause arbitrary code execution at build time...","description":"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.","status":"published","published":"2026-11-11T06:32:38Z","modified":"2026-11-11T06:32:47Z","updated_at":"2026-11-11T07:02:43.25695Z"}],"nvd":[{"id":"CVE-2026-97033","description":"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.","status":"published","published":"2026-11-11T05:19:57.253Z","modified":"2026-11-11T05:19:57.253Z","updated_at":"2026-11-11T07:23:51.781546Z"}],"osv":[{"id":"DEBIAN-CVE-2026-97033","description":"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.","status":"published","published":"2026-11-11T05:19:57.253Z","modified":"2026-11-11T07:47:31.010364952Z","updated_at":"2026-11-11T08:27:16.400656Z"},{"id":"GO-2026-6858","title":"Unexpected code execution via --sysroot, -target, -isysroot, -Wl,-syslibroot, and -x cgo flags in cmd/go","description":"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.\n\nSpecifically, \"--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.\n\n\"--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.","status":"published","published":"2026-11-11T02:51:11Z","modified":"2026-11-11T03:15:14.803158957Z","updated_at":"2026-11-11T03:52:51.074362Z"},{"id":"openSUSE-SU-2026:12529-1","title":"go1.26-1.26.11-1.1 on GA media","description":"These are all security issues fixed in the go1.26-1.26.11-1.1 package on the GA media of openSUSE Tumbleweed.","status":"published","published":"2026-11-11T00:00:00Z","modified":"2026-11-12T17:23:23.015967912Z","updated_at":"2026-11-12T18:02:05.26944Z"}]}}
