CVEfocus › CVE database › CVE-2023-24531

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

CVSS 9.8 CriticalEPSS 1.6% (higher than 76% of CVEs)Published 2024-07-02Updated 2025-03-28Assigner: 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

4Fixed
18Fix pending
3Under investigation
3Not affected

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.

ReleasePackageStatusFixed versionAdvisory
Ubuntu 24.04golang-1.21Under investigationUBUNTU-CVE-2023-24531
Ubuntu 24.04golang-1.22Not affected
vulnerable_code_not_present
Ubuntu 22.04golang-1.13Fix pendingUBUNTU-CVE-2023-24531
Ubuntu 22.04golang-1.17Fixed1.17.13-3ubuntu1.2UBUNTU-CVE-2023-24531
Ubuntu 22.04golang-1.18Fixed1.18.1-1ubuntu1.2UBUNTU-CVE-2023-24531
Ubuntu 22.04golang-1.20Under investigationUBUNTU-CVE-2023-24531
Ubuntu 22.04golang-1.21Under investigationUBUNTU-CVE-2023-24531
Ubuntu 22.04golang-1.22Not affected
vulnerable_code_not_present
Ubuntu 20.04golang-1.13Fix pendingUBUNTU-CVE-2023-24531
Ubuntu 20.04golang-1.14Fix pendingUBUNTU-CVE-2023-24531
Ubuntu 20.04golang-1.16Fix pendingUBUNTU-CVE-2023-24531
Ubuntu 20.04golang-1.18Fixed1.18.1-1ubuntu1~20.04.3UBUNTU-CVE-2023-24531
Ubuntu 20.04golang-1.20Fix pendingUBUNTU-CVE-2023-24531
Ubuntu 20.04golang-1.21Fix pendingUBUNTU-CVE-2023-24531
Ubuntu 20.04golang-1.22Not affected
vulnerable_code_not_present
Ubuntu 18.04golang-1.10Fix pendingUBUNTU-CVE-2023-24531
Ubuntu 18.04golang-1.13Fix pendingUBUNTU-CVE-2023-24531
Ubuntu 18.04golang-1.16Fix pendingUBUNTU-CVE-2023-24531
Ubuntu 18.04golang-1.18Fix pending1.18.1-1ubuntu1~18.04.4+esm1 (Ubuntu Pro)UBUNTU-CVE-2023-24531
Ubuntu 18.04golang-1.8Fix pendingUBUNTU-CVE-2023-24531
Ubuntu 18.04golang-1.9Fix pendingUBUNTU-CVE-2023-24531
Ubuntu 16.04golang-1.10Fix pendingUBUNTU-CVE-2023-24531
Ubuntu 16.04golang-1.13Fix pendingUBUNTU-CVE-2023-24531
Ubuntu 16.04golang-1.18Fix pending1.18.1-1ubuntu1~16.04.6+esm1 (Ubuntu Pro)UBUNTU-CVE-2023-24531
Ubuntu 16.04golang-1.6Fix pendingUBUNTU-CVE-2023-24531
Ubuntu 14.04golang-1.10Fix pendingUBUNTU-CVE-2023-24531
Debian 12golang-1.19Fix pendingDEBIAN-CVE-2023-24531
Go librarytoolchainFixed1.21.0-0GO-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.

References

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.