CVE-2023-24531 json
Output of "go env" does not sanitize values in cmd/go
published 2024-07-02 2 y ago modified 2026-06-17 4 mo ago also BIT-golang-2023-24531 , EUVD-2023-28549 , GO-2024-2962
- cvss
- 9.8
- version 3.1, CNA
- cisa kev
- Not listed
- not in CISA's catalog
- epss
- 0.8%
- EPSS 0.8% chance of exploitation in 30 days, percentile 58%
- public exploits
- 0
- none known
Summary
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.
Patch / fix
- bitnami golang 1.21.0-0
- go toolchain 1.21.0-0
- Go toolchain cmd/go 1.21.0-0
- gotoolchain cmd\/go 1.21.0-0
- golang-1.17 Ubuntu 22.04 LTS 1.17.13-3ubuntu1.2
- golang-1.18 Ubuntu 20.04 LTS 1.18.1-1ubuntu1~20.04.3
- golang-1.18 Ubuntu 22.04 LTS 1.18.1-1ubuntu1.2
- golang-1.18 Ubuntu Pro 16.04 LTS 1.18.1-1ubuntu1~16.04.6+esm1
- golang-1.18 Ubuntu Pro 18.04 LTS 1.18.1-1ubuntu1~18.04.4+esm1
ubuntu advisories UBUNTU-CVE-2023-24531
Ubuntu security data © Canonical Ltd., from https://github.com/canonical/ubuntu-security-notices via OSV; changed: normalised to fixed package versions per release. CC BY-SA 4.0
- msft-golang CBL-Mariner 2.0 1.21.0-1
- golang CBL-Mariner 2.0, Azure Linux 3.0 1.21.0-1
azure linux advisories AZL-43104AZL-43110AZL-52719
Azure Linux vulnerability data, Copyright (c) Microsoft Corporation, from https://github.com/microsoft/AzureLinuxVulnerabilityData via OSV, under the MIT licence; changed: normalised to fixed package versions per release. MIT
- go.dev/cl/488375 patch
- go.dev/cl/493535 patch
Vendor advisories
What the vendors themselves say about their products: affected, fixed or not affected, and what to do.
red hat product security vex CVE-2023-24531 updated cvss 6.0
cmd/go: cmd/go: output does not sanitize values
-
Red Hat All currently supported Red Hat productsnot affected: vulnerable code not present
Red Hat CSAF VEX © Red Hat, Inc., from https://security.access.redhat.com/data/csaf/v2/vex/; changed: reduced to product statuses and remediations. CC BY 4.0 · csaf
CISA SSVC
- Exploitation
- none
- Automatable
- yes
- Technical impact
- total
- Assessed
- 2 y ago
Exploit prediction
0.84% chance of exploitation in the next 30 days, higher than 58% of all scored CVEs (FIRST EPSS, 2026-11-08).
CVSS scores
| assigned by | version | score | vector |
|---|---|---|---|
| CISA ADP | 3.1 | 9.8 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
| CNA | 3.1 | 9.8 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
| OSV | 3.1 | 9.8 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
Affected packages
| ecosystem | package | affected | fixed in |
|---|---|---|---|
| bitnami | golang | <1.21.0-0 |
1.21.0-0 |
| go | toolchain | <1.21.0-0 |
1.21.0-0 |
Affected products
- Go toolchain cmd/go
- gotoolchain cmd\/go
References
Sources
- CVE List CVE-2023-24531
- NVD CVE-2023-24531
- OSV BIT-golang-2023-24531
- OSV GO-2024-2962
Fencer Vulns keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.
CPEs and fixed versions use Anchore's correction of NVD's data: Added CPE configurations because not yet analyzed by NVD.