Arbitrary code execution via line directive bypass
Published Oct 5, 2023 · Updated Jun 12, 2025
Code injection in Google Cloud Go command before 1.20.9 and 1.21.0 through 1.21.1 allows attackers to execute code during go build via crafted source. The cmd/go parser accepts crafted //line directives that alter the apparent source path, bypassing checks that reject blocked //go:cgo_ compiler and linker flags. Exploitation requires attacker-controlled source containing the absolute path of its directive file and a build invocation, after which injected flags execute arbitrary code with the builder's privileges.
Summary
What happened
Code injection in Google Cloud Go command before 1.20.9 and 1.21.0 through 1.21.1 allows attackers to execute code during go build via crafted source. The cmd/go parser accepts crafted //line directives that alter the apparent source path, bypassing checks that reject blocked //go:cgo_ compiler and linker flags. Exploitation requires attacker-controlled source containing the absolute path of its directive file and a build invocation, after which injected flags execute arbitrary code with the builder's privileges.
The record
- CVE
- CVE-2023-39323
- Published
- Oct 5, 2023
- Updated
- Jun 12, 2025
- Vendor
- Google Cloud
- Product
- Go command
- Classifications
- CWE-94, T1204.002
- Attack vector
- network
- Privileges
- unauthenticated
Timeline
How it unfolded
- Oct 5, 2023CVE publishedPublication date reported by the CVE source.
- Jun 12, 2025Record updatedLatest update available in the CVE record.
Exploitability
Present is not the same as exploitable
Compare your product and version with the public record. A matching version still requires validation against your environment.
Is a vulnerable build present?
Compare these published version ranges with your installed build and any vendor patches.
- Affected versionversion=0 <1.20.9
- Affected versionversion=1.21.0-0 <1.21.2
What conditions does exploitation require?
What is affected?
Published CVSS scores
CVSS describes severity. EPSS estimates exploitation probability.
Attacks
What attackers are doing with it
Daily unique IPs observed by Shadowserver honeypots for known exploited vulnerabilities (KEVs). Missing observations do not establish an absence of attacks.
Weakness, pattern, technique
Public exploit references
No public exploit references are available in this record.
Labels summarize the accepted research assessment. They do not indicate a test against your environment.
Technologies
Your stack
See the directory against your own environment.
Your stack
Check the software in your environment
Book a demo to see how Hinoki identifies affected software and validates exploitability in your environment.
Book a demo