CVEfocus › CVE database › CVE-2023-29404

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

CVSS 9.8 CriticalEPSS 2.1% (higher than 82% of CVEs)Published 2023-06-08Updated 2025-01-06Assigner: Go

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.

What to do

Fixed builds are available from AlmaLinux, Alpine, Go, Red Hat, Rocky Linux, Ubuntu: see the table below for the fixed version per release.

Debian, Ubuntu have not shipped a fix for every release yet.

Is your server affected? One read-only command checks every installed package against this CVE and all others, using each vendor's fixed versions. Get started or get a free API key.

curl -sS "https://api.cvefocus.com/v1/check?format=text" -H "Authorization: Bearer $CVEFOCUS_KEY" \
  -H "Content-Type: text/plain" --data-binary @inventory.txt

Vendor status at a glance

47Fixed
21Fix pending

Status by vendor and release

From each vendor's own security data and VEX statements. "Fixed" means a fixed build is published for that release.

ReleasePackageStatusFixed versionAdvisory
Ubuntu 22.04golang-1.13Fix pendingUBUNTU-CVE-2023-29404
Ubuntu 22.04golang-1.17Fixed1.17.13-3ubuntu1.2UBUNTU-CVE-2023-29404
Ubuntu 22.04golang-1.18Fixed1.18.1-1ubuntu1.2UBUNTU-CVE-2023-29404
Ubuntu 22.04golang-1.20Fix pendingUBUNTU-CVE-2023-29404
Ubuntu 20.04golang-1.13Fix pendingUBUNTU-CVE-2023-29404
Ubuntu 20.04golang-1.14Fix pendingUBUNTU-CVE-2023-29404
Ubuntu 20.04golang-1.16Fix pendingUBUNTU-CVE-2023-29404
Ubuntu 20.04golang-1.18Fixed1.18.1-1ubuntu1~20.04.3UBUNTU-CVE-2023-29404
Ubuntu 20.04golang-1.20Fix pendingUBUNTU-CVE-2023-29404
Ubuntu 18.04golang-1.10Fix pendingUBUNTU-CVE-2023-29404
Ubuntu 18.04golang-1.13Fix pendingUBUNTU-CVE-2023-29404
Ubuntu 18.04golang-1.16Fix pendingUBUNTU-CVE-2023-29404
Ubuntu 18.04golang-1.18Fix pending1.18.1-1ubuntu1~18.04.4+esm1 (Ubuntu Pro)UBUNTU-CVE-2023-29404
Ubuntu 18.04golang-1.8Fix pendingUBUNTU-CVE-2023-29404
Ubuntu 18.04golang-1.9Fix pendingUBUNTU-CVE-2023-29404
Ubuntu 16.04golangFix pending
Ubuntu 16.04golang-1.10Fix pendingUBUNTU-CVE-2023-29404
Ubuntu 16.04golang-1.13Fix pendingUBUNTU-CVE-2023-29404
Ubuntu 16.04golang-1.18Fix pending1.18.1-1ubuntu1~16.04.6+esm1 (Ubuntu Pro)UBUNTU-CVE-2023-29404
Ubuntu 16.04golang-1.6Fix pendingUBUNTU-CVE-2023-29404
Ubuntu 14.04golangFix pending
Ubuntu 14.04golang-1.10Fix pendingUBUNTU-CVE-2023-29404
Ubuntu 14.04golang-1.6Fix pending
Debian 12golang-1.19Fix pendingDEBIAN-CVE-2023-29404
Red Hat Enterprise Linux 9go-toolsetFixed0:1.19.10-1.el9_2RHSA-2023:3923
Red Hat Enterprise Linux 9golangFixed0:1.19.10-1.el9_2RHSA-2023:3923
Red Hat Enterprise Linux 9golang-binFixed0:1.19.10-1.el9_2RHSA-2023:3923
Red Hat Enterprise Linux 9golang-docsFixed0:1.19.10-1.el9_2RHSA-2023:3923
Red Hat Enterprise Linux 9golang-miscFixed0:1.19.10-1.el9_2RHSA-2023:3923
Red Hat Enterprise Linux 9golang-raceFixed0:1.19.10-1.el9_2RHSA-2023:3923
Red Hat Enterprise Linux 9golang-srcFixed0:1.19.10-1.el9_2RHSA-2023:3923
Red Hat Enterprise Linux 9golang-testsFixed0:1.19.10-1.el9_2RHSA-2023:3923
Red Hat Enterprise Linux 8delveFixed0:1.9.1-1.module+el8.8.0+16778+5fbb74f5RHSA-2023:3922
Red Hat Enterprise Linux 8go-toolsetFixed0:1.19.10-1.module+el8.8.0+19203+782922b7RHSA-2023:3922
Red Hat Enterprise Linux 8golangFixed0:1.19.10-1.module+el8.8.0+19203+782922b7RHSA-2023:3922
Red Hat Enterprise Linux 8golang-binFixed0:1.19.10-1.module+el8.8.0+19203+782922b7RHSA-2023:3922
Red Hat Enterprise Linux 8golang-docsFixed0:1.19.10-1.module+el8.8.0+19203+782922b7RHSA-2023:3922
Red Hat Enterprise Linux 8golang-miscFixed0:1.19.10-1.module+el8.8.0+19203+782922b7RHSA-2023:3922
Red Hat Enterprise Linux 8golang-raceFixed0:1.19.10-1.module+el8.8.0+19203+782922b7RHSA-2023:3922
Red Hat Enterprise Linux 8golang-srcFixed0:1.19.10-1.module+el8.8.0+19203+782922b7RHSA-2023:3922
Red Hat Enterprise Linux 8golang-testsFixed0:1.19.10-1.module+el8.8.0+19203+782922b7RHSA-2023:3922
AlmaLinux 9go-toolsetFixed1.19.10-1.el9_2ALSA-2023:3923
AlmaLinux 9golangFixed1.19.10-1.el9_2ALSA-2023:3923
AlmaLinux 9golang-binFixed1.19.10-1.el9_2ALSA-2023:3923
AlmaLinux 9golang-docsFixed1.19.10-1.el9_2ALSA-2023:3923
AlmaLinux 9golang-miscFixed1.19.10-1.el9_2ALSA-2023:3923
AlmaLinux 9golang-raceFixed1.19.10-1.el9_2ALSA-2023:3923
AlmaLinux 9golang-srcFixed1.19.10-1.el9_2ALSA-2023:3923
AlmaLinux 9golang-testsFixed1.19.10-1.el9_2ALSA-2023:3923
AlmaLinux 8delveFixed1.9.1-1.module_el8.8.0+3471+a62632a0ALSA-2023:3922
AlmaLinux 8go-toolsetFixed1.19.10-1.module_el8.8.0+3571+89db2ae0ALSA-2023:3922
AlmaLinux 8golangFixed1.19.10-1.module_el8.8.0+3571+89db2ae0ALSA-2023:3922
AlmaLinux 8golang-binFixed1.19.10-1.module_el8.8.0+3571+89db2ae0ALSA-2023:3922
AlmaLinux 8golang-docsFixed1.19.10-1.module_el8.8.0+3571+89db2ae0ALSA-2023:3922
AlmaLinux 8golang-miscFixed1.19.10-1.module_el8.8.0+3571+89db2ae0ALSA-2023:3922
AlmaLinux 8golang-raceFixed1.19.10-1.module_el8.8.0+3571+89db2ae0ALSA-2023:3922
AlmaLinux 8golang-srcFixed1.19.10-1.module_el8.8.0+3571+89db2ae0ALSA-2023:3922
AlmaLinux 8golang-testsFixed1.19.10-1.module_el8.8.0+3571+89db2ae0ALSA-2023:3922
Rocky Linux 9go-toolsetFixed0:1.19.10-1.el9_2RLSA-2023:3923
Rocky Linux 9golangFixed0:1.19.10-1.el9_2RLSA-2023:3923
Alpine Linux 3.24goFixed1.20.5-r0ALPINE-CVE-2023-29404
Alpine Linux 3.23goFixed1.20.5-r0ALPINE-CVE-2023-29404
Alpine Linux 3.22goFixed1.20.5-r0ALPINE-CVE-2023-29404
Alpine Linux 3.21goFixed1.20.5-r0ALPINE-CVE-2023-29404
Alpine Linux 3.20goFixed1.20.5-r0ALPINE-CVE-2023-29404
Alpine Linux 3.19goFixed1.20.5-r0ALPINE-CVE-2023-29404
Alpine Linux 3.18goFixed1.20.5-r0ALPINE-CVE-2023-29404
Go librarytoolchainFixed1.19.10GO-2023-1841

What the vendor says

As published in the CVE record by Go, the CVE's assigner (usually the vendor). Check the vendor's advisory before acting.

References

About this page

Compiled by CVEfocus from the CVE List, the security data and VEX statements of Ubuntu, Debian, Red Hat, AlmaLinux, Rocky Linux and Microsoft, CISA's Known Exploited Vulnerabilities catalog and FIRST EPSS, refreshed several times a day (data status). Information only; see the disclaimer. Official record: cve.org · NVD.