Skip to content

← Public intelligence

crates.io package

nix

Open actionable advisories and recorded vendor fixes. This public package view has no inventory attached and cannot establish whether your deployment is affected. A vendor fix never resolves your finding; verify your installed version and the source guidance.

Open advisories

2 actionable advisories, newest first. Withdrawn advisories and news are excluded. Coverage is partial.

  1. Unratedcrates.ioPublished

    Out-of-bounds write in nix::unistd::getgrouplist

    GHSA-wgrg-5h56-jg27

    Affected
    • crates.io nix >= 0.16.0, < 0.20.2; >= 0.21.0, < 0.21.2; >= 0.22.0, < 0.22.2
    Fixed in
    0.20.20.22.20.21.2· Vendor fix available
    Issue
    On certain platforms, if a user has more than 16 groups, the nix::unistd::getgrouplist function will call the libc getgrouplist function with a length parameter greater than the size of the buffer it provides, resulting in an out-of-bounds write and memory corruption. The libc getgrouplist function takes an in/out parameter ngroups specifying the size of the group buffer. When the buffer is too small to hold all of the reqested user's group memberships, some libc implementations, including glibc and Solaris libc, will modify ngroups to indicate the actual number of groups for the user, in addition to returning an error. The version of nix::unistd::getgrouplist in nix 0.16.0 and up will resize the buffer to twice its size, but will not read or modify the ngroups variable. Thus, if the user has more than twice as many groups as the initial buffer size of 8, the next call to getgrouplist will then write past the end of the buffer. The issue would require editing /etc/groups to exploit,…

    Recommended action: Upgrade to 0.22.2, 0.21.2 or 0.20.2 by release line, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.

    Sources:github.comSource checked Evidence →
  2. Medium, CVSS 6.7crates.ioPublished

    Out-of-bounds Write in nix

    CVE-2021-45707 · GHSA-76w9-p8mg-j927

    Affected
    • crates.io nix >= 0.21.0, < 0.21.2; >= 0.22.0, < 0.22.2; >= 0.16.0, < 0.20.2
    Fixed in
    0.20.20.22.20.21.2· Vendor fix available
    Issue
    On certain platforms, if a user has more than 16 groups, the nix::unistd::getgrouplist function will call the libc getgrouplist function with a length parameter greater than the size of the buffer it provides, resulting in an out-of-bounds write and memory corruption. The libc getgrouplist function takes an in/out parameter ngroups specifying the size of the group buffer. When the buffer is too small to hold all of the requested user's group memberships, some libc implementations, including glibc and Solaris libc, will modify ngroups to indicate the actual number of groups for the user, in addition to returning an error. The version of nix::unistd::getgrouplist in nix 0.16.0 and up will resize the buffer to twice its size, but will not read or modify the ngroups variable. Thus, if the user has more than twice as many groups as the initial buffer size of 8, the next call to getgrouplist will then write past the end of the buffer. The issue would require editing /etc/groups to exploit,…

    Recommended action: Upgrade to 0.22.2, 0.21.2 or 0.20.2 by release line, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.

    Sources:github.comSource checked Evidence →