Output of "go env" does not sanitize values in cmd/go
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.
01
describes (1)
Related CVEs.
| ID | severity | exploitable | ||
|---|---|---|---|---|
| CVE-2023-24531US | — | — | ||
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 caus… | ||||
02
references
External citations — patches, advisories, analysis.
- https://go.dev/cl/488375WEB
- https://go.dev/cl/493535WEB
- https://go.dev/issue/58508WEB
- https://groups.google.com/g/golang-dev/c/ixHOFpSbajE/m/8EjlbKVWAwAJWEB
- https://nvd.nist.gov/vuln/detail/CVE-2023-24531WEB
- https://pkg.go.dev/vuln/GO-2024-2962WEB
- https://security.netapp.com/advisory/ntap-20250328-0005/WEB
scry
Advisories like this name the exposed products attackers go after on your perimeter. See what is exposed on your perimeter with a free passive scan.
Free scan