diff options
| author | Damien Neil <dneil@google.com> | 2022-10-17 17:38:29 -0700 |
|---|---|---|
| committer | Matthew Dempsky <mdempsky@google.com> | 2022-11-01 16:40:37 +0000 |
| commit | 61ae0a37a8c96e2b1745594e477244100f1a7046 (patch) | |
| tree | 76f6cef73b61eec2892d239791980355ec6e6a4e /src/runtime/testdata | |
| parent | ad5d2f64fbb90dd13c4587aa5bf2ed3c86a6dec2 (diff) | |
| download | go-61ae0a37a8c96e2b1745594e477244100f1a7046.tar.xz | |
syscall, os/exec: reject environment variables containing NULs
Check for and reject environment variables containing NULs.
The conventions for passing environment variables to subprocesses
cause most or all systems to interpret a NUL as a separator. The
syscall package rejects environment variables containing a NUL
on most systems, but erroniously did not do so on Windows. This
causes an environment variable such as "FOO=a\x00BAR=b" to be
interpreted as "FOO=a", "BAR=b".
Check for and reject NULs in environment variables passed to
syscall.StartProcess on Windows.
Add a redundant check to os/exec as extra insurance.
Fixes #56284
Fixes CVE-2022-41716
Change-Id: I2950e2b0cb14ebd26e5629be1521858f66a7d4ae
Reviewed-on: https://team-review.git.corp.google.com/c/golang/go-private/+/1609434
Run-TryBot: Damien Neil <dneil@google.com>
Reviewed-by: Tatiana Bradley <tatianabradley@google.com>
Reviewed-by: Roland Shoemaker <bracewell@google.com>
TryBot-Result: Security TryBots <security-trybots@go-security-trybots.iam.gserviceaccount.com>
Reviewed-on: https://go-review.googlesource.com/c/go/+/446916
Reviewed-by: Tatiana Bradley <tatiana@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Heschi Kreinick <heschi@google.com>
Diffstat (limited to 'src/runtime/testdata')
0 files changed, 0 insertions, 0 deletions
