Red Hat VEX
RHVEX-CVE-2023-39323
golang: cmd/go: line directives allows arbitrary execution during build
Details
A flaw was found in the golang cmd/go standard library. A line directive ("//line") can be used to bypass the restrictions on "//go:cgo_" directives, allowing blocked linker and compiler flags to pass during compilation. This can result in the 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.
Affected packages
| Ecosystem | Package | Affected versions |
|---|---|---|
| Red Hat:enterprise_linux:9 | go-toolset | All versions, no fix yet |
| Red Hat:enterprise_linux:9 | golang | All versions, no fix yet |
| Red Hat:enterprise_linux:9 | golang-bin | All versions, no fix yet |
| Red Hat:enterprise_linux:9 | golang-docs | All versions, no fix yet |
| Red Hat:enterprise_linux:9 | golang-misc | All versions, no fix yet |
| Red Hat:enterprise_linux:9 | golang-race | All versions, no fix yet |
| Red Hat:enterprise_linux:9 | golang-src | All versions, no fix yet |
| Red Hat:enterprise_linux:9 | golang-tests | All versions, no fix yet |
References
- https://access.redhat.com/security/cve/CVE-2023-39323
- https://bugzilla.redhat.com/show_bug.cgi?id=2242544
- https://www.cve.org/CVERecord?id=CVE-2023-39323
- https://nvd.nist.gov/vuln/detail/CVE-2023-39323
- https://go.dev/cl/533215
- https://go.dev/issue/63211
- https://groups.google.com/g/golang-announce/c/XBa1oHDevAo
- https://vuln.go.dev/ID/GO-2023-2095.json