CVE-2023-29405

published 8 Jun 2023 · updated 9 Sep 2026

Improper sanitization of LDFLAGS with embedded spaces in go command with cgo in cmd/go

9.8CriticalCVSS 9.8EPSS 2%

No exploitation in the wild has been reported. EPSS puts the chance of exploitation in the next 30 days at 2%. Fixed in 1.19.10 and 1.20.5.

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. Flags containing embedded spaces are mishandled, allowing disallowed flags to be smuggled through the LDFLAGS sanitization by including them in the argument of another flag. This only affects usage of the gccgo compiler.

Affected

Vendors, products and packages with version ranges

VendorProductVersionsFixed
Go toolchain<1.19.10, >=1.20.0-0 <1.20.51.19.10, 1.20.5

Timeline

Every event on this vulnerability

Embed

A live severity badge for an advisory, README or ticket

CVE-2023-29405 severity on Zeptric[![CVE-2023-29405](https://zeptric.io/badge/cve/CVE-2023-29405.svg)](https://zeptric.io/cve/CVE-2023-29405)