CVE-2023-29405
JSON

9.8critical

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

Severity
9.8critical CVSS:3.1 by CISA-ADP
Exploit likelihood
1.71% (higher than 78% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
Go
Also known as
GO-2023-1842BIT-GOLANG-2023-29405

Description

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

Product or packageVersionsReported by
cmd/gobefore 1.19.10, from 1.20.0-0 before 1.20.5CVE List
cmd/cgobefore 1.19.10, from 1.20.0-0 before 1.20.5CVE List
toolchain (Go)before 1.19.10, from 1.20.0-0 before 1.20.5Go Vulnerability Database
golang gobefore 1.19.10, from 1.20.0 before 1.20.5NVD
fedoraproject fedora38NVD
golang (Bitnami)before 1.19.10, from 1.20.0 before 1.20.5Bitnami Vulnerability Database

All scores

CISA-ADP9.8critical CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
NVD9.8critical CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Bitnami Vulnerability Databasecritical rating

Classification

CWE-74CWE-88

SSVC (CISA-ADP): exploitation none, automatable yes, technical impact total.

References

Related

Sources

SourceRecordLicence
CVE ListCVE-2023-29405 changed 2025-01-06CVE Terms of Use
Go Vulnerability DatabaseGO-2023-1842 changed 2026-02-04CC-BY-4.0
NVDCVE-2023-29405 changed 2026-06-17Public domain
Bitnami Vulnerability DatabaseBIT-GOLANG-2023-29405 changed 2026-09-08Apache-2.0