CVE-2023-24531

published 2 Jul 2024 · updated 12 Nov 2026

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

9.8CriticalCVSS 9.8EPSS 1%

No exploitation in the wild has been reported. EPSS puts the chance of exploitation in the next 30 days at 1%. Fixed in 1.21.0-0.

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.

Affected

Vendors, products and packages with version ranges

VendorProductVersionsFixed
Go toolchain<1.21.0-01.21.0-0

Timeline

Every event on this vulnerability

Embed

A live severity badge for an advisory, README or ticket

CVE-2023-24531 severity on Zeptric[![CVE-2023-24531](https://zeptric.io/badge/cve/CVE-2023-24531.svg)](https://zeptric.io/cve/CVE-2023-24531)