CVE-2023-39320
Arbitrary code execution via go.mod toolchain directive in cmd/go
- Published
- Updated
- Reserved
- Assigned by
- Go
Description
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.
Timeline
ID reserved
By Go
- 43 days later
· 43 days later
Published
- 17 months later
· 17 months later
Record updated
Changes after publication (a new score, a public exploit, EPSS crossing 1, 10 or 50 %, leaving KEV) are kept since November 2026; earlier ones are not known.
Scores
| Scored by | CVSS | Score | Vector |
|---|---|---|---|
| NVDNVD · Modified | 3.1 | Critical9.8 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
- EPSS (exploitation in 30 days)
- 1.8% · top 22% of all CVEs (7 Nov 2026)
- CISA SSVC
- Exploitation: none · Automatable: yes · Technical impact: total
The list uses the assigner's score when there is one, then CISA's, then NVD's: Critical 9.8.
Weakness
- CWE-94: Improper Control of Generation of Code ('Code Injection')
- CWE-94 (opens in a new tab)All about CWE-94 and its CVEs
Affected products
- affected 1.21.0-0 – < 1.21.1
References (6)
- https://go.dev/issue/62198 (opens in a new tab)x_transferred
- https://go.dev/cl/526158 (opens in a new tab)x_transferred
- https://groups.google.com/g/golang-dev/c/2C5vbR-UNkI/m/L1hdrPhfBAAJ (opens in a new tab)x_transferred
- https://pkg.go.dev/vuln/GO-2023-2042 (opens in a new tab)x_transferred
- https://security.netapp.com/advisory/ntap-20231020-0004/ (opens in a new tab)x_transferred
- https://security.gentoo.org/glsa/202311-09 (opens in a new tab)x_transferred
Sources
The same CVE in the primary databases and aggregators, to check against.
- CVE.org record (opens in a new tab)
- CVE List JSON (GitHub) (opens in a new tab)
- NVD (opens in a new tab)
- FIRST EPSS (opens in a new tab)
- OSV.dev (opens in a new tab)
- GitHub Advisories (opens in a new tab)
- CIRCL Vulnerability-Lookup (opens in a new tab)
Badge for a README or a ticket
[](https://trackcve.app/cve/CVE-2023-39320)Record last updated .