{"id":"CVE-2023-29405","published":"2023-06-08T20:19:19Z","modified":"2025-01-06T19:44:24Z","title":"Improper sanitization of LDFLAGS with embedded spaces in go command with cgo in cmd/go","vendor":"Go toolchain","product":"cmd/go","tier":"tail","description":{"text":"The go command may execute arbitrary code at build time when using cgo. This may occur when running \"go get\" on a malicious module, or when running any other command which builds untrusted code. This is can by triggered by linker flags, specified via a \"#cgo LDFLAGS\" directive. Flags containing embedded spaces are mishandled, allowing disallowed flags to be smuggled through the LDFLAGS sanitization by including them in the argument of another flag. This only affects usage of the gccgo compiler.","provenance":"source","from":"CVE.org"},"cvss":{"score":9.8,"severity":"CRITICAL","version":"3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","provenance":"source","from":"CISA ADP Vulnrichment"},"epss":{"score":0.01714,"percentile":0.77963,"provenance":"source"},"cwes":[],"references":[{"url":"https://go.dev/issue/60306","tags":[]},{"url":"https://go.dev/cl/501224","tags":[]},{"url":"https://groups.google.com/g/golang-announce/c/q5135a9d924/m/j0ZoAJOHAwAJ","tags":[]},{"url":"https://pkg.go.dev/vuln/GO-2023-1842","tags":[]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/XBS3IIK6ADV24C5ULQU55QLT2UE762ZX/","tags":[]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/NZ2O6YCO2IZMZJELQGZYR2WAUNEDLYV6/","tags":[]},{"url":"https://security.gentoo.org/glsa/202311-09","tags":[]},{"url":"https://security.netapp.com/advisory/ntap-20241206-0003/","tags":[]}],"priority":{"score":22.5,"factors":[{"name":"EPSS percentile","points":15.59},{"name":"CVSS severity","points":6.86}]},"vendorSlug":"go-toolchain","affectedVersions":[{"vendor":"Go toolchain","product":"cmd/go","versions":["< 1.19.10",">= 1.20.0-0, < 1.20.5"]},{"vendor":"Go toolchain","product":"cmd/cgo","versions":["< 1.19.10",">= 1.20.0-0, < 1.20.5"]}],"ssvc":{"exploitation":"none","automatable":"yes","technicalImpact":"total","timestamp":"2025-01-06T19:44:14.217992Z","from":"CISA ADP","provenance":"source"},"affected":[{"ecosystem":"Go","package":"toolchain","vulnerableRanges":["<1.19.10",">=1.20.0-0, <1.20.5"],"patched":["1.19.10","1.20.5"],"from":["GO-2023-1842"],"provenance":"source"}],"summary":{"text":"The flaw is in the cgo handling of the cmd/go component of the Go toolchain: LDFLAGS values containing embedded spaces are mishandled, so disallowed linker flags can be smuggled past the sanitization check by nesting them inside the argument of another flag. An attacker who can get the go command to build untrusted code, such as through \"go get\" on a malicious module or any other build of attacker-supplied code that uses a \"#cgo LDFLAGS\" directive, can cause arbitrary code to run at build time, and this affects only builds using the gccgo compiler.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T06:40:42Z"},"euvd":{"id":"EUVD-2023-32976","exploited":false,"provenance":"source"},"lineage":{"packageHistory":[{"cve":"CVE-2022-23773","published":"2022-02-11","fixed":"1.17.7","kev":false,"link":{"from":"CVE-2022-23773","to":"CVE-2023-29405","relation":"successor","confidence":"low","kind":"sequence","evidence":[{"kind":"version-step","provenance":"source","package":"Go:toolchain","fromFixed":"1.17.7","toFixed":"1.19.10","daysApart":482}]}},{"cve":"CVE-2023-29402","published":"2023-06-08","fixed":"1.20.5","kev":false},{"cve":"CVE-2023-29404","published":"2023-06-08","fixed":"1.20.5","kev":false},{"cve":"CVE-2023-29405","published":"2023-06-08","fixed":"1.20.5","kev":false},{"cve":"CVE-2023-24531","published":"2024-07-02","fixed":"1.21.0-0","kev":false},{"cve":"CVE-2023-39320","published":"2023-09-08","fixed":"1.21.1","kev":false},{"cve":"CVE-2023-39323","published":"2023-10-05","fixed":"1.21.2","kev":false}],"package":"Go:toolchain"}}