CVE-2023-29402 Code injection via go command with cgo in cmd/go
Attackers can inject code during build time via cgo if untrusted modules with newline characters in directory names are used in GOPATH mode.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Over the internet
- Victim action needed
- Not needed
- Fix
- Available
What is CVE-2023-29402?
CVE-2023-29402 is a critical code injection vulnerability in Fedoraproject Fedora, published on 8 Jun 2023. An attacker can exploit it over the internet without logging in, with no action from the victim.
Official description
The go command may generate unexpected code at build time when using cgo. This may result in unexpected behavior when running a go program which uses cgo. This may occur when running an untrusted module which contains directories with newline characters in their names. Modules which are retrieved using the go command, i.e. via "go get", are not affected (modules retrieved using GOPATH-mode, i.e. GO111MODULE=off, may be affected).
Weakness: CWE-94
Which versions are affected by CVE-2023-29402?
2 open source packages ship an affected version, including golang and toolchain. It affects 2 products.
| Package | Affected | Fixed in |
|---|---|---|
golang Bitnami | All versions | 1.19.10, 1.20.5 |
toolchain Go | All versions | 1.19.10, 1.20.5 |
Products include Fedoraproject Fedora, Golang Go.
How do I fix CVE-2023-29402?
Upgrade golang to a fixed version for your release line: 1.19.10 or 1.20.5.
Upgrade, and never evaluate templates, expressions or code built from user input. More about Code injection.
Is CVE-2023-29402 being exploited?
There is no known exploitation of CVE-2023-29402 in the wild and no public exploit code.
Other vulnerabilities in Fedoraproject Fedora
Sources
Also known as AZL-27111, AZL-27122, AZL-37329, AZL-37353, AZL-47225, BIT-golang-2023-29402 and 5 more.