CVE-2023-24531Go toolchain cmd/go
Critical 9.8 No auth needed
Follow: this CVE · Go toolchain · Go toolchain cmd/go We alert you by email or Slack (account required).
- Priority
- 74
- CVSS 3.1
- 9.8
- EPSS
- 1.6% probability of exploitation in 30 days · percentile 76
- Auth required
- No
- Published
- Jul 2, 2024
- Updated
- Jun 17, 2026
- Category
- Application · Cross-platform
- SSVC (CISA)
- Exploitation: none · Automatable: yes · Technical impact: total
- Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
What happens
Command go env is documented as outputting a shell script containing the Go environment. However, go env doesn't sanitize values, so executing its output as a shell script can cause various bad bahaviors, including executing arbitrary commands or inserting new environment variables. This issue is relatively minor because, in general, if an attacker can set arbitrary environment variables on a system, they have better attack vectors than making "go env" print them out.
What to do
- Apply the vendor's security update for cmd/go.
- It can be exploited without authentication: if you cannot patch now, restrict Internet access to the affected service.
Affected packages
| Ecosystem | Package | Affected versions | Fixed in | How to upgrade |
|---|---|---|---|---|
| Go | toolchain |
< 1.21.0-0 |
1.21.0-0 |
go get toolchain@v1.21.0-0 |
Per OSV / GitHub Advisories (GO-2024-2962). Check the version in your lockfile before upgrading.
Affected products
- Go toolchain · cmd/go
- gotoolchain · cmd\/go
As reported by the CNA that published the CVE. NVD has not added CPEs with versions yet.
Official sources
References
Links published by the sources. Open them with care.