Skip to main content
← All vulnerabilities
CVE-2023-24531GO-2024-2962BIT-GOLANG-2023-24531

Output of "go env" does not sanitize values in cmd/go

Published
Last modified
published
Not listed in CISA KEV
Fix
Fixed in 1.21.0-0
None on Exploit-DB, Metasploit or GitHub
  • Exploitation: none
  • Automatable: yes
  • Technical impact: total

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.

Timeline

  1. CVE published
  2. CISA SSVC assessment

    Exploitation: none · Automatable: yes · Technical impact: total

  3. Record last updated

Affected versions

  • cmd/go

    fixed in 1.21.0-0

  • toolchainGo

    fixed in 1.21.0-0

References 5

go.dev

groups.google.com

pkg.go.dev