# CVE-2023-39320: Arbitrary code execution via go.mod toolchain directive in cmd/go

- Severity: Critical 9.8 (CVSS:3.1, scored by NVD) `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 1.76%, higher than 78% of CVEs (2026-12-01)
- Published: 2023-09-07T16:11:28.000Z
- Modified: 2026-09-08T08:47:48.922Z
- Also known as: GO-2023-2042, BIT-GOLANG-2023-39320
- Related: CGA-m5h9-c5w7-cg58
- Weaknesses: CWE-94
- SSVC (CISA-ADP): exploitation none, automatable yes, technical impact total
- 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.

(As written by CVE List.)

## Affected

- cmd/go: from 1.21.0-0 before 1.21.1
- toolchain (Go): from 1.21.0-0 before 1.21.1
- golang go: from 1.21.0 before 1.21.1
- golang (Bitnami): from 1.21.0 before 1.21.1

## Every score

- NVD: CVSS:3.1 9.8 Critical `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H`
- Bitnami Vulnerability Database: rating Critical

## References

- <https://go.dev/issue/62198> (issue-tracking, report)
- <https://go.dev/cl/526158> (fix, patch)
- <https://groups.google.com/g/golang-dev/c/2C5vbR-UNkI/m/L1hdrPhfBAAJ> (article, release-notes, web)
- <https://pkg.go.dev/vuln/GO-2023-2042> (advisory, vendor-advisory)
- <https://security.netapp.com/advisory/ntap-20231020-0004/> (advisory, third-party-advisory)
- <https://security.gentoo.org/glsa/202311-09> (web)
- <https://nvd.nist.gov/vuln/detail/CVE-2023-39320> (web)

## Sources

- CVE List: [CVE-2023-39320](https://www.cve.org/CVERecord?id=CVE-2023-39320), CVE Terms of Use, modified 2025-02-13
- Go Vulnerability Database: [GO-2023-2042](https://pkg.go.dev/vuln/GO-2023-2042), CC-BY-4.0, modified 2026-02-04
- NVD: [CVE-2023-39320](https://nvd.nist.gov/vuln/detail/CVE-2023-39320), Public domain, modified 2026-06-17
- Bitnami Vulnerability Database: [BIT-GOLANG-2023-39320](https://osv.dev/vulnerability/BIT-GOLANG-2023-39320), Apache-2.0, modified 2026-09-08

---

Page: https://cve.day/CVE-2023-39320 · Whole record: https://cve.day/CVE-2023-39320.json · Rebuilt by cve.day 2026-11-25T22:58:27.766Z
