CVE-2023-29402: Code injection in Go cgo through package directories containing newlines
- Vendors
- Fedora ProjectGolang
CVE-2023-29402 is a code-injection vulnerability in Go's cmd/go and cmd/cgo build tooling. When building untrusted code that uses cgo, package directory names containing newline characters can cause the Go command to generate unexpected code. The resulting program may execute attacker-influenced code or exhibit unexpected behavior when run. Modules retrieved through the Go command in module-aware mode, including through go get, are not affected by this attack vector; packages retrieved in GOPATH mode may be affected.
Impact, mitigation & remediation
What it means and what to do now: patch path, interim mitigations, and the assume-compromise checklist.
Impact
What an attacker gets, and what they’ve been doing with it.
Successful exploitation compromises the integrity of generated code and resulting executables. Running an affected executable can execute injected code with the privileges of the executing process, potentially compromising accessible data and resources. The vulnerability does not establish an independently reachable network attack surface; exposure depends on processing attacker-controlled package directories with the affected build tooling.
Mitigation
If you can’t patch tonight, do this now.
Avoid building or running untrusted cgo packages, and reject package directory names containing newline characters before building. Use module-aware dependency retrieval through the Go command rather than GOPATH mode. Where application dependencies permit, disabling cgo avoids the affected code-generation path.
Remediation
Patch, then assume compromise.
Update the Go toolchain to a release or vendor-maintained package containing the CVE-2023-29402 fix, then rebuild affected cgo applications from trusted source using the corrected toolchain. For TuxCare EL7 installations, the identified fixed package version is 1.9.4-1.el7.tuxcare.els1; update all applicable installed golang components. Products bundling Go should receive their vendor-provided security updates.
Exploits
No public exploits tracked yet. Mallory keeps watching.
Affected products & vendors
Products and vendors Mallory has correlated with this vulnerability. Open in Mallory to drill down to specific CPE configurations and version ranges.
References
Frequently asked questions
- Is CVE-2023-29402 exploited in the wild?
- As of Nov 24, 2026, Mallory has no reports of CVE-2023-29402 being exploited in the wild. It is not listed in CISA KEV.
- Is there a public exploit for CVE-2023-29402?
- As of Nov 24, 2026, Mallory has found no public exploit for CVE-2023-29402.
- Is there a patch for CVE-2023-29402?
- Update the Go toolchain to a release or vendor-maintained package containing the CVE-2023-29402 fix, then rebuild affected cgo applications from trusted source using the corrected toolchain. For TuxCare EL7 installations, the identified fixed package version is 1.9.4-1.el7.tuxcare.els1; update all applicable installed golang components.
- What products are affected by CVE-2023-29402?
- Golang Go and Fedora Project Fedora.
- How severe is CVE-2023-29402?
- CVE-2023-29402 has a CVSS v3.1 score of 9.8 (Critical) and an EPSS score of 1.8% (79th percentile) as of Nov 24, 2026.
Recent activity
8 sources tracked across advisories, community write-ups, and news. New activity surfaces here as Mallory finds it.