Skip to content
Heist/ feed
Back to feed
Critical

rust-nix — security advisory

Type: advisorySources: OSVAdvisory ID: UBUNTU-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. unistd::getgrouplist has an out-of-bounds write if a user is in more than 16 /etc/groups groups.

Products
rust-nix
Affected versions
0.14.1-1, 0.15.0-1, 0.15.0-2, 0.16.1-1, 0.19.0-1, 0.19.0-2, 0.23.1-1, 0.26.2-1, 0.27.1-1, 0.27.1-1build1, 0.29.0-2, 0.30.1-3
Fixed versions
Not specified
CVEs
CVE-2021-45707
Confirmed fixed CVEs
Not specified
Updated in this feed
31 Oct 2026, 00:35 UTC · Revision 1

Source evidence

UBUNTU-CVE-2021-45707

core-osv · Original source

Published 27 Dec 2021, 00:15 UTC

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.

osv:UBUNTU-CVE-2021-45707

rust-nix

Fixed versions: Not specified

rust-nix

Fixed versions: Not specified

rust-nix

Fixed versions: Not specified

rust-nix

Fixed versions: Not specified

rust-nix

Fixed versions: Not specified

rust-nix

Fixed versions: Not specified

Complete source record
{
  "id": "256374fd2d0ac7b42b0fc337f2fe5a69b85b593fed2b8f994d3f6279254b5e92",
  "url": "https://osv.dev/vulnerability/UBUNTU-CVE-2021-45707",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "UBUNTU-CVE-2021-45707",
    "summary": "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.",
    "evidence": "osv:UBUNTU-CVE-2021-45707",
    "products": [
      {
        "name": {
          "value": "rust-nix",
          "evidence": "/affected/0/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [],
        "affected_versions": [
          {
            "value": "0.14.1-1",
            "evidence": "/affected/0/versions"
          },
          {
            "value": "0.15.0-1",
            "evidence": "/affected/0/versions"
          },
          {
            "value": "0.15.0-2",
            "evidence": "/affected/0/versions"
          },
          {
            "value": "0.16.1-1",
            "evidence": "/affected/0/versions"
          }
        ]
      },
      {
        "name": {
          "value": "rust-nix",
          "evidence": "/affected/1/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [],
        "affected_versions": [
          {
            "value": "0.19.0-1",
            "evidence": "/affected/1/versions"
          },
          {
            "value": "0.19.0-2",
            "evidence": "/affected/1/versions"
          },
          {
            "value": "0.23.1-1",
            "evidence": "/affected/1/versions"
          }
        ]
      },
      {
        "name": {
          "value": "rust-nix",
          "evidence": "/affected/2/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [],
        "affected_versions": [
          {
            "value": "0.26.2-1",
            "evidence": "/affected/2/versions"
          },
          {
            "value": "0.27.1-1",
            "evidence": "/affected/2/versions"
          },
          {
            "value": "0.27.1-1build1",
            "evidence": "/affected/2/versions"
          }
        ]
      },
      {
        "name": {
          "value": "rust-nix",
          "evidence": "/affected/3/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [],
        "affected_versions": [
          {
            "value": "0.29.0-2",
            "evidence": "/affected/3/versions"
          }
        ]
      },
      {
        "name": {
          "value": "rust-nix",
          "evidence": "/affected/4/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [],
        "affected_versions": [
          {
            "value": "0.30.1-3",
            "evidence": "/affected/4/versions"
          }
        ]
      },
      {
        "name": {
          "value": "rust-nix",
          "evidence": "/affected/5/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [],
        "affected_versions": [
          {
            "value": "0.29.0-2",
            "evidence": "/affected/5/versions"
          },
          {
            "value": "0.30.1-3",
            "evidence": "/affected/5/versions"
          }
        ]
      }
    ],
    "severity": "critical",
    "structured": {
      "id": "UBUNTU-CVE-2021-45707",
      "aliases": [
        "UBUNTU-CVE-2021-45707"
      ],
      "metrics": [
        {
          "type": "CVSS_V3",
          "score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H"
        },
        {
          "type": "Ubuntu",
          "score": "medium"
        }
      ],
      "affected": [
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                }
              ]
            }
          ],
          "package": {
            "name": "rust-nix",
            "purl": "pkg:deb/ubuntu/rust-nix?arch=source&distro=focal",
            "ecosystem": "Ubuntu:20.04:LTS"
          },
          "versions": [
            "0.14.1-1",
            "0.15.0-1",
            "0.15.0-2",
            "0.16.1-1"
          ],
          "database_specific": {
            "source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2021/UBUNTU-CVE-2021-45707.json"
          },
          "ecosystem_specific": {
            "binaries": [
              {
                "binary_name": "librust-nix-dev",
                "binary_version": "0.16.1-1"
              }
            ]
          }
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                }
              ]
            }
          ],
          "package": {
            "name": "rust-nix",
            "purl": "pkg:deb/ubuntu/rust-nix?arch=source&distro=jammy",
            "ecosystem": "Ubuntu:22.04:LTS"
          },
          "versions": [
            "0.19.0-1",
            "0.19.0-2",
            "0.23.1-1"
          ],
          "database_specific": {
            "source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2021/UBUNTU-CVE-2021-45707.json"
          },
          "ecosystem_specific": {
            "binaries": [
              {
                "binary_name": "librust-nix-dev",
                "binary_version": "0.23.1-1"
              }
            ]
          }
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                }
              ]
            }
          ],
          "package": {
            "name": "rust-nix",
            "purl": "pkg:deb/ubuntu/rust-nix?arch=source&distro=noble",
            "ecosystem": "Ubuntu:24.04:LTS"
          },
          "versions": [
            "0.26.2-1",
            "0.27.1-1",
            "0.27.1-1build1"
          ],
          "database_specific": {
            "source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2021/UBUNTU-CVE-2021-45707.json"
          },
          "ecosystem_specific": {
            "binaries": [
              {
                "binary_name": "librust-nix-dev",
                "binary_version": "0.27.1-1build1"
              }
            ]
          }
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                }
              ]
            }
          ],
          "package": {
            "name": "rust-nix",
            "purl": "pkg:deb/ubuntu/rust-nix?arch=source&distro=questing",
            "ecosystem": "Ubuntu:25.10"
          },
          "versions": [
            "0.29.0-2"
          ],
          "database_specific": {
            "source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2021/UBUNTU-CVE-2021-45707.json"
          },
          "ecosystem_specific": {
            "binaries": [
              {
                "binary_name": "librust-nix-dev",
                "binary_version": "0.29.0-2"
              }
            ]
          }
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                }
              ]
            }
          ],
          "package": {
            "name": "rust-nix",
            "purl": "pkg:deb/ubuntu/rust-nix?arch=source&distro=stonking",
            "ecosystem": "Ubuntu:26.10"
          },
          "versions": [
            "0.30.1-3"
          ],
          "database_specific": {
            "source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2021/UBUNTU-CVE-2021-45707.json"
          },
          "ecosystem_specific": {
            "binaries": [
              {
                "binary_name": "librust-nix-dev",
                "binary_version": "0.30.1-3"
              }
            ]
          }
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                }
              ]
            }
          ],
          "package": {
            "name": "rust-nix",
            "purl": "pkg:deb/ubuntu/rust-nix?arch=source&distro=resolute",
            "ecosystem": "Ubuntu:26.04:LTS"
          },
          "versions": [
            "0.29.0-2",
            "0.30.1-3"
          ],
          "database_specific": {
            "source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2021/UBUNTU-CVE-2021-45707.json"
          },
          "ecosystem_specific": {
            "binaries": [
              {
                "binary_name": "librust-nix-dev",
                "binary_version": "0.30.1-3"
              }
            ]
          }
        }
      ],
      "modified": "2026-10-17T12:55:47.838993147Z",
      "provider": "osv",
      "upstream": [
        "CVE-2021-45707"
      ],
      "references": [
        "https://ubuntu.com/security/CVE-2021-45707",
        "https://rustsec.org/advisories/RUSTSEC-2021-0119.html",
        "https://raw.githubusercontent.com/rustsec/advisory-db/main/crates/nix/RUSTSEC-2021-0119.md",
        "https://www.cve.org/CVERecord?id=CVE-2021-45707"
      ]
    },
    "related_cves": [
      {
        "value": "CVE-2021-45707",
        "evidence": "/upstream"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/severity/0/score"
  },
  "source_id": "core-osv",
  "document_id": 354103,
  "published_at": "2021-12-27T00:15:00+00:00"
}