CVE-2023-39323Arbitrary 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.
What to do
Fixed builds are available from Alpine, Go, Red Hat, Ubuntu: see the table below for the fixed version per release.
Debian, Red Hat, Ubuntu have not shipped a fix for every release yet.
Is your server affected? One read-only command checks every installed package against this CVE and all others, using each vendor's fixed versions. Get started or get a free API key.
curl -sS "https://api.cvefocus.com/v1/check?format=text" -H "Authorization: Bearer $CVEFOCUS_KEY" \ -H "Content-Type: text/plain" --data-binary @inventory.txt
Vendor status at a glance
Status by vendor and release
From each vendor's own security data and VEX statements. "Fixed" means a fixed build is published for that release.
| Release | Package | Status | Fixed version | Advisory |
|---|---|---|---|---|
| Ubuntu 24.04 | golang-1.21 | Not affected vulnerable_code_not_present | ||
| Ubuntu 22.04 | golang-1.17 | Fixed | 1.17.13-3ubuntu1.3 | UBUNTU-CVE-2023-39323 |
| Ubuntu 22.04 | golang-1.18 | Fixed | 1.18.1-1ubuntu1.2 | UBUNTU-CVE-2023-39323 |
| Ubuntu 22.04 | golang-1.20 | Fixed | 1.20.3-1ubuntu0.1~22.04.1 | UBUNTU-CVE-2023-39323 |
| Ubuntu 22.04 | golang-1.21 | Fixed | 1.21.1-1~ubuntu22.04.2 | UBUNTU-CVE-2023-39323 |
| Ubuntu 20.04 | golang-1.18 | Fixed | 1.18.1-1ubuntu1~20.04.3 | UBUNTU-CVE-2023-39323 |
| Ubuntu 20.04 | golang-1.20 | Fixed | 1.20.3-1ubuntu0.1~20.04.1 | UBUNTU-CVE-2023-39323 |
| Ubuntu 20.04 | golang-1.21 | Fixed | 1.21.1-1~ubuntu20.04.2 | UBUNTU-CVE-2023-39323 |
| Ubuntu 18.04 | golang-1.18 | Fix pending | 1.18.1-1ubuntu1~18.04.4+esm1 (Ubuntu Pro) | UBUNTU-CVE-2023-39323 |
| Ubuntu 16.04 | golang-1.18 | Fix pending | 1.18.1-1ubuntu1~16.04.6+esm1 (Ubuntu Pro) | UBUNTU-CVE-2023-39323 |
| Debian 12 | golang-1.19 | Fix pending | DEBIAN-CVE-2023-39323 | |
| Red Hat Enterprise Linux 9 | go-toolset | Fix pending Affected | ||
| Red Hat Enterprise Linux 9 | golang | Fix pending Affected | ||
| Red Hat Enterprise Linux 9 | golang-bin | Fix pending Affected | ||
| Red Hat Enterprise Linux 9 | golang-docs | Fix pending Affected | ||
| Red Hat Enterprise Linux 9 | golang-misc | Fix pending Affected | ||
| Red Hat Enterprise Linux 9 | golang-race | Fix pending Affected | ||
| Red Hat Enterprise Linux 9 | golang-src | Fix pending Affected | ||
| Red Hat Enterprise Linux 9 | golang-tests | Fix pending Affected | ||
| Red Hat Enterprise Linux 8 | delve | Fixed | 0:1.20.2-1.module+el8.9.0+18926+5193682d | RHBA-2023:6928 |
| Red Hat Enterprise Linux 8 | go-toolset | Fixed | 0:1.20.10-1.module+el8.9.0+20382+04f7fe80 | RHBA-2023:6928 |
| Red Hat Enterprise Linux 8 | golang | Fixed | 0:1.20.10-1.module+el8.9.0+20382+04f7fe80 | RHBA-2023:6928 |
| Red Hat Enterprise Linux 8 | golang-bin | Fixed | 0:1.20.10-1.module+el8.9.0+20382+04f7fe80 | RHBA-2023:6928 |
| Red Hat Enterprise Linux 8 | golang-docs | Fixed | 0:1.20.10-1.module+el8.9.0+20382+04f7fe80 | RHBA-2023:6928 |
| Red Hat Enterprise Linux 8 | golang-misc | Fixed | 0:1.20.10-1.module+el8.9.0+20382+04f7fe80 | RHBA-2023:6928 |
| Red Hat Enterprise Linux 8 | golang-src | Fixed | 0:1.20.10-1.module+el8.9.0+20382+04f7fe80 | RHBA-2023:6928 |
| Red Hat Enterprise Linux 8 | golang-tests | Fixed | 0:1.20.10-1.module+el8.9.0+20382+04f7fe80 | RHBA-2023:6928 |
| Alpine Linux 3.24 | go | Fixed | 1.21.2-r0 | ALPINE-CVE-2023-39323 |
| Alpine Linux 3.23 | go | Fixed | 1.21.2-r0 | ALPINE-CVE-2023-39323 |
| Alpine Linux 3.22 | go | Fixed | 1.21.2-r0 | ALPINE-CVE-2023-39323 |
| Alpine Linux 3.21 | go | Fixed | 1.21.2-r0 | ALPINE-CVE-2023-39323 |
| Alpine Linux 3.20 | go | Fixed | 1.21.2-r0 | ALPINE-CVE-2023-39323 |
| Alpine Linux 3.19 | go | Fixed | 1.21.2-r0 | ALPINE-CVE-2023-39323 |
| Alpine Linux 3.18 | go | Fixed | 1.20.9-r0 | ALPINE-CVE-2023-39323 |
| Go library | toolchain | Fixed | 1.21.2 | GO-2023-2095 |
What the vendor says
As published in the CVE record by Go, the CVE's assigner (usually the vendor). Check the vendor's advisory before acting.
- Go toolchain cmd/go: affected: before 1.20.9, 1.21.0-0 to before 1.21.2; fixed in
1.20.9,1.21.2
References
- https://go.dev/issue/63211
- https://go.dev/cl/533215
- https://groups.google.com/g/golang-announce/c/XBa1oHDevAo
- https://pkg.go.dev/vuln/GO-2023-2095
- https://security.netapp.com/advisory/ntap-20231020-0001/
- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/KSEGD2IWKNUO3DWY4KQGUQM5BISRWHQE/
- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/CLB4TW7KALB3EEQWNWCN7OUIWWVWWCG2/
- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/XFOIBB4YFICHDM7IBOP7PWXW3FX4HLL2/
- https://security.gentoo.org/glsa/202311-09
About this page
Compiled by CVEfocus from the CVE List, the security data and VEX statements of Ubuntu, Debian, Red Hat, AlmaLinux, Rocky Linux and Microsoft, CISA's Known Exploited Vulnerabilities catalog and FIRST EPSS, refreshed several times a day (data status). Information only; see the disclaimer. Official record: cve.org · NVD.