ADVISORIES

Go Vulnerability Database

GO-2022-1095

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".

Affected packages

EcosystemPackageAffected versions
Gostdlib
All versions before 1.18.8 (fixed in 1.18.8)
From 1.19.0-0 before 1.19.3 (fixed in 1.19.3)

References