CVE-2023-29404

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

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

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-32975 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.
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 epss

{'score': 0.00083}

epss

{'score': 0.00085}

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:47 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