CVE-2023-29405
Improper sanitization of LDFLAGS with embedded spaces in go command with cgo in cmd/go
CRITICAL 9.8
At a glance
- Source
- NVD
- EPSS
- EPSS 1.71 % · percentile 77 ()
- State
- PUBLISHED
- Published
- Updated
- Assigner
- Go
- NVD status
- 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.
Weaknesses (CWE)
- CWE-74 — Improper Neutralization of Special Elements (Injection)
References
- https://go.dev/issue/60306
- https://go.dev/cl/501224
- https://groups.google.com/g/golang-announce/c/q5135a9d924/m/j0ZoAJOHAwAJ
- https://pkg.go.dev/vuln/GO-2023-1842
- 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/
Scores
| Version | Score | Vector | Scored by |
|---|---|---|---|
| CVSS 3.1 | CRITICAL 9.8 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H | CISA-ADP |
| CVSS 3.1 | CRITICAL 9.8 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H | NVD · nvd@nist.gov (Primary) |
| CVSS 3.1 | CRITICAL 9.8 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H | NVD · 134c704f-9b21-4f2e-91b3-4a467353bcc0 (Secondary) |
Advisories
- GO-2023-1842 — Improper sanitization of LDFLAGS with embedded spaces in go command with cgo in cmd/go
European references
- ENISA EUVD · EUVD-2023-32976
- GCVE · GCVE-0-2023-29405
CERT-FR advisories
- CERTFR-2026-AVI-0339 — Multiples vulnérabilités dans les produits VMware · cert.ssi.gouv.fr
- CERTFR-2026-AVI-0199 — Multiples vulnérabilités dans les produits VMware · cert.ssi.gouv.fr
- CERTFR-2025-AVI-0969 — Multiples vulnérabilités dans les produits VMware · cert.ssi.gouv.fr
- CERTFR-2025-AVI-0622 — Multiples vulnérabilités dans les produits VMware · cert.ssi.gouv.fr
- CERTFR-2025-AVI-0524 — Multiples vulnérabilités dans VMware Tanzu · cert.ssi.gouv.fr
- CERTFR-2025-AVI-0256 — Multiples vulnérabilités dans Broadcom VMware Tanzu Greenplum · cert.ssi.gouv.fr
- CERTFR-2024-AVI-0145 — Multiples vulnérabilités dans les produits IBM · cert.ssi.gouv.fr
- CERTFR-2024-AVI-0119 — Multiples vulnérabilités dans les produits Siemens · cert.ssi.gouv.fr
- CERTFR-2024-AVI-0074 — Multiples vulnérabilités dans les produits IBM · cert.ssi.gouv.fr
- CERTFR-2024-AVI-0061 — Multiples vulnérabilités dans les produits Splunk · cert.ssi.gouv.fr
- CERTFR-2023-AVI-0839 — Multiples vulnérabilités dans les produits IBM · cert.ssi.gouv.fr
- CERTFR-2023-AVI-0701 — Multiples vulnérabilités dans Splunk · cert.ssi.gouv.fr
- CERTFR-2023-AVI-0650 — Multiples vulnérabilités dans IBM Spectrum Copy Data Management · cert.ssi.gouv.fr
Affected configurations (NVD CPE)
cpe:2.3:a:golang:go:*:*:*:*:*:*:*:*< 1.19.10cpe:2.3:a:golang:go:*:*:*:*:*:*:*:*≥ 1.20.0 < 1.20.5cpe:2.3:o:fedoraproject:fedora:38:*:*:*:*:*:*:*
Affected products
| Product | Versions |
|---|---|
| Go toolchain · cmd/go | affected 0 < 1.19.10 ; affected 1.20.0-0 < 1.20.5 |
| Go toolchain · cmd/cgo | affected 0 < 1.19.10 ; affected 1.20.0-0 < 1.20.5 |
Sources
| Source | Licence |
|---|---|
| CVE List (CVEProject cvelistV5) | CVE Program Terms of Use |
| EPSS (FIRST.org) | FIRST — attribution requested |
| ENISA EUVD | ENISA — reproduction authorised, source acknowledged |
| CERT-FR (ANSSI) | Licence Ouverte / Etalab 2.0 |
| NVD (NIST) via fkie-cad/nvd-json-data-feeds | Public domain — this product uses data from the NVD API but is not endorsed or certified by the NVD |