CVE-2021-45707Nix Project Nix
Critical 9.8 No auth needed
Follow: this CVE · Nix Project · Nix Project Nix We alert you by email or Slack (account required).
- Priority
- 74
- CVSS 3.1
- 9.8
- EPSS
- 1.7% probability of exploitation in 30 days · percentile 78
- Auth required
- No
- Published
- Dec 27, 2021
- Updated
- Jun 17, 2026
- Category
- Application · Cross-platform
- Weakness (CWE)
- CWE-787
- Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
What happens
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.
What to do
- Apply the vendor's security update for Nix.
- It can be exploited without authentication: if you cannot patch now, restrict Internet access to the affected service.
Affected packages
| Ecosystem | Package | Affected versions | Fixed in | How to upgrade |
|---|---|---|---|---|
| crates.io | nix |
≥ 0.16.0 < 0.20.2 |
0.20.2 |
cargo update -p nix --precise 0.20.2 |
| crates.io | nix |
≥ 0.21.0 < 0.21.2 |
0.21.2 |
cargo update -p nix --precise 0.21.2 |
| crates.io | nix |
≥ 0.22.0 < 0.22.2 |
0.22.2 |
cargo update -p nix --precise 0.22.2 |
| crates.io | nix |
≥ 0.16.0 < 0.20.2 |
0.20.2 |
cargo update -p nix --precise 0.20.2 |
| crates.io | nix |
≥ 0.21.0 < 0.21.2 |
0.21.2 |
cargo update -p nix --precise 0.21.2 |
| crates.io | nix |
≥ 0.22.0 < 0.22.2 |
0.22.2 |
cargo update -p nix --precise 0.22.2 |
| crates.io | nix |
≥ 0.16.0 < 0.20.2 |
0.20.2 |
cargo update -p nix --precise 0.20.2 |
| crates.io | nix |
≥ 0.21.0-0 < 0.21.2 |
0.21.2 |
cargo update -p nix --precise 0.21.2 |
| crates.io | nix |
≥ 0.22.0-0 < 0.22.2 |
0.22.2 |
cargo update -p nix --precise 0.22.2 |
| crates.io | nix |
≥ 0.23.0-0 < 0.23.0 |
0.23.0 |
cargo update -p nix --precise 0.23.0 |
Per OSV / GitHub Advisories (GHSA-76w9-p8mg-j927, GHSA-wgrg-5h56-jg27, RUSTSEC-2021-0119). Check the version in your lockfile before upgrading.
Affected products (CPE)
| Vendor | Product | Versions |
|---|---|---|
| nix_project | nix | ≥ 0.16.0 < 0.20.2 |
| nix_project | nix | ≥ 0.21.0 < 0.21.2 |
| nix_project | nix | ≥ 0.22.0 < 0.22.2 |
Official sources
References
Links published by the sources. Open them with care.
- github.com Third Party Advisory
- raw.githubusercontent.com Third Party Advisory
- rustsec.org Issue Tracking Third Party Advisory