GO-2024-2962

Source
https://pkg.go.dev/vuln/GO-2024-2962
Import Source
https://vuln.go.dev/ID/GO-2024-2962.json
JSON Data
https://api.osv.dev/v1/vulns/GO-2024-2962
Aliases
Published
2024-07-02T19:27:52Z
Modified
2024-07-04T08:12:34.816755Z
Summary
Output of "go env" does not sanitize values in cmd/go
Details

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.

References
Credits
    • Hunter Wittenborn (https://hunterwittenborn.com/)

Affected packages

Go / toolchain

Package

Affected ranges

Type
SEMVER
Events
Introduced
0Unknown introduced version / All previous versions are affected
Fixed
1.21.0-0

Ecosystem specific

{
    "imports": [
        {
            "path": "cmd/go"
        }
    ]
}