Skip to content
RCE Write-up Intermediate

CVE-2025–32463 - Local Privilege Escalation via chroot option i

A flaw in sudo's chroot option allows a local user to load an arbitrary shared library and escalate to root, even if not in the sudoers file. The attacker can trick sudo into reading a malicious nsswitch.conf from a user-controlled directory.

Lunacysoft Follow

Published on medium.com

The vulnerability CVE-2025–32463 is a local privilage escellation exploit. The exploit affects the Sudo application on almost every distribution of Linux that supports Sudo versions 1.9.14 to 1.9.17 inclusive are affected.

Lunacysoft, 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, sudo resolved paths using the user-specified chroot directory before fully evaluating the sudoers policy, allowing a user-controlled nsswitch.conf to cause loading of an arbitrary shared library.

Impact

A local user could escalate to root even without sudoers permission, but the exploit may need to be run multiple times to succeed.

What the attacker needed

Local access to a vulnerable system; sudo version 1.9.14 to 1.9.17

The fix

The vulnerability was fixed by updating sudo to a patched version; no workaround is available.

How it was found

  1. Create a temporary staging directory.
  2. Write a C source file that defines a constructor to set root IDs and execute a shell.
  3. Create a fake root directory structure with an nsswitch.conf pointing to a malicious library.
  4. Compile the C code into a shared library placed in the fake root.
  5. Run sudo with the -R option pointing to the fake root to trigger the exploit.

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 lets users run commands as root if allowed. A bug in its chroot option (which changes the root directory) let a normal user make sudo load a malicious library, giving them root access without permission.

What is RCE?

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.

Similar reports

View all

Same bug class and techniques, clearest first.

Remote code execution

The lesson behind this report.

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.