Skip to content

syscall, os/exec: unsanitized NUL in environment variables #56284

Closed

Description

@neild

On Windows, syscall.StartProcess and os/exec.Cmd did not properly check for invalid environment variable values. A malicious environment variable value could exploit this behavior to set a value for a different environment variable. For example, the environment variable string "A=B\x00C=D" set the variables "A=B" and "C=D".

Thanks to RyotaK (https://twitter.com/ryotkak) for reporting this issue.

This is CVE-2022-41716 and Go issue https://go.dev/issue/56284.

Activity

  1. self-assigned this
    on Oct 18, 2022
  2. heschi commented on Oct 19, 2022

    @heschi
    Contributor

    This issue is currently not marked as security or release-blocking. Should it block the next minor release?

  3. heschi commented on Oct 19, 2022

    @heschi
    Contributor

    cc @golang/security @golang/release

  4. modified the milestones: Go1.19.3, Go1.18.8, Go1.20 on Oct 19, 2022
  5. neild commented on Oct 19, 2022

    @neild
    ContributorAuthor

    @gopherbot please open backport issues

    (Sorry, I keep getting the process on this wrong. This issue is for the fix, backport issues for upcoming minor releases.)

  6. gopherbot commented on Oct 19, 2022

    @gopherbot
    Contributor

    Backport issue(s) opened: #56327 (for 1.18), #56328 (for 1.19).

    Remember to create the cherry-pick CL(s) as soon as the patch is submitted to master, according to https://go.dev/wiki/MinorReleases.

  7. gopherbot commented on Nov 1, 2022

    @gopherbot
    Contributor

    Change https://go.dev/cl/446915 mentions this issue: [release-branch.go1.18] syscall, os/exec: reject environment variables containing NULs

  8. 21 remaining items

  9. gopherbot commented on Nov 4, 2022

    @gopherbot
    Contributor

    Change https://go.dev/cl/447799 mentions this issue: [release-branch.go1.19] os/exec: allow NUL in environment variables on Plan 9

  10. assigned and unassigned on May 11, 2023
  11. added a commit that references this issue on Feb 20, 2024
    61ae0a3
  12. locked and limited conversation to collaborators on May 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions