CVE-2023-29405
9.8critical
Improper sanitization of LDFLAGS with embedded spaces in go command with cgo in cmd/go
- Severity
- 9.8critical CVSS:3.1 by CISA-ADP
- Exploit likelihood
- 1.71% (higher than 78% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- Go
- Also known as
- GO-2023-1842BIT-GOLANG-2023-29405
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
| Product or package | Versions | Reported by |
|---|---|---|
| cmd/go | before 1.19.10, from 1.20.0-0 before 1.20.5 | CVE List |
| cmd/cgo | before 1.19.10, from 1.20.0-0 before 1.20.5 | CVE List |
| toolchain (Go) | before 1.19.10, from 1.20.0-0 before 1.20.5 | Go Vulnerability Database |
| golang go | before 1.19.10, from 1.20.0 before 1.20.5 | NVD |
| fedoraproject fedora | 38 | NVD |
| golang (Bitnami) | before 1.19.10, from 1.20.0 before 1.20.5 | Bitnami Vulnerability Database |
All scores
| CISA-ADP | 9.8critical CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
| NVD | 9.8critical CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
| Bitnami Vulnerability Database | critical rating |
Classification
References
| https://go.dev/issue/60306 | issue-tracking, report | |
| https://go.dev/cl/501224 | fix, patch | |
| https://groups.google.com/g/golang-announce/c/q5135a9d924/m/j0ZoAJOHAwAJ | advisory, mailing-list, third-party-advisory, web | |
| https://pkg.go.dev/vuln/GO-2023-1842 | advisory, vendor-advisory | |
| https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/XBS3IIK6ADV24C5ULQU55QLT2UE762ZX/ | discussion, mailing-list | |
| https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/NZ2O6YCO2IZMZJELQGZYR2WAUNEDLYV6/ | web | |
| https://security.gentoo.org/glsa/202311-09 | web | |
| https://security.netapp.com/advisory/ntap-20241206-0003/ | web | |
| https://nvd.nist.gov/vuln/detail/CVE-2023-29405 | web | |
Related
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2023-29405 changed 2025-01-06 | CVE Terms of Use |
| Go Vulnerability Database | GO-2023-1842 changed 2026-02-04 | CC-BY-4.0 |
| NVD | CVE-2023-29405 changed 2026-06-17 | Public domain |
| Bitnami Vulnerability Database | BIT-GOLANG-2023-29405 changed 2026-09-08 | Apache-2.0 |