Track vulnerabilities like this one. Sign up free to get alerted when software you use is affected.
9.8

CVE-2021-45707: nix library can write past memory with many user groups

CVE-2021-45707 · published 4 years ago
Summary

The nix library that many Rust applications rely on can write data outside its allowed space when a user is a member of more than sixteen groups listed in the system’s group file. This may cause the program to stop working or be exploited. Update the library to the latest version (0.20.2 or newer) to resolve the problem.

What to do
  • Update carllerche nix to version 0.21.2.
  • Update carllerche nix to version 0.22.2.
  • Update carllerche nix to version 0.20.2.
Affected software
Ecosystem VendorProductAffected versions
rust carllerche nix >= 0.21.0, < 0.21.2
>= 0.22.0, < 0.22.2
>= 0.16.0, < 0.20.2
Fix: upgrade to 0.21.2
– nix_project nix >= 0.16.0, < 0.20.2
>= 0.21.0, < 0.21.2
>= 0.22.0, < 0.22.2
cpe:2.3:a:nix_project:nix:*:*:*:*:*:rust:*:*
Ubuntu:20.04:LTS canonical rust-nix All versions
Original advisory text
Out-of-bounds write in nix::unistd::getgrouplist
An issue was discovered in the nix crate 0.16.0 and later before 0.20.2, 0.21.x before 0.21.2, and 0.22.x before 0.22.2 for Rust. unistd::getgrouplist has an out-of-bounds write if a user is in more than 16 /etc/groups groups.
Fix within
Internet-facing 14 days
Internal At next upgrade
  • Not known to be exploited
  • Needs hands-on effort to exploit (estimated)
  • Gives an attacker full control (estimated)
Severity
9.8 Critical
Exploitation
2% chance of attack within 30 days
Type
CWE-787Out-of-bounds Write
Timeline
Published27 Dec 2021
Updated4 Nov 2026
First seen6 Mar 2026
Track software like this
Free during beta