Go Compiler Line Directive Exploit Bypasses cgo Restrictions
CVE-2023-39323 Published on October 5, 2023
Arbitrary code execution during build via line directives in cmd/go
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.
Vulnerability Analysis
CVE-2023-39323 can be exploited with network access, and does not require authorization privileges or user interaction. This vulnerability is consided to have a high level of attack complexity. The potential impact of an exploit of this vulnerability is considered to be very high.
Products Associated with CVE-2023-39323
You can be notified by email with stack.watch whenever vulnerabilities like CVE-2023-39323 are published in these products:
Affected Versions
Go toolchain cmd/go:- Before 1.20.9 is affected.
- Version 1.21.0-0 and below 1.21.2 is affected.
Exploit Probability
EPSS (Exploit Prediction Scoring System) scores estimate the probability that a vulnerability will be exploited in the wild within the next 30 days. The percentile shows you how this score compares to all other vulnerabilities.