# CVE-2023-29405: Improper sanitization of LDFLAGS with embedded spaces in go command with cgo in cmd/go

- Severity: Critical 9.8 (CVSS:3.1, scored by CISA-ADP) `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 1.71%, higher than 78% of CVEs (2026-12-01)
- Published: 2023-06-08T20:15:53.000Z
- Modified: 2026-09-08T08:47:49.098Z
- Also known as: GO-2023-1842, BIT-GOLANG-2023-29405
- Related: CGA-7fqw-2mm9-gcw3, RHSA-2023:3920, RHSA-2023:3922, RHSA-2023:3923
- Weaknesses: CWE-74, CWE-88
- SSVC (CISA-ADP): exploitation none, automatable yes, technical impact total
- Assigned by: 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. 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.

(As written by CVE List.)

## Affected

- cmd/go: before 1.19.10; from 1.20.0-0 before 1.20.5
- cmd/cgo: before 1.19.10; from 1.20.0-0 before 1.20.5
- toolchain (Go): before 1.19.10; from 1.20.0-0 before 1.20.5
- golang go: before 1.19.10; from 1.20.0 before 1.20.5
- fedoraproject fedora: 38
- golang (Bitnami): before 1.19.10; from 1.20.0 before 1.20.5

## Every score

- CISA-ADP: CVSS:3.1 9.8 Critical `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H`
- NVD: CVSS:3.1 9.8 Critical `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H`
- Bitnami Vulnerability Database: rating Critical

## References

- <https://go.dev/issue/60306> (issue-tracking, report)
- <https://go.dev/cl/501224> (fix, patch)
- <https://groups.google.com/g/golang-announce/c/q5135a9d924/m/j0ZoAJOHAwAJ> (advisory, mailing-list, third-party-advisory, web)
- <https://pkg.go.dev/vuln/GO-2023-1842> (advisory, vendor-advisory)
- <https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/XBS3IIK6ADV24C5ULQU55QLT2UE762ZX/> (discussion, mailing-list)
- <https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/NZ2O6YCO2IZMZJELQGZYR2WAUNEDLYV6/> (web)
- <https://security.gentoo.org/glsa/202311-09> (web)
- <https://security.netapp.com/advisory/ntap-20241206-0003/> (web)
- <https://nvd.nist.gov/vuln/detail/CVE-2023-29405> (web)

## Sources

- CVE List: [CVE-2023-29405](https://www.cve.org/CVERecord?id=CVE-2023-29405), CVE Terms of Use, modified 2025-01-06
- Go Vulnerability Database: [GO-2023-1842](https://pkg.go.dev/vuln/GO-2023-1842), CC-BY-4.0, modified 2026-02-04
- NVD: [CVE-2023-29405](https://nvd.nist.gov/vuln/detail/CVE-2023-29405), Public domain, modified 2026-06-17
- Bitnami Vulnerability Database: [BIT-GOLANG-2023-29405](https://osv.dev/vulnerability/BIT-GOLANG-2023-29405), Apache-2.0, modified 2026-09-08

---

Page: https://cve.day/CVE-2023-29405 · Whole record: https://cve.day/CVE-2023-29405.json · Rebuilt by cve.day 2026-11-25T22:58:24.689Z
