CVE-2023-39320
CRITICAL 9.8CVSS 3.1Arbitrary code execution via go.mod toolchain directive in cmd/go
The go.mod toolchain directive, introduced in Go 1.21, can be leveraged to execute scripts and binaries relative to the root of the module when the "go" command was executed within the module. This applies to modules downloaded using the "go" command from the module proxy, as well as modules downloaded directly using VCS software.
- Published
- 8 Sep 2023
- Last modified
- 17 Jun 2026
- Assigned by
- security@golang.org
- NVD status
- Modified
- Weakness
- CWE-94
- Also known as
- BIT-golang-2023-39320GO-2023-2042
- Sources
- NVDJSONOSV GO-2023-2042JSON
Scores
| Source | Scored by | Version | Score | Vector / decision |
|---|---|---|---|---|
| NVD | nvd@nist.gov (Primary) | CVSS 3.1 | CRITICAL 9.8 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
Affected
| Source | Vendor / ecosystem | Product / package | Affected versions | Fixed in |
|---|---|---|---|---|
| NVD | golang | gocpe:2.3:a:golang:go:*:*:*:*:*:*:*:* |
>= 1.21.0, < 1.21.1 | 1.21.1 |
| OSV | Go | toolchain | >= 1.21.0-0, < 1.21.1 | 1.21.1 |
References
- https://go.dev/cl/526158 · Patch, FIX
- https://go.dev/issue/62198 · Issue Tracking, REPORT
- https://groups.google.com/g/golang-dev/c/2C5vbR-UNkI/m/L1hdrPhfBAAJ · Release Notes, WEB
- https://pkg.go.dev/vuln/GO-2023-2042 · Vendor Advisory
- https://security.gentoo.org/glsa/202311-09
- https://security.netapp.com/advisory/ntap-20231020-0004/ · Third Party Advisory
History
- 25 Nov 2026 20:36 UTC · NVD: first stored (published 8 Sep 2023)
- 25 Nov 2026 20:14 UTC · OSV: first stored (published 7 Sep 2023)