# CVE-2023-24531: Output of "go env" does not sanitize values in cmd/go

- Severity: Critical 9.8 (CVSS:3.1, scored by CISA-ADP) `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.83%, higher than 58% of CVEs (2026-12-01)
- Published: 2024-07-02T19:27:52.000Z
- Modified: 2026-06-17T05:39:28.430Z
- Also known as: GO-2024-2962, BIT-GOLANG-2023-24531
- Related: CGA-jm5g-fwrc-c9r9
- Weaknesses: CWE-138
- SSVC (CISA-ADP): exploitation none, automatable yes, technical impact total
- Assigned by: 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.

(As written by CVE List.)

## Affected

- cmd/go: before 1.21.0-0
- gotoolchain cmd\/go: before 1.21.0-0
- toolchain (Go): before 1.21.0-0
- golang (Bitnami): before 1.21.0-0

## Every score

- CISA-ADP: CVSS:3.1 9.8 Critical `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H`
- Bitnami Vulnerability Database: rating Critical

## References

- <https://go.dev/cl/488375> (fix, web)
- <https://go.dev/cl/493535> (fix, web)
- <https://go.dev/issue/58508> (report, web)
- <https://groups.google.com/g/golang-dev/c/ixHOFpSbajE/m/8EjlbKVWAwAJ> (web)
- <https://pkg.go.dev/vuln/GO-2024-2962> (web)
- <https://security.netapp.com/advisory/ntap-20250328-0005/> (web)
- <https://nvd.nist.gov/vuln/detail/CVE-2023-24531> (web)

## Sources

- CVE List: [CVE-2023-24531](https://www.cve.org/CVERecord?id=CVE-2023-24531), CVE Terms of Use, modified 2025-03-28
- Go Vulnerability Database: [GO-2024-2962](https://pkg.go.dev/vuln/GO-2024-2962), CC-BY-4.0, modified 2026-02-04
- NVD: [CVE-2023-24531](https://nvd.nist.gov/vuln/detail/CVE-2023-24531), Public domain, modified 2026-06-17
- Bitnami Vulnerability Database: [BIT-GOLANG-2023-24531](https://osv.dev/vulnerability/BIT-GOLANG-2023-24531), Apache-2.0, modified 2025-05-20

---

Page: https://cve.day/CVE-2023-24531 · Whole record: https://cve.day/CVE-2023-24531.json · Rebuilt by cve.day 2026-11-25T22:58:34.195Z
