{"ecosystem":"cargo","package":"nix","version":null,"bugs":[{"id":887,"ecosystem":"cargo","package_name":"nix","affected_version":"0.16.0","fixed_version":"0.20.2","bug_id":"osv:GHSA-wgrg-5h56-jg27","title":"Out-of-bounds write in nix::unistd::getgrouplist","description":"On certain platforms, if a user has more than 16 groups, the\n`nix::unistd::getgrouplist` function will call the libc `getgrouplist`\nfunction with a length parameter greater than the size of the buffer it\nprovides, resulting in an out-of-bounds write and memory corruption.\n\nThe libc `getgrouplist` function takes an in/out parameter `ngroups`\nspecifying the size of the group buffer. When the buffer is too small to\nhold all of the reqested user's group memberships, some libc\nimplementations, including glibc and Solaris libc, will modify `ngroups`\nto indicate the actual number of groups for the user, in addition to\nreturning an error. The version of `nix::unistd::getgrouplist` in nix\n0.16.0 and up will resize the buffer to twice its size, but will not\nread or modify the `ngroups` variable. Thus, if the user has more than\ntwice as many groups as the initial buffer size of 8, the next call to\n`getgrouplist` will then write past the end of the buffer.\n\nThe issue would require editing /etc/groups to exploit, which is usually\nonly editable by the root user.\n","severity":"high","status":"fixed","source":"osv","source_url":"https://github.com/nix-rust/nix/issues/1541","labels":["CVE-2021-45707","GHSA-76w9-p8mg-j927","RUSTSEC-2021-0119"],"created_at":"2026-04-19T04:32:04.911207+00:00","updated_at":"2026-04-19T04:32:04.911207+00:00"},{"id":888,"ecosystem":"cargo","package_name":"nix","affected_version":"0.23.0-0","fixed_version":"0.23.0","bug_id":"osv:RUSTSEC-2021-0119","title":"Out-of-bounds write in nix::unistd::getgrouplist","description":"On certain platforms, if a user has more than 16 groups, the\n`nix::unistd::getgrouplist` function will call the libc `getgrouplist`\nfunction with a length parameter greater than the size of the buffer it\nprovides, resulting in an out-of-bounds write and memory corruption.\n\nThe libc `getgrouplist` function takes an in/out parameter `ngroups`\nspecifying the size of the group buffer. When the buffer is too small to\nhold all of the requested user's group memberships, some libc\nimplementations, including glibc and Solaris libc, will modify `ngroups`\nto indicate the actual number of groups for the user, in addition to\nreturning an error. The version of `nix::unistd::getgrouplist` in nix\n0.16.0 and up will resize the buffer to twice its size, but will not\nread or modify the `ngroups` variable. Thus, if the user has more than\ntwice as many groups as the initial buffer size of 8, the next call to\n`getgrouplist` will then write past the end of the buffer.\n\nThe issue would require editing /etc/groups to exploit, which is usually\nonly editable by the root user.","severity":"medium","status":"fixed","source":"osv","source_url":"https://crates.io/crates/nix","labels":["CVE-2021-45707","GHSA-76w9-p8mg-j927","GHSA-wgrg-5h56-jg27"],"created_at":"2026-04-19T04:32:04.911728+00:00","updated_at":"2026-04-19T04:32:04.911728+00:00"},{"id":886,"ecosystem":"cargo","package_name":"nix","affected_version":"0.16.0","fixed_version":"0.20.2","bug_id":"osv:GHSA-76w9-p8mg-j927","title":"Out-of-bounds Write in nix","description":"On certain platforms, if a user has more than 16 groups, the nix::unistd::getgrouplist function will call the libc getgrouplist function with a length parameter greater than the size of the buffer it provides, resulting in an out-of-bounds write and memory corruption.\n\nThe libc getgrouplist function takes an in/out parameter ngroups specifying the size of the group buffer. When the buffer is too small to hold all of the requested user's group memberships, some libc implementations, including glibc and Solaris libc, will modify ngroups to indicate the actual number of groups for the user, in addition to returning an error. The version of nix::unistd::getgrouplist in nix 0.16.0 and up will resize the buffer to twice its size, but will not read or modify the ngroups variable. Thus, if the user has more than twice as many groups as the initial buffer size of 8, the next call to getgrouplist will then write past the end of the buffer.\n\nThe issue would require editing /etc/groups to exploit, which is usually only editable by the root user.","severity":"medium","status":"fixed","source":"osv","source_url":"https://nvd.nist.gov/vuln/detail/CVE-2021-45707","labels":["CVE-2021-45707","GHSA-wgrg-5h56-jg27","RUSTSEC-2021-0119"],"created_at":"2026-04-19T04:32:04.910110+00:00","updated_at":"2026-04-19T04:32:04.910110+00:00"}],"total":3,"_cache":"miss"}