CVE-2023-39323

Arbitrary code execution during build via line directives in cmd/go

Published Oct 5, 2023 CVSS 3.1 · 8.1 High EPSS 1.9% KEV · Not listed
Description
Line directives ("//line") can be used to bypass the restrictions on "//go:cgo_" directives, allowing blocked linker and compiler flags to be passed during compilation. This can result in unexpected execution of arbitrary code when running "go build". The line directive requires the absolute path of the file in which the directive lives, which makes exploiting this issue significantly more complex.

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-43055 Line directives ("//line") can be used to bypass the restrictions on "//go:cgo_" directives, allowing blocked linker and compiler flags to be passed during compilation. This can result in unexpected execution of arbitrary code when running "go build". The line directive requires the absolute path of the file in which the directive lives, which makes exploiting this issue significantly more complex.
Ubuntu USN Ubuntu USN USN-6574-1 Go vulnerabilities
Ubuntu USN Ubuntu USN USN-7109-1 Go vulnerabilities
Ubuntu USN Ubuntu USN USN-7111-1 Go vulnerabilities
History
Type Values Removed Values Added
Metrics ssvc

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

Type Values Removed Values Added
First Time appeared Redhat
Redhat enterprise Linux
CPEs cpe:/a:redhat:enterprise_linux:8
Vendors & Products Redhat
Redhat enterprise Linux
Weaknesses

Sources

Status
PUBLISHED
Assigner
Go
Published
Updated
Jun 12, 2025, 3:15 PM
Reserved
Jul 27, 2023, 5:05 PM
Status
Modified
Published
Oct 5, 2023, 9:15 PM
Modified
Jun 17, 2026, 6:12 AM
Severity
Moderate
Public date
Oct 5, 2023, 12:00 AM