{"id":"GO-2023-1841","revision":"ac40ba52959849329477b37710935631","records":[{"revision":"ac40ba52959849329477b37710935631","observedAt":"2026-10-24T13:19:41.952+00:00","statement":{"source":"osv","id":"GO-2023-1841","aliases":["BIT-golang-2023-29404","CVE-2023-29404"],"title":"Improper handling of non-optional LDFLAGS in go command with cgo in cmd/go","description":"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.\n\nThe 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.","state":0,"publishedAt":"2023-06-08T20:15:47+00:00","modifiedAt":"2026-02-04T03:02:08.358489+00:00","affected":[{"ecosystem":"Go","name":"toolchain","ranges":[{"type":"SEMVER","events":[{"kind":"introduced","version":"0"},{"kind":"fixed","version":"1.19.10"},{"kind":"introduced","version":"1.20.0-0"},{"kind":"fixed","version":"1.20.5"}]}],"versions":[],"rawVersionEvidence":null}],"metrics":[],"references":["https://go.dev/issue/60305","https://go.dev/cl/501225","https://groups.google.com/g/golang-announce/c/q5135a9d924/m/j0ZoAJOHAwAJ"],"sourceUrl":"https://osv.dev/vulnerability/GO-2023-1841","license":"OSV · upstream source license applies","key":"osv:GO-2023-1841","identifiers":["GO-2023-1841","BIT-golang-2023-29404","CVE-2023-29404"]},"retained":false,"historicalAffected":[]}],"coverage":[]}