# CVE-2023-29404: Improper handling of non-optional LDFLAGS in go command with cgo in cmd/go

- Severity: Critical 9.8 (CVSS:3.1, scored by CISA-ADP) `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 1.82%, higher than 79% of CVEs (2026-12-01)
- Published: 2023-06-08T20:15:47.000Z
- Modified: 2026-09-08T08:47:48.431Z
- Also known as: GO-2023-1841, BIT-GOLANG-2023-29404
- Related: CGA-m8p4-8m29-gph3, RHSA-2023:3920, RHSA-2023:3922, RHSA-2023:3923
- Weaknesses: CWE-94
- SSVC (CISA-ADP): exploitation none, automatable yes, technical impact total
- Assigned by: Go

## 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.

(As written by CVE List.)

## Affected

- cmd/go: before 1.19.10; from 1.20.0-0 before 1.20.5
- toolchain (Go): before 1.19.10; from 1.20.0-0 before 1.20.5
- golang go: before 1.19.10; from 1.20.0 before 1.20.5
- fedoraproject fedora: 38
- golang (Bitnami): before 1.19.10; from 1.20.0 before 1.20.5

## Every score

- CISA-ADP: CVSS:3.1 9.8 Critical `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H`
- NVD: CVSS:3.1 9.8 Critical `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H`
- Bitnami Vulnerability Database: rating Critical

## References

- <https://go.dev/issue/60305> (issue-tracking, report)
- <https://go.dev/cl/501225> (fix, patch)
- <https://groups.google.com/g/golang-announce/c/q5135a9d924/m/j0ZoAJOHAwAJ> (discussion, mailing-list, release-notes, web)
- <https://pkg.go.dev/vuln/GO-2023-1841> (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-20241115-0009/> (web)
- <https://nvd.nist.gov/vuln/detail/CVE-2023-29404> (web)

## Sources

- CVE List: [CVE-2023-29404](https://www.cve.org/CVERecord?id=CVE-2023-29404), CVE Terms of Use, modified 2025-01-06
- Go Vulnerability Database: [GO-2023-1841](https://pkg.go.dev/vuln/GO-2023-1841), CC-BY-4.0, modified 2026-02-04
- NVD: [CVE-2023-29404](https://nvd.nist.gov/vuln/detail/CVE-2023-29404), Public domain, modified 2026-06-17
- Bitnami Vulnerability Database: [BIT-GOLANG-2023-29404](https://osv.dev/vulnerability/BIT-GOLANG-2023-29404), Apache-2.0, modified 2026-09-08

---

Page: https://cve.day/CVE-2023-29404 · Whole record: https://cve.day/CVE-2023-29404.json · Rebuilt by cve.day 2026-11-25T22:58:24.689Z
