CVE-2023-39323
CVE-2023-39323 · Arbitrary code execution during build via line directives in cmd/go
This page contains facts from public vulnerability sources. Check the original advisory before updating.
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.
CVSS 8.1 · High · EPSS 1.9% · Fix available
- Published
- Updated
Stack: system
Affected products and versions
cmd/go
- Versions
- ≥ 0, < 1.20.9: Affected (semver)
- ≥ 1.21.0-0, < 1.21.2: Affected (semver)
Update to 1.20.9; Update to 1.21.2
golang-1.19 Debian:12
- Versions
- 1.19.10-1
- 1.19.10-2
- 1.19.11-1
- 1.19.12-1
- 1.19.12-2
- 1.19.12-2~bpo11+1
- 1.19.12-2~bpo12+1
- 1.19.13-1
- 1.19.13-1~bpo11+1
- 1.19.13-1~bpo12+1
- 1.19.8-2
- 1.19.9-1
- Affected ranges
- ECOSYSTEM: (−∞, +∞)
No fix published
golang-1.18 Ubuntu:Pro:16.04:LTS
- Versions
- 1.18.1-1ubuntu1~16.04.6
- Affected ranges
- ECOSYSTEM: < 1.18.1-1ubuntu1~16.04.6+esm1
Update to 1.18.1-1ubuntu1~16.04.6+esm1
golang-1.18 Ubuntu:Pro:18.04:LTS
- Versions
- 1.18.1-1ubuntu1~18.04.3
- 1.18.1-1ubuntu1~18.04.4
- Affected ranges
- ECOSYSTEM: < 1.18.1-1ubuntu1~18.04.4+esm1
Update to 1.18.1-1ubuntu1~18.04.4+esm1
golang-1.18 Ubuntu:20.04:LTS
- Versions
- 1.18.1-1ubuntu1~20.04.1
- 1.18.1-1ubuntu1~20.04.2
- Affected ranges
- ECOSYSTEM: < 1.18.1-1ubuntu1~20.04.3
Update to 1.18.1-1ubuntu1~20.04.3
golang-1.20 Ubuntu:20.04:LTS
- Versions
- 1.20.3-1ubuntu0.1~20.04
- Affected ranges
- ECOSYSTEM: < 1.20.3-1ubuntu0.1~20.04.1
Update to 1.20.3-1ubuntu0.1~20.04.1
golang-1.21 Ubuntu:20.04:LTS
- Versions
- 1.21.1-1~ubuntu20.04.1
- Affected ranges
- ECOSYSTEM: < 1.21.1-1~ubuntu20.04.2
Update to 1.21.1-1~ubuntu20.04.2
golang-1.17 Ubuntu:22.04:LTS
- Versions
- 1.17-1ubuntu2
- 1.17.3-1ubuntu1
- 1.17.3-1ubuntu2
- 1.17.13-3ubuntu1
- 1.17.13-3ubuntu1.2
- Affected ranges
- ECOSYSTEM: < 1.17.13-3ubuntu1.3
Update to 1.17.13-3ubuntu1.3
golang-1.18 Ubuntu:22.04:LTS
- Versions
- 1.18~beta1-0ubuntu1
- 1.18~beta2-1ubuntu1
- 1.18~beta2-1ubuntu2
- 1.18~rc1-1ubuntu1
- 1.18-1ubuntu1
- 1.18.1-1ubuntu1
- 1.18.1-1ubuntu1.1
- Affected ranges
- ECOSYSTEM: < 1.18.1-1ubuntu1.2
Update to 1.18.1-1ubuntu1.2
golang-1.20 Ubuntu:22.04:LTS
- Versions
- 1.20.3-1ubuntu0.1~22.04
- Affected ranges
- ECOSYSTEM: < 1.20.3-1ubuntu0.1~22.04.1
Update to 1.20.3-1ubuntu0.1~22.04.1
golang-1.21 Ubuntu:22.04:LTS
- Versions
- 1.21.1-1~ubuntu22.04.1
- Affected ranges
- ECOSYSTEM: < 1.21.1-1~ubuntu22.04.2
Update to 1.21.1-1~ubuntu22.04.2
Original sources
- 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/[email protected]/message/KSEGD2IWKNUO3DWY4KQGUQM5BISRWHQE/
- https://lists.fedoraproject.org/archives/list/[email protected]/message/CLB4TW7KALB3EEQWNWCN7OUIWWVWWCG2/
- https://lists.fedoraproject.org/archives/list/[email protected]/message/XFOIBB4YFICHDM7IBOP7PWXW3FX4HLL2/
- https://security.gentoo.org/glsa/202311-09
- https://nvd.nist.gov/vuln/detail/CVE-2023-39323