Critical severity · published Jul 2, 2024
CVE-2023-24531
Output of "go env" does not sanitize values in cmd/go
9.8
CVSS
0.8%
EPSS
No
On KEV
Description
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.
CVSS vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Attack vector
Network
Complexity
Low
Privileges
None
User interaction
None
Confidentiality
High
Integrity
High
Availability
High
Scope
Unchanged
Exploitation
Is it being used?
Exploit prediction (EPSS)0.8% · higher than 58% of CVEs
Exploited in the wildNo evidence yet
CISA KEVNot listed
Ransomware campaign useNot known
Affected products
Which versions
CM
cmd/go · Go toolchain
before 1.21.0-0 · source: vendor
CM
Cmd\/go · Gotoolchain
before 1.21.0-0 · source: CISA
Affected product
CM
cmd/go
Go toolchain
More from cmd/go
8.8
CVE-2026-27140
Code execution vulnerability in SWIG code generation in cmd/go
8.8
CVE-2024-45340
GOAUTH credential leak in cmd/go
8.6
CVE-2025-4674
Unexpected command execution in untrusted VCS repositories in cmd/go
8.4
CVE-2026-56865
Fix transparency log tile verification bypass in golang.org/x/mod/sumdb/tlog
7.8
CVE-2026-94447
Checksum database bypass for golang.org/toolchain in cmd/go