# CVE-2023-24531: golang-1.18: Command go env is documented as outputting a shell script containing the Go environment

CVE-2023-24531 is fixed in 6 products on 1 platform, first by golang-1.17 1.17.13-3ubuntu1.2, released July 2, 2024. It is not reported as exploited. Patch Radar priority: Routine.

- Web page: https://patchblox.com/security/cve/CVE-2023-24531
- Priority: Routine
- CVSS: n/a (Medium)
- EPSS: 0.0084
- CISA KEV: not listed
- Exploited (vendor report): no
- Publicly disclosed: no
- Published: Jul 2, 2024

## Description

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.

## Where it's fixed

| Platform | Product | Fixed in | Fix | Released |
|---|---|---|---|---|
| Linux | golang-1.17 Ubuntu 22.04.1 LTS (jammy) | 1.17.13-3ubuntu1.2 | [golang-1.17 1.17.13-3ubuntu1.2](https://patchblox.com/security/data/fix/linux/ubuntu-jammy-golang-1.17-1.17.13-3ubuntu1.2.md) | Jul 2, 2024 |
| Linux | golang-1.17-go Ubuntu 22.04.1 LTS (jammy) | 1.17.13-3ubuntu1.2 | [golang-1.17-go 1.17.13-3ubuntu1.2](https://patchblox.com/security/data/fix/linux/ubuntu-jammy-golang-1.17-go-1.17.13-3ubuntu1.2.md) | Jul 2, 2024 |
| Linux | golang-1.17-src Ubuntu 22.04.1 LTS (jammy) | 1.17.13-3ubuntu1.2 | [golang-1.17-src 1.17.13-3ubuntu1.2](https://patchblox.com/security/data/fix/linux/ubuntu-jammy-golang-1.17-src-1.17.13-3ubuntu1.2.md) | Jul 2, 2024 |
| Linux | golang-1.18 Ubuntu 18.04.6 LTS (bionic) | 1.18.1-1ubuntu1~18.04.4+esm1 | [golang-1.18 1.18.1-1ubuntu1~18.04.4+esm1](https://patchblox.com/security/data/fix/linux/ubuntu-bionic-golang-1.18-1.18.1-1ubuntu1-18.04.4-esm1.md) | Sep 6, 2024 |
| Linux | golang-1.18 Ubuntu 20.04 LTS (focal) | 1.18.1-1ubuntu1~20.04.3 | [golang-1.18 1.18.1-1ubuntu1~20.04.3](https://patchblox.com/security/data/fix/linux/ubuntu-focal-golang-1.18-1.18.1-1ubuntu1-20.04.3.md) | Sep 6, 2024 |
| Linux | golang-1.18 Ubuntu 22.04.1 LTS (jammy) | 1.18.1-1ubuntu1.2 | [golang-1.18 1.18.1-1ubuntu1.2](https://patchblox.com/security/data/fix/linux/ubuntu-jammy-golang-1.18-1.18.1-1ubuntu1.2.md) | Sep 6, 2024 |
| Linux | golang-1.18-go Ubuntu 18.04.6 LTS (bionic) | 1.18.1-1ubuntu1~18.04.4+esm1 | [golang-1.18-go 1.18.1-1ubuntu1~18.04.4+esm1](https://patchblox.com/security/data/fix/linux/ubuntu-bionic-golang-1.18-go-1.18.1-1ubuntu1-18.04.4-esm1.md) | Sep 6, 2024 |
| Linux | golang-1.18-go Ubuntu 20.04 LTS (focal) | 1.18.1-1ubuntu1~20.04.3 | [golang-1.18-go 1.18.1-1ubuntu1~20.04.3](https://patchblox.com/security/data/fix/linux/ubuntu-focal-golang-1.18-go-1.18.1-1ubuntu1-20.04.3.md) | Sep 6, 2024 |
| Linux | golang-1.18-go Ubuntu 22.04.1 LTS (jammy) | 1.18.1-1ubuntu1.2 | [golang-1.18-go 1.18.1-1ubuntu1.2](https://patchblox.com/security/data/fix/linux/ubuntu-jammy-golang-1.18-go-1.18.1-1ubuntu1.2.md) | Sep 6, 2024 |
| Linux | golang-1.18-src Ubuntu 18.04.6 LTS (bionic) | 1.18.1-1ubuntu1~18.04.4+esm1 | [golang-1.18-src 1.18.1-1ubuntu1~18.04.4+esm1](https://patchblox.com/security/data/fix/linux/ubuntu-bionic-golang-1.18-src-1.18.1-1ubuntu1-18.04.4-esm1.md) | Sep 6, 2024 |
| Linux | golang-1.18-src Ubuntu 20.04 LTS (focal) | 1.18.1-1ubuntu1~20.04.3 | [golang-1.18-src 1.18.1-1ubuntu1~20.04.3](https://patchblox.com/security/data/fix/linux/ubuntu-focal-golang-1.18-src-1.18.1-1ubuntu1-20.04.3.md) | Sep 6, 2024 |
| Linux | golang-1.18-src Ubuntu 22.04.1 LTS (jammy) | 1.18.1-1ubuntu1.2 | [golang-1.18-src 1.18.1-1ubuntu1.2](https://patchblox.com/security/data/fix/linux/ubuntu-jammy-golang-1.18-src-1.18.1-1ubuntu1.2.md) | Sep 6, 2024 |

---

Data as of 2026-11-09T01:18:40Z UTC. Source: Patchblox Patch Radar (https://patchblox.com/security/patch-radar). Patchblox finds out-of-date software on Windows, macOS and Linux and updates it through release rings: https://patchblox.com/demo

Free to use with attribution: show "Data: Patchblox Patch Radar" with a link to https://patchblox.com/security/patch-radar. Terms, including what needs a written agreement: https://patchblox.com/security/patch-radar/use-the-data

Product names, logos and trademarks shown on Patch Radar belong to their respective owners. They are used only to identify the software each security fix applies to and to help readers find their platform. Their use does not imply any affiliation with, or endorsement by, those owners, and Patchblox is not affiliated with any of them.
