{"id":"CVE-2023-39320","published":"2023-09-08T16:13:26Z","modified":"2025-02-13T17:02:48Z","title":"Arbitrary code execution via go.mod toolchain directive in cmd/go","vendor":"Go toolchain","product":"cmd/go","tier":"tail","description":{"text":"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.","provenance":"source","from":"CVE.org"},"cvss":null,"epss":{"score":0.01757,"percentile":0.7851,"provenance":"source"},"cwes":[],"references":[{"url":"https://go.dev/issue/62198","tags":[]},{"url":"https://go.dev/cl/526158","tags":[]},{"url":"https://groups.google.com/g/golang-dev/c/2C5vbR-UNkI/m/L1hdrPhfBAAJ","tags":[]},{"url":"https://pkg.go.dev/vuln/GO-2023-2042","tags":[]},{"url":"https://security.netapp.com/advisory/ntap-20231020-0004/","tags":[]},{"url":"https://security.gentoo.org/glsa/202311-09","tags":[]}],"priority":{"score":20.7,"factors":[{"name":"EPSS percentile","points":15.7},{"name":"Public exploit code","points":5.0}]},"exploitSources":{"pocGithub":{"count":1,"skipped":0,"earliest":"2024-02-24","earliestUrl":"https://github.com/ayrustogaru/cve-2023-39320","repos":[{"name":"ayrustogaru/cve-2023-39320","url":"https://github.com/ayrustogaru/cve-2023-39320","stars":1,"created":"2024-02-24"}]},"first":{"date":"2024-02-24","source":"PoC-in-GitHub","url":"https://github.com/ayrustogaru/cve-2023-39320"},"provenance":"source"},"vendorSlug":"go-toolchain","affectedVersions":[{"vendor":"Go toolchain","product":"cmd/go","versions":[">= 1.21.0-0, < 1.21.1"]}],"ssvc":{"exploitation":"none","automatable":"yes","technicalImpact":"total","timestamp":"2024-09-26T17:28:10.391044Z","from":"CISA ADP","provenance":"source"},"affected":[{"ecosystem":"Go","package":"toolchain","vulnerableRanges":[">=1.21.0-0, <1.21.1"],"patched":["1.21.1"],"from":["GO-2023-2042"],"provenance":"source"}],"summary":{"text":"The go.mod toolchain directive in the cmd/go component of the Go toolchain, introduced in Go 1.21, can be abused to run scripts and binaries located relative to the root of a module. An attacker who can get a malicious module downloaded, whether through the module proxy or directly via VCS software, can achieve code execution when the go command is run inside that module.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T21:40:14Z"},"euvd":{"id":"EUVD-2023-43052","exploited":false,"provenance":"source"},"lineage":{"packageHistory":[{"cve":"CVE-2023-29404","published":"2023-06-08","fixed":"1.20.5","kev":false},{"cve":"CVE-2023-29405","published":"2023-06-08","fixed":"1.20.5","kev":false},{"cve":"CVE-2023-24531","published":"2024-07-02","fixed":"1.21.0-0","kev":false},{"cve":"CVE-2023-39320","published":"2023-09-08","fixed":"1.21.1","kev":false},{"cve":"CVE-2023-39323","published":"2023-10-05","fixed":"1.21.2","kev":false,"link":{"from":"CVE-2023-39320","to":"CVE-2023-39323","relation":"successor","confidence":"low","kind":"sequence","evidence":[{"kind":"version-step","provenance":"source","package":"Go:toolchain","fromFixed":"1.21.1","toFixed":"1.21.2","daysApart":27}]}},{"cve":"CVE-2023-45285","published":"2023-12-06","fixed":"1.21.5","kev":false},{"cve":"CVE-2024-24787","published":"2024-05-08","fixed":"1.22.3","kev":false}],"package":"Go:toolchain"}}