-
Notifications
You must be signed in to change notification settings - Fork 18.8k
Description
CL 446915 fixes a security vulnerability on Windows (#56284), by rejecting environment variables containing NUL in os/exec.Cmd. In Plan 9, NULs in environment variables are not only permitted but required: the path variable uses NUL as the os.PathListSeparator character. Since the environment almost always contains path, this effectively breaks os/exec, on which go build depends.
The change has already been back-ported to 1.19.3 and 1.18.8, so those releases also won't build for Plan 9.
Plan 9 does not exhibit the vulnerability to NULs because it implements environment variables in a completely different way.
Therefore we could safely correct this issue by making the rejection of NUL conditional on runtime.GOOS != "plan9" or on os.PathListSeparator != '\000'.