# CVE-2025-5791: Users: `root` appended to group listings

> A flaw in the Rust users crate allows privilege escalation by incorrectly appending the root group to access lists for users with fewer than 1024 groups.

- **Severity:** High 7.1 (`CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Any signed-in user
- **Attackable:** Local or same network only
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 6 Jun 2025
- **Updated:** 20 Nov 2025
- **Also known as:** AZL-63771, AZL-63848, GHSA-m65q-v92h-cm7q, RUSTSEC-2025-0040, SUSE-RU-2025:20961-1, SUSE-RU-2025:21046-1, UBUNTU-CVE-2025-5791, openSUSE-SU-2025:15246-1, openSUSE-SU-2025:15335-1, openSUSE-SU-2025:15412-1, openSUSE-SU-2025:15628-1

## What is CVE-2025-5791?

CVE-2025-5791 is a high-severity vulnerability in Red Hat Enterprise Linux 10, published on 6 Jun 2025. It can only be exploited from the same machine or local network, with no action from the victim.

### Official description

A flaw was found in the user's crate for Rust. This vulnerability allows privilege escalation via incorrect group listing when a user or process has fewer than exactly 1024 groups, leading to the erroneous inclusion of the root group in the access list.

Weakness: CWE-266 (Incorrect Privilege Assignment)

## Which versions are affected by CVE-2025-5791?

3 open source packages ship an affected version, including users.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `users` | crates.io | From 0.8.0 | None |
| `users` | crates.io | From 0.8.0 to 0.11.0 | None |
| `users` | crates.io | From 0.8.0 to 0.11.0 | None |
| `afterburn` | SUSE:Linux Micro 6.0 | All versions | 5.9.0.git21.a73f509-1.1 |
| `afterburn` | SUSE:Linux Micro 6.1 | All versions | 5.9.0.git21.a73f509-slfo.1.1_1.1 |
| `afterburn` | openSUSE:Tumbleweed | All versions | 5.8.2-3.1 |
| `agama` | openSUSE:Tumbleweed | All versions | 17+60.68fdb92ec-26.1 |
| `lsd` | openSUSE:Tumbleweed | All versions | 1.2.0-1.1 |
| `mirrorsorcerer` | openSUSE:Tumbleweed | All versions | 0.1.3~1-1.1 |

## How do I fix CVE-2025-5791?

Upgrade to a fixed version.

## Is CVE-2025-5791 being exploited?

There is no known exploitation of CVE-2025-5791 in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2025-5791 and fix it if it is affected.

What it is: CVE-2025-5791 is a high-severity vulnerability in Red Hat Enterprise Linux 10, published on 6 Jun 2025. It can only be exploited from the same machine or local network, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2025-5791 in the wild and no public exploit code.

Affected packages and fixed versions:
- users (crates.io): affected from 0.8.0; no fix listed
- users (crates.io): affected from 0.8.0 up to 0.11.0; no fix listed
- users (crates.io): affected from 0.8.0 up to 0.11.0; no fix listed

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2025-5791/ (Markdown: https://insights.sbomify.com/CVE-2025-5791/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2025-5791
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2025-5791
- OSV: https://osv.dev/vulnerability/CVE-2025-5791

---
From sbomify Insights: https://insights.sbomify.com/CVE-2025-5791/
Summaries are generated and may contain mistakes; the official description above is the record.
