{"id":"CVE-2023-29404","aliases":["CVE-2023-29404","GO-2023-1841","BIT-GOLANG-2023-29404"],"related":["CGA-m8p4-8m29-gph3","RHSA-2023:3920","RHSA-2023:3922","RHSA-2023:3923"],"kind":"vulnerability","state":"published","title":"Improper handling of non-optional LDFLAGS in go command with cgo in cmd/go","summary":"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.","summarySource":"cvelist","descriptions":[{"lang":"en","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.","source":"cvelist"}],"published":"2023-06-08T20:15:47.000Z","modified":"2026-09-08T08:47:48.431Z","severity":{"scorer":"CISA-ADP","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":9.8,"rating":"CRITICAL"},"severities":[{"scorer":"CISA-ADP","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":9.8,"rating":"CRITICAL"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":9.8,"rating":"CRITICAL"},{"scorer":"Bitnami Vulnerability Database","scheme":"rating","rating":"CRITICAL"}],"cwes":["CWE-94"],"affected":[{"ranges":[{"type":"semver","introduced":"0","fixed":"1.19.10","status":"affected"},{"type":"semver","introduced":"1.20.0-0","fixed":"1.20.5","status":"affected"}],"vendor":"Go toolchain","product":"cmd/go","package":"cmd/go","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"1.19.10"},{"type":"semver","introduced":"1.20.0-0","status":"affected","fixed":"1.20.5"}],"ecosystem":"Go","package":"toolchain","purl":"pkg:golang/toolchain","source":"go"},{"ranges":[{"status":"affected","fixed":"1.19.10"},{"status":"affected","introduced":"1.20.0","fixed":"1.20.5"}],"vendor":"golang","product":"go","cpe":"cpe:2.3:a:golang:go:*:*:*:*:*:*:*:*","source":"nvd"},{"ranges":[{"status":"affected","version":"38"}],"vendor":"fedoraproject","product":"fedora","cpe":"cpe:2.3:o:fedoraproject:fedora:38:*:*:*:*:*:*:*","source":"nvd"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"1.19.10"},{"type":"semver","introduced":"1.20.0","status":"affected","fixed":"1.20.5"}],"ecosystem":"Bitnami","package":"golang","purl":"pkg:bitnami/golang","source":"bitnami"}],"references":[{"url":"https://go.dev/issue/60305","tags":["issue-tracking","report","x-transferred"],"sources":["cvelist","go","nvd","bitnami"]},{"url":"https://go.dev/cl/501225","tags":["fix","patch","x-transferred"],"sources":["cvelist","go","nvd","bitnami"]},{"url":"https://groups.google.com/g/golang-announce/c/q5135a9d924/m/j0ZoAJOHAwAJ","tags":["discussion","mailing-list","release-notes","web","x-transferred"],"sources":["cvelist","go","nvd","bitnami"]},{"url":"https://pkg.go.dev/vuln/GO-2023-1841","tags":["advisory","vendor-advisory","x-transferred"],"sources":["cvelist","nvd","bitnami"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/XBS3IIK6ADV24C5ULQU55QLT2UE762ZX/","tags":["discussion","mailing-list","x-transferred"],"sources":["cvelist","nvd","bitnami"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/NZ2O6YCO2IZMZJELQGZYR2WAUNEDLYV6/","tags":["web","x-transferred"],"sources":["cvelist","nvd","bitnami"]},{"url":"https://security.gentoo.org/glsa/202311-09","tags":["web","x-transferred"],"sources":["cvelist","nvd","bitnami"]},{"url":"https://security.netapp.com/advisory/ntap-20241115-0009/","tags":["web"],"sources":["cvelist","nvd","bitnami"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2023-29404","tags":["web"],"sources":["bitnami"]}],"credits":["Juho Nurminen of Mattermost"],"assigner":"Go","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"yes","technicalImpact":"total","date":"2025-01-06T19:47:37.186Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2023-29404","url":"https://www.cve.org/CVERecord?id=CVE-2023-29404","licence":"CVE Terms of Use","modified":"2025-01-06T19:47:57.434Z"},{"source":"go","name":"Go Vulnerability Database","id":"GO-2023-1841","url":"https://pkg.go.dev/vuln/GO-2023-1841","licence":"CC-BY-4.0","modified":"2026-02-04T03:02:08.358Z"},{"source":"nvd","name":"NVD","id":"CVE-2023-29404","url":"https://nvd.nist.gov/vuln/detail/CVE-2023-29404","licence":"Public domain","modified":"2026-06-17T05:49:58.593Z"},{"source":"bitnami","name":"Bitnami Vulnerability Database","id":"BIT-GOLANG-2023-29404","url":"https://osv.dev/vulnerability/BIT-GOLANG-2023-29404","licence":"Apache-2.0","modified":"2026-09-08T08:47:48.431Z"}],"updatedAt":"2026-11-25T22:58:24.689Z","epss":{"score":0.01822,"percentile":0.79389,"date":"2026-12-01T12:00:22.000Z"}}