GO-2022-1095

Source
https://pkg.go.dev/vuln/GO-2022-1095
Import Source
https://vuln.go.dev/ID/GO-2022-1095.json
JSON Data
https://api.osv.dev/v1/vulns/GO-2022-1095
Aliases
Published
2022-11-01T23:55:57Z
Modified
2024-05-20T16:03:47Z
Summary
Unsanitized NUL in environment variables on Windows in syscall and os/exec
Details

Due to unsanitized NUL values, attackers may be able to maliciously set environment variables on Windows.

In syscall.StartProcess and os/exec.Cmd, invalid environment variable values containing NUL values are not properly checked for. A malicious environment variable value can exploit this behavior to set a value for a different environment variable. For example, the environment variable string "A=B\x00C=D" sets the variables "A=B" and "C=D".

References
Credits
    • RyotaK (https://twitter.com/ryotkak)

Affected packages

Go / stdlib

Package

Affected ranges

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

Ecosystem specific

{
    "imports": [
        {
            "path": "syscall",
            "symbols": [
                "StartProcess"
            ],
            "goos": [
                "windows"
            ]
        },
        {
            "path": "os/exec",
            "symbols": [
                "Cmd.CombinedOutput",
                "Cmd.Environ",
                "Cmd.Output",
                "Cmd.Run",
                "Cmd.Start",
                "Cmd.environ",
                "dedupEnv",
                "dedupEnvCase"
            ],
            "goos": [
                "windows"
            ]
        }
    ]
}