CVE-2023-29404
Improper handling of non-optional LDFLAGS in go command with cgo in cmd/go
Reported by go · Published June 8, 2023
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.
Fixed versions
Upgrade to a fixed version or later. Language registries are listed first, then Linux distributions, then vendor products.
| Package | Ecosystem | Fixed in |
|---|---|---|
| toolchain | Go Modules | 1.20.5, 1.19.10 |
| cmd/go | Go Modules | 1.20.5, 1.19.10 |
| go | Alpine | 1.20.5-r0 |
| golang-tests | Amazon Linux | 1.20.5-1.amzn2023.0.2, 1.20.5-1.amzn2.0.2 |
| falco | Chainguard | 0.37.1-r0 |
| falco | Wolfi | 0.37.1-r0 |
| golang | Amazon Linux | 1.20.5-1.amzn2023.0.2, 1.20.5-1.amzn2.0.2 |
| kind | Chainguard | 0.21.0-r0 |
| golang-shared | Amazon Linux | 1.20.5-1.amzn2023.0.2, 1.20.5-1.amzn2.0.2 |
| kind | Wolfi | 0.21.0-r0 |
| golang-misc | Amazon Linux | 1.20.5-1.amzn2023.0.2, 1.20.5-1.amzn2.0.2 |
| kubeflow-katib | Wolfi | 0.19.0-r40, 0.19.0-r31 |
9 more packages have a fixed version. See every fix in Lookup.
Risk scores
Affected products
| Vendor | Product | Versions |
|---|---|---|
| Go toolchain | cmd/go | 0, 1.20.0-0 |
| alpine | go | 0 |
| amazon:2023 | golang-tests | 0 |
| chainguard | falco | 0 |
| wolfi | falco | 0 |
| amazon:2023 | golang | 0 |
| chainguard | kind | 0 |
| amazon:2023 | golang-shared | 0 |
| wolfi | kind | 0 |
| amazon:2 | golang-misc | 0 |
| amazon:2 | golang-shared | 0 |
| amazon:2 | golang-tests | 0 |
| wolfi | kubeflow-katib | 0, 0 |
| amazon:2023 | golang-src | 0 |
| amazon:2 | golang-bin | 0 |
| chainguard | policy-controller | 0 |
| amazon:2023 | golang-docs | 0 |
| amazon:2 | golang-src | 0 |
| amazon:2023 | golang-misc | 0 |
| wolfi | policy-controller | 0 |
…and 5 more
Timeline
- Jun 6, 2023 CVE Published
- Jun 9, 2023 EPSS Score (30 in total, the first dated here)
- Feb 8, 2024 PoC Published
- Feb 17, 2026 Security Advisory (10 in total, the first dated here)
- Nov 22, 2026 Distribution Patch (6 in total, the first dated here)
Query this with the API
The same record, from the CLI:
vulnetix vdb vuln CVE-2023-29404
vulnetix vdb fixes CVE-2023-29404
Or with curl, using the org id and key from your account page:
curl -s -H "Authorization: ApiKey ${VULNETIX_ORG_ID}:${VULNETIX_API_KEY}" \
"https://api.vdb.vulnetix.com/v2/vuln/CVE-2023-29404/fixes/registry"
The Community plan is free and allows 50 queries a day. Get a free API key · API quickstart