CVE-2023-29404
CRITICAL9.8EPSS 0.08%Improper handling of non-optional LDFLAGS 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. 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.
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-29404
- PATCHhttps://go.dev/cl/501225
- REPORThttps://go.dev/issue/60305
- 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-29404
- WEBhttps://pkg.go.dev/vuln/GO-2023-1841
- WEBhttps://security.gentoo.org/glsa/202311-09
- WEBhttps://security.netapp.com/advisory/ntap-20241115-0009/