CVE-2023-24531
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.
Attack profile
How easy it is to exploit
- Attack vector
- Network
- Complexity
- Low
- Privileges needed
- None
- User interaction
- None
What an attacker can affect
- Confidentiality
- High
- Integrity
- High
- Availability
- High
Exploit likelihood
What each source reports
CVE List Score used
9.8
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.
- Record
CVE-2023-24531- CVSS 3.1
- 9.8 Critical
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H - Updated
- 2026-11-02
EUVDEUVD-2023-28549
9.8
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.
- Record
EUVD-2023-28549- CVSS 3.1
- 9.8 Critical
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H - Updated
- 2026-11-02
GitHub AdvisoriesGHSA-cwpg-qgc6-jxvq
9.8
Command go env is documented as outputting a shell script containing the Go environment. However,...
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.
- Record
GHSA-cwpg-qgc6-jxvq- CVSS 3.1
- 9.8 Critical
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H - Updated
- 2026-11-02
NVD
9.8
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.
- Record
CVE-2023-24531- CVSS 3.1
- 9.8 Critical
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H - Updated
- 2026-11-02
OSVBELL-CVE-2023-24531
9.8
CVE-2023-24531 does not affect BellSoft software
- Record
BELL-CVE-2023-24531- CVSS 3.1
- 9.8 Critical
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H - Updated
- 2026-11-02
OSVDEBIAN-CVE-2023-24531
9.8
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.
- Record
DEBIAN-CVE-2023-24531- CVSS 3.1
- 9.8 Critical
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H - Updated
- 2026-11-02
Show 11 moreShow less
OSVUBUNTU-CVE-2023-24531
9.8
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.
- Record
UBUNTU-CVE-2023-24531- CVSS 3.1
- 9.8 Critical
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H - Updated
- 2026-11-02
OSVAZL-43104 No score
CVE-2023-24531 affecting package msft-golang for versions less than 1.21.0-1
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.
- Record
AZL-43104- Updated
- 2026-11-02
OSVAZL-43110 No score
CVE-2023-24531 affecting package golang for versions less than 1.21.0-1
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.
- Record
AZL-43110- Updated
- 2026-11-02
OSVAZL-52719 No score
CVE-2023-24531 affecting package golang for versions less than 1.21.0-1
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.
- Record
AZL-52719- Updated
- 2026-11-02
OSVAZL-79036 No score
CVE-2023-24531 affecting package golang 1.26.10-1
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.
- Record
AZL-79036- Updated
- 2026-11-02
OSVAZL-98667 No score
CVE-2023-24531 affecting package golang 1.27.1-1
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.
- Record
AZL-98667- Updated
- 2026-11-02
OSVBIT-golang-2023-24531 No score
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.
- Record
BIT-golang-2023-24531- Updated
- 2026-11-02
OSV No score
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.
- Record
CVE-2023-24531- Updated
- 2026-11-02
OSVGO-2024-2962 No score
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.
- Record
GO-2024-2962- Updated
- 2026-11-02
OSVUSN-7061-1 No score
golang-1.17 vulnerabilities
Hunter Wittenborn discovered that Go incorrectly handled the sanitization of environment variables. An attacker could possibly use this issue to run arbitrary commands. (CVE-2023-24531)
Sohom Datta discovered that Go did not properly validate backticks (`) as Javascript string delimiters, and did not escape them as expected. An attacker could possibly use this issue to inject arbitrary Javascript code into the Go template. (CVE-2023-24538)
Juho Nurminen discovered that Go incorrectly handled certain special characters in directory or file paths. An attacker could possibly use this issue to inject code into the resulting binaries. (CVE-2023-29402)
Vincent Dehors discovered that Go incorrectly handled permission bits. An attacker could possibly use this issue to read or write files with elevated privileges. (CVE-2023-29403)
Juho Nurminen discovered that Go incorrectly handled certain crafted arguments. An attacker could possibly use this issue to execute arbitrary code at build time. (CVE-2023-29405)
It was discovered that Go incorrectly validated the contents of host headers. A remote attacker could possibly use this issue to inject additional headers or entire requests. (CVE-2023-29406)
Takeshi Kaneko discovered that Go did not properly handle comments and special tags in the script context of html/template module. An attacker could possibly use this issue to inject Javascript code and perform a cross-site scripting attack. (CVE-2023-39318, CVE-2023-39319)
It was discovered that Go did not limit the number of simultaneously executing handler goroutines in the net/http module. An attacker could possibly use this issue to cause a panic resulting in a denial of service. (CVE-2023-39325)
It was discovered that the Go html/template module did not validate errors returned from MarshalJSON methods. An attacker could possibly use this issue to inject arbitrary code into the Go template. (CVE-2024-24785)
- Record
USN-7061-1- Updated
- 2026-11-02
OSVUSN-7109-1 No score
golang-1.18 vulnerabilities
Philippe Antoine discovered that Go incorrectly handled crafted HTTP/2 streams. An attacker could possibly use this issue to cause a denial of service. (CVE-2022-41723)
Marten Seemann discovered that Go did not properly manage memory under certain circumstances. An attacker could possibly use this issue to cause a panic resulting in a denial of service. (CVE-2022-41724)
Ameya Darshan and Jakob Ackermann discovered that Go did not properly validate the amount of memory and disk files ReadForm can consume. An attacker could possibly use this issue to cause a panic resulting in a denial of service. (CVE-2022-41725)
Hunter Wittenborn discovered that Go incorrectly handled the sanitization of environment variables. An attacker could possibly use this issue to run arbitrary commands. (CVE-2023-24531)
Jakob Ackermann discovered that Go incorrectly handled multipart forms. An attacker could possibly use this issue to consume an excessive amount of resources, resulting in a denial of service. (CVE-2023-24536)
Juho Nurminen discovered that Go incorrectly handled certain special characters in directory or file paths. An attacker could possibly use this issue to inject code into the resulting binaries. (CVE-2023-29402)
Vincent Dehors discovered that Go incorrectly handled permission bits. An attacker could possibly use this issue to read or write files with elevated privileges. (CVE-2023-29403)
Juho Nurminen discovered that Go incorrectly handled certain compiler directives. An attacker could possibly use this issue to execute arbitrary code. (CVE-2023-29404)
Juho Nurminen discovered that Go incorrectly handled certain crafted arguments. An attacker could possibly use this issue to execute arbitrary code at build time. (CVE-2023-29405)
Bartek Nowotarski discovered that Go incorrectly validated the contents of host headers. A remote attacker could possibly use this issue to inject additional headers or entire requests. (CVE-2023-29406)
Takeshi Kaneko discovered that Go did not properly handle comments and special tags in the script context of html/template module. An attacker could possibly use this issue to inject Javascript code and perform a cross-site scripting attack. (CVE-2023-39318, CVE-2023-39319)
It was discovered that Go did not properly validate the "//go:cgo_" directives during compilation. An attacker could possibly use this issue to inject arbitrary code during compile time. (CVE-2023-39323)
It was discovered that Go did not limit the number of simultaneously executing handler goroutines in the net/http module. An attacker could possibly use this issue to cause a panic resulting in a denial of service. (CVE-2023-39325)
Bartek Nowotarski was discovered that the Go net/http module did not properly handle the requests when request's headers exceed MaxHeaderBytes. An attacker could possibly use this issue to cause a panic resulting into a denial of service. (CVE-2023-45288)
Bartek Nowotarski discovered that the Go net/http module did not properly validate the total size of the parsed form when parsing a multipart form. An attacker could possibly use this issue to cause a panic resulting into a denial of service. (CVE-2023-45290)
John Howard discovered that the Go crypto/x509 module did not properly handle a certificate chain which contains a certificate with an unknown public key algorithm. An attacker could possibly use this issue to cause a panic resulting into a denial of service. (CVE-2024-24783)
Juho Nurminen discovered that the Go net/mail module did not properly handle comments within display names in the ParseAddressList function. An attacker could possibly use this issue to cause a panic resulting into a denial of service. (CVE-2024-24784)
It was discovered that the Go html/template module did not validate errors returned from MarshalJSON methods. An attacker could possibly use this issue to inject arbitrary code into the Go template. (CVE-2024-24785)
Yufan You discovered that the Go archive/zip module…
- Record
USN-7109-1- Updated
- 2026-11-02
Affected products
Affected packages
| Package | Affected | Fixed |
|---|---|---|
msft-golangAzure Linux:2 |
before 1.21.0-1 | 1.21.0-1 |
golangAzure Linux:2 |
1.19.0 up to 1.21.0-1 | 1.21.0-1 |
golangAzure Linux:3 |
before 1.21.0-1 | 1.21.0-1 |
golangAzure Linux:3 |
through 1.26.10-1 | None known |
golangAzure Linux:3 |
1.27.0 to 1.27.1-1 | None known |
golangBitnami |
before 1.21.0-0 | 1.21.0-0 |
golang-1.19Debian:12 |
All versions, plus listed versions 1.19.10-11.19.10-21.19.11-11.19.12-11.19.12-2 Show 7 moreShow less1.19.12-2~bpo11+11.19.12-2~bpo12+11.19.13-11.19.13-1~bpo11+11.19.13-1~bpo12+11.19.8-21.19.9-1 |
None known |
toolchainGo |
before 1.21.0-0 | 1.21.0-0 |
golang-1.10Ubuntu:14.04:LTS |
All versions, plus listed versions 1.10.4-2ubuntu1~14.04.1 |
None known |
golang-1.18Ubuntu:Pro:16.04:LTS |
before 1.18.1-1ubuntu1~16.04.6+esm1, plus listed versions 1.18.1-1ubuntu1~16.04.6 |
1.18.1-1ubuntu1~16.04.6+esm1 |
Show 21 moreShow less
| Package | Affected | Fixed |
|---|---|---|
golang-1.10Ubuntu:16.04:LTS |
All versions, plus listed versions 1.10.4-2ubuntu1~16.04.11.10.4-2ubuntu1~16.04.2 |
None known |
golang-1.6Ubuntu:16.04:LTS |
All versions, plus listed versions 1.6-0ubuntu11.6-0ubuntu21.6-0ubuntu31.6-0ubuntu41.6-0ubuntu5 Show 5 moreShow less1.6.1-0ubuntu11.6.2-0ubuntu5~16.041.6.2-0ubuntu5~16.04.21.6.2-0ubuntu5~16.04.31.6.2-0ubuntu5~16.04.4 |
None known |
golang-1.13Ubuntu:Pro:16.04:LTS |
All versions, plus listed versions 1.13.8-1ubuntu1~16.04.21.13.8-1ubuntu1~16.04.31.13.8-1ubuntu1~16.04.3+esm21.13.8-1ubuntu1~16.04.3+esm3 |
None known |
golang-1.10Ubuntu:18.04:LTS |
All versions, plus listed versions 1.10~rc1-11.10~rc1-1ubuntu11.10~rc1-2ubuntu11.10~rc2-1ubuntu11.10-1ubuntu11.10.1-1ubuntu21.10.4-2ubuntu1~18.04.11.10.4-2ubuntu1~18.04.2 |
None known |
golang-1.13Ubuntu:Pro:18.04:LTS |
All versions, plus listed versions 1.13.8-1ubuntu1~18.04.21.13.8-1ubuntu1~18.04.31.13.8-1ubuntu1~18.04.41.13.8-1ubuntu1~18.04.4+esm1 |
None known |
golang-1.16Ubuntu:Pro:18.04:LTS |
All versions, plus listed versions 1.16.2-0ubuntu1~18.04.21.16.2-0ubuntu1~18.04.2+esm1 |
None known |
golang-1.18Ubuntu:Pro:18.04:LTS |
before 1.18.1-1ubuntu1~18.04.4+esm1, plus listed versions 1.18.1-1ubuntu1~18.04.31.18.1-1ubuntu1~18.04.4 |
1.18.1-1ubuntu1~18.04.4+esm1 |
golang-1.8Ubuntu:18.04:LTS |
All versions, plus listed versions 1.8.3-2ubuntu11.8.3-2ubuntu1.18.04.1 |
None known |
golang-1.9Ubuntu:18.04:LTS |
All versions, plus listed versions 1.9.1-2ubuntu11.9.2-1ubuntu11.9.2-3ubuntu11.9.3-1ubuntu11.9.4-1ubuntu1 |
None known |
golang-1.18Ubuntu:20.04:LTS |
before 1.18.1-1ubuntu1~20.04.3, plus listed versions 1.18.1-1ubuntu1~20.04.11.18.1-1ubuntu1~20.04.2 |
1.18.1-1ubuntu1~20.04.3 |
golang-1.13Ubuntu:20.04:LTS |
All versions, plus listed versions 1.13.1-1ubuntu11.13.3-1ubuntu11.13.4-1ubuntu11.13.5-1ubuntu11.13.6-1ubuntu1 Show 5 moreShow less1.13.6-2ubuntu11.13.7-1ubuntu11.13.8-1ubuntu11.13.8-1ubuntu1.11.13.8-1ubuntu1.2 |
None known |
golang-1.14Ubuntu:20.04:LTS |
All versions, plus listed versions 1.14~beta1-11.14~beta1-21.14~rc1-11.14-11.14.1-1 Show 4 moreShow less1.14.2-11.14.2-1ubuntu11.14.3-2ubuntu2~20.04.11.14.3-2ubuntu2~20.04.2 |
None known |
golang-1.16Ubuntu:Pro:20.04:LTS |
All versions, plus listed versions 1.16.2-0ubuntu1~20.041.16.2-0ubuntu1~20.04.11.16.2-0ubuntu1~20.04.1+esm1 |
None known |
golang-1.20Ubuntu:20.04:LTS |
All versions, plus listed versions 1.20.3-1ubuntu0.1~20.041.20.3-1ubuntu0.1~20.04.1 |
None known |
golang-1.21Ubuntu:20.04:LTS |
All versions, plus listed versions 1.21.1-1~ubuntu20.04.11.21.1-1~ubuntu20.04.21.21.1-1~ubuntu20.04.3 |
None known |
golang-1.17Ubuntu:22.04:LTS |
before 1.17.13-3ubuntu1.2, plus listed versions 1.17-1ubuntu21.17.3-1ubuntu11.17.3-1ubuntu21.17.13-3ubuntu1 |
1.17.13-3ubuntu1.2 |
golang-1.18Ubuntu:22.04:LTS |
before 1.18.1-1ubuntu1.2, plus listed versions 1.18~beta1-0ubuntu11.18~beta2-1ubuntu11.18~beta2-1ubuntu21.18~rc1-1ubuntu11.18-1ubuntu11.18.1-1ubuntu11.18.1-1ubuntu1.1 |
1.18.1-1ubuntu1.2 |
golang-1.20Ubuntu:22.04:LTS |
All versions, plus listed versions 1.20.3-1ubuntu0.1~22.041.20.3-1ubuntu0.1~22.04.1 |
None known |
golang-1.21Ubuntu:22.04:LTS |
All versions, plus listed versions 1.21.1-1~ubuntu22.04.11.21.1-1~ubuntu22.04.21.21.1-1~ubuntu22.04.31.21.1-1~ubuntu22.04.4 |
None known |
golang-1.13Ubuntu:Pro:22.04:LTS |
All versions, plus listed versions 1.13.8-1ubuntu21.13.8-1ubuntu2.22.04.11.13.8-1ubuntu2.22.04.1+esm11.13.8-1ubuntu2.22.04.2 |
None known |
golang-1.21Ubuntu:24.04:LTS |
All versions, plus listed versions 1.21.1-11.21.3-11.21.4-11.21.5-11.21.6-1 Show 6 moreShow less1.21.7-11.21.7-21.21.8-11.21.8-1build11.21.9-11.21.9-1ubuntu0.1 |
None known |
History
| Recorded | Changed | Sources |
|---|---|---|
| first indexed | CVE List, EUVD, GitHub Advisories, NVD, OSV |
Dates are when Every CVE recorded each change. Upstream dates may differ.
In short
CVE-2023-24531 is a critical vulnerability (CVSS 9.8) in Go Toolchain Cmd/go, published July 2, 2024. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 0.84%, the 57th percentile. Fixed in msft-golang 1.21.0-1.
References
go.dev/cl/488375
go.dev/cl/493535
go.dev/issue/58508
groups.google.com/g/golang-dev/c/ixHOFpSbajE/m/8EjlbKVWAwAJ
pkg.go.dev/vuln/GO-2024-2962
security.netapp.com/advisory/ntap-20250328-0005
Show 33 moreShow less
nvd.nist.gov/vuln/detail/CVE-2023-24531
github.com/advisories/GHSA-cwpg-qgc6-jxvq
docs.bell-sw.com/security/cves/CVE-2023-24531
security-tracker.debian.org/tracker/CVE-2023-24531
ubuntu.com/security/CVE-2023-24531
cve.org/CVERecord?id=CVE-2023-24531
ubuntu.com/security/notices/USN-7061-1
ubuntu.com/security/notices/USN-7109-1
ubuntu.com/security/CVE-2023-24538
ubuntu.com/security/CVE-2023-29402
ubuntu.com/security/CVE-2023-29403
ubuntu.com/security/CVE-2023-29404
ubuntu.com/security/CVE-2023-29405
ubuntu.com/security/CVE-2023-29406
ubuntu.com/security/CVE-2023-39318
ubuntu.com/security/CVE-2023-39319
ubuntu.com/security/CVE-2023-39325
ubuntu.com/security/CVE-2024-24785
ubuntu.com/security/CVE-2022-41723
ubuntu.com/security/CVE-2022-41724
ubuntu.com/security/CVE-2022-41725
ubuntu.com/security/CVE-2023-24536
ubuntu.com/security/CVE-2023-39323
ubuntu.com/security/CVE-2023-45288
ubuntu.com/security/CVE-2023-45290
ubuntu.com/security/CVE-2024-24783
ubuntu.com/security/CVE-2024-24784
ubuntu.com/security/CVE-2024-24789
ubuntu.com/security/CVE-2024-24790
ubuntu.com/security/CVE-2024-24791
ubuntu.com/security/CVE-2024-34155
ubuntu.com/security/CVE-2024-34156
ubuntu.com/security/CVE-2024-34158
Left out here: the rest of 1 source description. The JSON record has them.