{"id":"CVE-2023-29404","published":"2023-06-08T20:19:17Z","modified":"2025-01-06T19:47:57Z","title":"Improper handling of non-optional LDFLAGS 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. The arguments for a number of flags which are non-optional are incorrectly considered optional, allowing disallowed flags to be smuggled through the LDFLAGS sanitization. This affects usage of both the gc and gccgo compilers.","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.01822,"percentile":0.79291,"provenance":"source"},"cwes":[],"references":[{"url":"https://go.dev/issue/60305","tags":[]},{"url":"https://go.dev/cl/501225","tags":[]},{"url":"https://groups.google.com/g/golang-announce/c/q5135a9d924/m/j0ZoAJOHAwAJ","tags":[]},{"url":"https://pkg.go.dev/vuln/GO-2023-1841","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-20241115-0009/","tags":[]}],"priority":{"score":22.7,"factors":[{"name":"EPSS percentile","points":15.86},{"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"]}],"ssvc":{"exploitation":"none","automatable":"yes","technicalImpact":"total","timestamp":"2025-01-06T19:47:37.186942Z","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-1841"],"provenance":"source"}],"summary":{"text":"The flaw is in the cmd/go component of the Go toolchain, where non-optional LDFLAGS arguments are incorrectly treated as optional, so disallowed linker flags can bypass the LDFLAGS sanitization applied to \"#cgo LDFLAGS\" directives, affecting both the gc and gccgo compilers. An attacker who can supply a malicious module or otherwise get untrusted code built (for example via \"go get\" or any other build command) over the network, with no authentication and no further user interaction, can cause arbitrary code to execute at build time when cgo is in use.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T06:40:17Z"},"euvd":{"id":"EUVD-2023-32975","exploited":false,"provenance":"source"},"lineage":{"packageHistory":[{"cve":"CVE-2021-38297","published":"2021-10-18","fixed":"1.17.2","kev":false},{"cve":"CVE-2022-23773","published":"2022-02-11","fixed":"1.17.7","kev":false,"link":{"from":"CVE-2022-23773","to":"CVE-2023-29404","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}],"package":"Go:toolchain"}}