CVE-2023-29405

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

Published Jun 8, 2023 CVSS 3.1 · 9.8 Critical EPSS 1.7% KEV · Not listed
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.

Remediation

No solution or workaround provided in the CVE record

Tracking

Sign in to view the affected projects.

Advisories

Source ID Title
EUVD EUVD EUVD-2023-32976 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.
Ubuntu USN Ubuntu USN USN-7061-1 Go vulnerabilities
Ubuntu USN Ubuntu USN USN-7109-1 Go vulnerabilities
History
Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'yes', 'Exploitation': 'none', 'Technical Impact': 'total'}, 'version': '2.0.3'}

Weaknesses

Sources

Status
PUBLISHED
Assigner
Go
Published
Updated
Jan 6, 2025, 7:44 PM
Reserved
Apr 5, 2023, 7:36 PM
Status
Modified
Published
Jun 8, 2023, 9:15 PM
Modified
Jun 17, 2026, 5:49 AM
Severity
Important
Public date
Jun 8, 2023, 12:00 AM