CVE-2023-24531

Output of "go env" does not sanitize values in cmd/go

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.

9.8
CVSS
Severity: Critical
CVSS 3.1 •
EPSS 0.66%
Affected: Go toolchain cmd/go
Published at:
Updated at:

References

Frequently Asked Questions

What is the severity of CVE-2023-24531?
CVE-2023-24531 has been scored as a critical severity vulnerability.
How to fix CVE-2023-24531?
To fix CVE-2023-24531, make sure you are using an up-to-date version of the affected component(s) by checking the vendor release notes. As for now, there are no other specific guidelines available.
Is CVE-2023-24531 being actively exploited in the wild?
As for now, there are no information to confirm that CVE-2023-24531 is being actively exploited. According to its EPSS score, there is a ~1% probability that this vulnerability will be exploited by malicious actors in the next 30 days.
What software or system is affected by CVE-2023-24531?
CVE-2023-24531 affects Go toolchain cmd/go.
This platform uses data from the NIST NVD, MITRE CVE, MITRE CWE, First.org and CISA KEV but is not endorsed or certified by these entities. CVE is a registred trademark of the MITRE Corporation and the authoritative source of CVE content is MITRE's CVE web site. CWE is a registred trademark of the MITRE Corporation and the authoritative source of CWE content is MITRE's CWE web site.
© 2025 Under My Watch. All Rights Reserved.