# CVE-2021-45707: Out-of-bounds Write in nix

- Severity: Critical 9.8 (CVSS:3.1, scored by NVD) `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 1.69%, higher than 78% of CVEs (2026-11-30)
- Published: 2021-09-27T12:00:00.000Z
- Modified: 2026-09-10T03:49:44.230Z
- Also known as: GHSA-76w9-p8mg-j927, GHSA-wgrg-5h56-jg27, RUSTSEC-2021-0119
- Weaknesses: CWE-787
- Assigned by: mitre

## Description

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.

(As written by CVE List.)

## Affected

- Unspecified product: n/a
- nix (crates.io): from 0.16.0 before 0.20.2; from 0.21.0 before 0.21.2; from 0.22.0 before 0.22.2; from 0.21.0-0 before 0.21.2; from 0.22.0-0 before 0.22.2; from 0.23.0-0 before 0.23.0
- nix_project nix: from 0.16.0 before 0.20.2; from 0.21.0 before 0.21.2; from 0.22.0 before 0.22.2

## Every score

- GitHub: CVSS:3.1 6.7 Medium `CVSS:3.1/AV:L/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H`
- GitHub: rating High
- NVD: CVSS:3.1 9.8 Critical `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H`
- NVD: CVSS:2.0 7.5 High `AV:N/AC:L/Au:N/C:P/I:P/A:P`

## References

- <https://rustsec.org/advisories/RUSTSEC-2021-0119.html> (advisory, issue-tracking, third-party-advisory, web)
- <https://raw.githubusercontent.com/rustsec/advisory-db/main/crates/nix/RUSTSEC-2021-0119.md> (third-party-advisory, web)
- <https://github.com/advisories/GHSA-wgrg-5h56-jg27> (advisory, third-party-advisory)
- <https://nvd.nist.gov/vuln/detail/CVE-2021-45707> (advisory)
- <https://github.com/nix-rust/nix/issues/1541> (report, web)
- <https://github.com/nix-rust/nix> (package)
- <https://crates.io/crates/nix> (package)

## Sources

- CVE List: [CVE-2021-45707](https://www.cve.org/CVERecord?id=CVE-2021-45707), CVE Terms of Use, modified 2024-08-04
- GitHub Advisory Database: [GHSA-76w9-p8mg-j927](https://github.com/advisories/GHSA-76w9-p8mg-j927), CC-BY-4.0, modified 2026-09-10
- GitHub Advisory Database: [GHSA-wgrg-5h56-jg27](https://github.com/advisories/GHSA-wgrg-5h56-jg27), CC-BY-4.0, modified 2026-09-10
- RustSec Advisory Database: [RUSTSEC-2021-0119](https://rustsec.org/advisories/RUSTSEC-2021-0119.html), CC0-1.0, modified 2023-11-08
- NVD: [CVE-2021-45707](https://nvd.nist.gov/vuln/detail/CVE-2021-45707), Public domain, modified 2026-06-17

---

Page: https://cve.day/CVE-2021-45707 · Whole record: https://cve.day/CVE-2021-45707.json · Rebuilt by cve.day 2026-11-25T22:58:06.271Z
