CVE-2023-39323
Arbitrary code execution during build via line directives in cmd/go
Reported by go · Published October 5, 2023
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.
Fixed versions
Upgrade to a fixed version or later. Language registries are listed first, then Linux distributions, then vendor products.
| Package | Ecosystem | Fixed in |
|---|---|---|
| cmd/go | Go Modules | 1.21.2, 1.20.9 |
| toolchain | Go Modules | 1.21.2, 1.20.9 |
| smarter-device-manager-fips | Chainguard | 1.20.11-r2 |
| golang | Amazon Linux | 1.20.10-1.amzn2023.0.1, 1.20.10-1.amzn2.0.1 |
| golang-tests | Amazon Linux | 1.20.10-1.amzn2023.0.1, 1.20.10-1.amzn2.0.1 |
| golang-shared | Amazon Linux | 1.20.10-1.amzn2023.0.1, 1.20.10-1.amzn2.0.1 |
| go | Alpine | 1.21.2-r0, 1.20.9-r0 |
| kubeflow-katib | Wolfi | 0.19.0-r40, 0.19.0-r31 |
| golang-misc | Amazon Linux | 1.20.10-1.amzn2023.0.1, 1.20.10-1.amzn2.0.1 |
| golang-bin | Amazon Linux | 1.20.10-1.amzn2023.0.1, 1.20.10-1.amzn2.0.1 |
| kind | Wolfi | 0.21.0-r0 |
| golang-docs | Amazon Linux | 1.20.10-1.amzn2023.0.1, 1.20.10-1.amzn2.0.1 |
12 more packages have a fixed version. See every fix in Lookup.
Risk scores
Affected products
| Vendor | Product | Versions |
|---|---|---|
| Go toolchain | cmd/go | 0, 1.21.0-0 |
| chainguard | smarter-device-manager-fips | 0 |
| Go toolchain | cmd/go | 1.21.0-0, 0 |
| amazon:2 | golang | 0 |
| amazon:2023 | golang-tests | 0 |
| amazon:2 | golang-tests | 0 |
| amazon:2023 | golang | 0 |
| amazon:2023 | golang-shared | 0 |
| alpine | go | 0, 0 |
| wolfi | kubeflow-katib | 0, 0 |
| amazon:2023 | golang-misc | 0 |
| amazon:2 | golang-bin | 0 |
| wolfi | kind | 0 |
| amazon:2 | golang-docs | 0 |
| amazon:2023 | golang-docs | 0 |
| amazon:2 | golang-src | 0 |
| wolfi | falco | 0 |
| chainguard | falco | 0 |
| wolfi | metrics-server | 0 |
| amazon:2023 | golang-src | 0 |
…and 8 more
Timeline
- Sep 28, 2023 CVE Published
- Oct 6, 2023 EPSS Score (30 in total, the first dated here)
- Feb 8, 2026 Security Advisory (6 in total, the first dated here)
- Mar 26, 2026 Distribution Patch (3 in total, the first dated here)
- Aug 5, 2026 Coalition ESS Score
Query this with the API
The same record, from the CLI:
vulnetix vdb vuln CVE-2023-39323
vulnetix vdb fixes CVE-2023-39323
Or with curl, using the org id and key from your account page:
curl -s -H "Authorization: ApiKey ${VULNETIX_ORG_ID}:${VULNETIX_API_KEY}" \
"https://api.vdb.vulnetix.com/v2/vuln/CVE-2023-39323/fixes/registry"
The Community plan is free and allows 50 queries a day. Get a free API key · API quickstart