Vulnerability · Published Jun 8, 2023 · Assigned by Go

CVE-2023-29402Code injection via go command with cgo in cmd/go

Critical 9.8

In plain English

A critical-severity security flaw in cmd/go from Go toolchain. There are no confirmed reports of exploitation so far. The chance it is exploited in the next 30 days is estimated at 1.7% (higher than 77% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.

Severity (CVSS 3.1)9.8Critical
Exploit odds (30 days)1.7%top 22.8% of all CVEs
Exploited in the wildNo reportsCISA SSVC: none
Attack toolingNoneno public tooling known

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

Affected packages & fixed versions

EcosystemPackageFixed inAdvisory
AlmaLinux:8delve1.9.1-1.module_el8.8.0+3471+a62632a0ALSA-2023:3922
AlmaLinux:8go-toolset1.19.10-1.module_el8.8.0+3571+89db2ae0ALSA-2023:3922
AlmaLinux:9go-toolset1.19.10-1.el9_2ALSA-2023:3923
AlmaLinux:8golang1.19.10-1.module_el8.8.0+3571+89db2ae0ALSA-2023:3922
AlmaLinux:9golang1.19.10-1.el9_2ALSA-2023:3923
AlmaLinux:8golang-bin1.19.10-1.module_el8.8.0+3571+89db2ae0ALSA-2023:3922
AlmaLinux:9golang-bin1.19.10-1.el9_2ALSA-2023:3923
AlmaLinux:8golang-docs1.19.10-1.module_el8.8.0+3571+89db2ae0ALSA-2023:3922
AlmaLinux:9golang-docs1.19.10-1.el9_2ALSA-2023:3923
AlmaLinux:8golang-misc1.19.10-1.module_el8.8.0+3571+89db2ae0ALSA-2023:3922
AlmaLinux:9golang-misc1.19.10-1.el9_2ALSA-2023:3923
AlmaLinux:8golang-race1.19.10-1.module_el8.8.0+3571+89db2ae0ALSA-2023:3922
AlmaLinux:9golang-race1.19.10-1.el9_2ALSA-2023:3923
AlmaLinux:8golang-src1.19.10-1.module_el8.8.0+3571+89db2ae0ALSA-2023:3922
AlmaLinux:9golang-src1.19.10-1.el9_2ALSA-2023:3923
AlmaLinux:8golang-tests1.19.10-1.module_el8.8.0+3571+89db2ae0ALSA-2023:3922
AlmaLinux:9golang-tests1.19.10-1.el9_2ALSA-2023:3923
Alpine:v3.20go1.20.5-r0ALPINE-CVE-2023-29402
Alpine:v3.21go1.20.5-r0ALPINE-CVE-2023-29402
Alpine:v3.22go1.20.5-r0ALPINE-CVE-2023-29402
Alpine:v3.23go1.20.5-r0ALPINE-CVE-2023-29402
Alpine:v3.24go1.20.5-r0ALPINE-CVE-2023-29402
Debian:12golang-1.19no fix listedDEBIAN-CVE-2023-29402
Gotoolchain1.19.10, 1.20.5GO-2023-1839
Rocky Linux:9go-toolset0:1.19.10-1.el9_2RLSA-2023:3923
Rocky Linux:9golang0:1.19.10-1.el9_2RLSA-2023:3923
Ubuntu:22.04:LTSgolang-1.171.17.13-3ubuntu1.2USN-7061-1
Ubuntu:22.04:LTSgolang-1.171.17.13-3ubuntu1.2UBUNTU-CVE-2023-29402
Ubuntu:22.04:LTSgolang-1.181.18.1-1ubuntu1.2USN-7109-1
Ubuntu:22.04:LTSgolang-1.181.18.1-1ubuntu1.2UBUNTU-CVE-2023-29402
Ubuntu:22.04:LTSgolang-1.20no fix listedUBUNTU-CVE-2023-29402

Affected products (as reported)

VendorProductVersions
Go toolchain cmd/go 0 – before 1.19.101.20.0-0 – before 1.20.5

References