Output of "go env" does not sanitize values in cmd/go
Key facts
- Attack vector
- Network
- Privileges required
- None
- User interaction
- None
- Attack complexity
- Low
- Impact type
- —
- Confidentiality · integrity · availability
- High · High · High
- Fix status
- Fixed
Attack profile from CVSS 3.1 · CISA ADP. Fix status from CNA.
Summary
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.
Why it matters now
SSVC decision points
CISA ADP · SSVC 2.0.3
- Exploitation
- None
- Automatable
- Yes
- Technical impact
- Total
The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| Go standard library | cmd/go | before 1.21.0-0 | 1.21.0-0 | Patch available | CNA |
- cmd/go VendorGo standard library Affected before 1.21.0-0 Fixed in 1.21.0-0 Patch available CNA
CPE names CISA-ADP · 1
| CPE | Versions | Role | Vendor |
|---|---|---|---|
| cpe:2.3:a:gotoolchain:cmd\/go:*:*:*:*:*:*:*:* | — | — | — |
- cpe:2.3:a:gotoolchain:cmd\/go:*:*:*:*:*:*:*:* Versions — — ·—
Remediation
- Fix · CNA cmd/go (Go toolchain) Fixed in 1.21.0-0
Vendor assessments
Timeline
- 2026-10-02 Threatist record created from CVE-2023-24531
- 2026-10-03 Alias added: GHSA-cwpg-qgc6-jxvq
References
More Go standard library vulnerabilities
- TI-2020-00578 Improper certificate validation in Microsoft Windows KEVCVSS 3.1HIGH 8.1
- TI-2023-23979 The HTTP/2 protocol allows a denial of service (server resource consumption) because… KEVCVSS 3.1HIGH 7.5
- TI-2023-24278 HTTP/2 CONTINUATION flood in net/http CVSS 3.1HIGH 7.5
- TI-2018-05208 The "go get" implementation in Go 1.9.4, when the -insecure command-line option is used… CVSS 3.1HIGH 8.8
- TI-2024-16309 Panic when parsing invalid palette-color images in golang.org/x/image CVSS 3.1HIGH 7.5
- TI-2022-20112 Request smuggling due to improper request handling in golang.org/x/net/http2/h2c CVSS 3.1HIGH 7.5
Sources
- CVE-2023-24531 · CVE Program
- CVE-2023-24531 · NVD
- FIRST EPSS
- GHSA-cwpg-qgc6-jxvq · GitHub Advisory Database · CC BY 4.0
- CVE-2023-24531 · Red Hat security data · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences