Skip to content
Access control Write-up Advanced

CVE-2025–32463 | Exploit and Explain

A flaw in sudo's handling of the -r role option allows a local user with limited sudo permissions to bypass privilege checks and run commands as root. The exploit uses a malicious shared library loaded via nsswitch.conf inside a chroot to spawn a root shell.

medium.com

Published on medium.com

A newly discovered vulnerability, CVE-2025–32463, affects the sudo command on Linux systems.

Quyna, on medium.com

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely insufficient validation of unexpected input in the code that parses sudo's -r role option, allowing privilege checks to be bypassed.

Impact

A local attacker with some sudo permissions could escalate to root, but the demonstration is confined to a chroot and the text does not show a real-world bypass of host protections.

What the attacker needed

Local access to the system; vulnerable sudo version; user allowed to run some sudo commands

The fix

sudo should be upgraded to version 1.9.15p5 or later, where the vulnerability has been patched.

How it was found

  1. Create a malicious shared library that spawns a root shell when loaded.
  2. Compile the library and build a fake chroot environment.
  3. Overwrite nsswitch.conf to force loading of the malicious library.
  4. Copy required libraries and move the payload into the chroot.
  5. Trigger the exploit by running sudo with the -r option inside the chroot.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

sudo is a program that lets users run commands as another user, usually root (the all-powerful administrator). This bug means someone who already has a small amount of sudo access can trick sudo into giving them full root access. The proof of concept uses a fake mini-system (chroot) and a malicious library to show the root shell.

What is Access control?

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.

Similar reports

View all

Same bug class and techniques, clearest first.

Broken access control

The lesson behind this report.

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.