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 | Vendor | Product | Affected 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.
References
- https://nvd.nist.gov/vuln/detail/CVE-2021-45707
- https://github.com/nix-rust/nix/issues/1541
- https://github.com/advisories/GHSA-76w9-p8mg-j927
- https://github.com/nix-rust/nix Product
- https://github.com/advisories/GHSA-wgrg-5h56-jg27 Third Party Advisory
- https://ubuntu.com/security/CVE-2021-45707 Third Party Advisory
- https://rustsec.org/advisories/RUSTSEC-2021-0119.html Third Party Advisory
- https://raw.githubusercontent.com/rustsec/advisory-db/main/crates/nix/RUSTSEC-20... Third Party Advisory
- https://www.cve.org/CVERecord?id=CVE-2021-45707 Third Party Advisory
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
Type
CWE-787Out-of-bounds Write
Timeline
Published27 Dec 2021
Updated4 Nov 2026
First seen6 Mar 2026
Sources
GHSA-76w9-p8mg-j927 · GHSA
CVE-2021-45707 · NVD
GHSA-wgrg-5h56-jg27 · OSV
UBUNTU-CVE-2021-45707 · OSV
Track software like this
Free during beta