CVE-2023-24531Output 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.
What to do
Fixed builds are available from Go, Ubuntu: see the table below for the fixed version per release.
Debian, Ubuntu have not shipped a fix for every release yet.
Is your server affected? One read-only command checks every installed package against this CVE and all others, using each vendor's fixed versions. Get started or get a free API key.
curl -sS "https://api.cvefocus.com/v1/check?format=text" -H "Authorization: Bearer $CVEFOCUS_KEY" \ -H "Content-Type: text/plain" --data-binary @inventory.txt
Vendor status at a glance
Status by vendor and release
From each vendor's own security data and VEX statements. "Fixed" means a fixed build is published for that release.
| Release | Package | Status | Fixed version | Advisory |
|---|---|---|---|---|
| Ubuntu 24.04 | golang-1.21 | Under investigation | UBUNTU-CVE-2023-24531 | |
| Ubuntu 24.04 | golang-1.22 | Not affected vulnerable_code_not_present | ||
| Ubuntu 22.04 | golang-1.13 | Fix pending | UBUNTU-CVE-2023-24531 | |
| Ubuntu 22.04 | golang-1.17 | Fixed | 1.17.13-3ubuntu1.2 | UBUNTU-CVE-2023-24531 |
| Ubuntu 22.04 | golang-1.18 | Fixed | 1.18.1-1ubuntu1.2 | UBUNTU-CVE-2023-24531 |
| Ubuntu 22.04 | golang-1.20 | Under investigation | UBUNTU-CVE-2023-24531 | |
| Ubuntu 22.04 | golang-1.21 | Under investigation | UBUNTU-CVE-2023-24531 | |
| Ubuntu 22.04 | golang-1.22 | Not affected vulnerable_code_not_present | ||
| Ubuntu 20.04 | golang-1.13 | Fix pending | UBUNTU-CVE-2023-24531 | |
| Ubuntu 20.04 | golang-1.14 | Fix pending | UBUNTU-CVE-2023-24531 | |
| Ubuntu 20.04 | golang-1.16 | Fix pending | UBUNTU-CVE-2023-24531 | |
| Ubuntu 20.04 | golang-1.18 | Fixed | 1.18.1-1ubuntu1~20.04.3 | UBUNTU-CVE-2023-24531 |
| Ubuntu 20.04 | golang-1.20 | Fix pending | UBUNTU-CVE-2023-24531 | |
| Ubuntu 20.04 | golang-1.21 | Fix pending | UBUNTU-CVE-2023-24531 | |
| Ubuntu 20.04 | golang-1.22 | Not affected vulnerable_code_not_present | ||
| Ubuntu 18.04 | golang-1.10 | Fix pending | UBUNTU-CVE-2023-24531 | |
| Ubuntu 18.04 | golang-1.13 | Fix pending | UBUNTU-CVE-2023-24531 | |
| Ubuntu 18.04 | golang-1.16 | Fix pending | UBUNTU-CVE-2023-24531 | |
| Ubuntu 18.04 | golang-1.18 | Fix pending | 1.18.1-1ubuntu1~18.04.4+esm1 (Ubuntu Pro) | UBUNTU-CVE-2023-24531 |
| Ubuntu 18.04 | golang-1.8 | Fix pending | UBUNTU-CVE-2023-24531 | |
| Ubuntu 18.04 | golang-1.9 | Fix pending | UBUNTU-CVE-2023-24531 | |
| Ubuntu 16.04 | golang-1.10 | Fix pending | UBUNTU-CVE-2023-24531 | |
| Ubuntu 16.04 | golang-1.13 | Fix pending | UBUNTU-CVE-2023-24531 | |
| Ubuntu 16.04 | golang-1.18 | Fix pending | 1.18.1-1ubuntu1~16.04.6+esm1 (Ubuntu Pro) | UBUNTU-CVE-2023-24531 |
| Ubuntu 16.04 | golang-1.6 | Fix pending | UBUNTU-CVE-2023-24531 | |
| Ubuntu 14.04 | golang-1.10 | Fix pending | UBUNTU-CVE-2023-24531 | |
| Debian 12 | golang-1.19 | Fix pending | DEBIAN-CVE-2023-24531 | |
| Go library | toolchain | Fixed | 1.21.0-0 | GO-2024-2962 |
What the vendor says
As published in the CVE record by Go, the CVE's assigner (usually the vendor). Check the vendor's advisory before acting.
- Go toolchain cmd/go: affected: before 1.21.0-0; fixed in
1.21.0-0
References
- https://go.dev/cl/488375
- https://go.dev/cl/493535
- https://go.dev/issue/58508
- https://groups.google.com/g/golang-dev/c/ixHOFpSbajE/m/8EjlbKVWAwAJ
- https://pkg.go.dev/vuln/GO-2024-2962
About this page
Compiled by CVEfocus from the CVE List, the security data and VEX statements of Ubuntu, Debian, Red Hat, AlmaLinux, Rocky Linux and Microsoft, CISA's Known Exploited Vulnerabilities catalog and FIRST EPSS, refreshed several times a day (data status). Information only; see the disclaimer. Official record: cve.org · NVD.