CVE-2023-29405
CRITICAL9.8EPSS 0.33%Improper sanitization of LDFLAGS with embedded spaces in go command with cgo in cmd/go
Published: 6/8/2023Modified: 4/28/2026
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 packages (4)
- Bitnami/golangfrom 0, < 1.19.10, >= 1.20.0, < 1.20.5
- Debian/golang-1.15from 0
- Debian/golang-1.19from 0
- Go/toolchainfrom 0, < 1.19.10, >= 1.20.0-0, < 1.20.5
CVSS scores
| Source | Version | Severity | Vector |
|---|---|---|---|
| osv | CVSS 3.1 | CRITICAL9.8 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
References (10)
- ADVISORYhttps://security-tracker.debian.org/tracker/CVE-2023-29405
- PATCHhttps://go.dev/cl/501224
- REPORThttps://go.dev/issue/60306
- WEBhttps://groups.google.com/g/golang-announce/c/q5135a9d924/m/j0ZoAJOHAwAJ
- WEBhttps://lists.fedoraproject.org/archives/list/[email protected]/message/NZ2O6YCO2IZMZJELQGZYR2WAUNEDLYV6/
- WEBhttps://lists.fedoraproject.org/archives/list/[email protected]/message/XBS3IIK6ADV24C5ULQU55QLT2UE762ZX/
- WEBhttps://nvd.nist.gov/vuln/detail/CVE-2023-29405
- WEBhttps://pkg.go.dev/vuln/GO-2023-1842
- WEBhttps://security.gentoo.org/glsa/202311-09
- WEBhttps://security.netapp.com/advisory/ntap-20241206-0003/