CVE-2023-29405
Improper sanitization of LDFLAGS with embedded spaces in go command with cgo in cmd/go
Also known as BIT-golang-2023-29405, GO-2023-1842
Mitigation
- Upgrade toolchain to one of 1.19.10, 1.20.5 (or later in the same release line).
Who should check
- Projects that depend on Go package toolchain (< 1.19.10; >= 1.20.0-0, < 1.20.5)
- Anyone running Go toolchain cmd/go < 1.19.10; >= 1.20.0-0, < 1.20.5
- Anyone running Go toolchain cmd/cgo < 1.19.10; >= 1.20.0-0, < 1.20.5
Vulnerability facts
- Affected
- toolchain < 1.19.10; >= 1.20.0-0, < 1.20.5
- Fixed in
- 1.19.10, 1.20.5
- Exploited in the wild
- Not in CISA KEV
- Public exploit / PoC
- None known
- Remote exploitation
- Remote, no login needed
- CVSS
- 9.8 (v3.1, CNA)CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:HOpen in CVSS calculator
Show all 8 CVSS metrics
- Attack vector: Network
- Attack complexity: Low
- Privileges required: None
- User interaction: None
- Scope: Unchanged
- Confidentiality impact: High
- Integrity impact: High
- Availability impact: High
- EPSS
- 2.10% chance of exploitation in 30 days (percentile 82, 2026-11-26)
- CWE
- CWE-74
- Modified
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.
Affected and fixed versions
| Package / product | Affected | Fixed | Source |
|---|---|---|---|
| Go toolchain | < 1.19.10; >= 1.20.0-0, < 1.20.5 | 1.19.10, 1.20.5 | osv |
| Go toolchain cmd/go | < 1.19.10; >= 1.20.0-0, < 1.20.5 | — | cvelist |
| Go toolchain cmd/cgo | < 1.19.10; >= 1.20.0-0, < 1.20.5 | — | cvelist |
Check your systems with an agent
Paste this into Claude Code, Cursor or another coding agent. It only reads; it changes nothing.
Check whether anything I run is affected by CVE-2023-29405. Work read-only: do not install, upgrade, delete or change anything. Details: https://flawdb.com/CVE-2023-29405.md Affected: toolchain < 1.19.10; >= 1.20.0-0, < 1.20.5 Fixed in: 1.19.10, 1.20.5 Steps: 1. Search this machine and project for toolchain (Go), Go toolchain cmd/go, Go toolchain cmd/cgo: dependency manifests and lockfiles, installed packages, container images and running services. 2. For each match, note the installed version and whether it is inside the affected range. 3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
References
Vendor advisories
Patches
Other
- https://go.dev/issue/60306
- https://groups.google.com/g/golang-announce/c/q5135a9d924/m/j0ZoAJOHAwAJ
- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/XBS3IIK6ADV24C5ULQU55QLT2UE762ZX/
- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/NZ2O6YCO2IZMZJELQGZYR2WAUNEDLYV6/
- https://security.gentoo.org/glsa/202311-09
- https://security.netapp.com/advisory/ntap-20241206-0003/
FAQ
Is CVE-2023-29405 being exploited?
There is no confirmed exploitation: CVE-2023-29405 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 2.10% chance of exploitation in the next 30 days (as of 2026-11-26).
How serious is CVE-2023-29405?
Critical: CVSS 9.8 (v3.1, scored by CNA). Remote, no login needed.
Which versions are affected by CVE-2023-29405?
toolchain < 1.19.10; >= 1.20.0-0, < 1.20.5.
Is there a fix for CVE-2023-29405?
Yes. Fixed in 1.19.10, 1.20.5. Upgrade toolchain to one of 1.19.10, 1.20.5 (or later in the same release line).
How do I check if I'm affected by CVE-2023-29405?
Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.