CVE-2023-29405

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

State
Published
Severity
9.8 Critical
Published
Jun 8, 2023
Updated
Jan 6, 2025
Reserved
Apr 5, 2023

Read the record on cve.org

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.

Scores

CVSSScoreVectorSource
3.19.8 CriticalCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:HCISA-ADP

Weaknesses

The record names no weakness.

Affected Products

ProductVersions
cmd/goGo toolchain
  • before 1.19.10Affected
  • 1.20.0-0 to before 1.20.5Affected
cmd/cgoGo toolchain
  • before 1.19.10Affected
  • 1.20.0-0 to before 1.20.5Affected

References

Every record here comes from the CVE Program’s CVE List. © 1999–2026 The MITRE Corporation. CVE is a registered trademark of The MITRE Corporation. The records are reproduced under the CVE Program terms of use.