Skip to content
Access control Write-up Intermediate

Sudo Without Su Cve 2025 32463 Poc

Sudo versions before 1.9.17p1 allow a local user to gain root privileges by using the --chroot option to load a user-controlled nsswitch.conf, which causes sudo to load a malicious NSS module as root. An attacker with a local account can execute arbitrary commands as root.

Toshith Follow

Published on systemweakness.com

Who would have thought that the sudo command, often used in Linux to execute commands as the superuser, could be leveraged by threat actors to obtain superuser rights from a local user account that has no relevant permissions?

Toshith, on systemweakness.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 did not properly restrict the source of NSS configuration when using the --chroot option, allowing it to load nsswitch.conf and NSS modules from an attacker-controlled directory while running with root privileges.

Impact

A local user with no special permissions could gain full root access, leading to complete system compromise.

What the attacker needed

Local user account; sudo version before 1.9.17p1; ability to run sudo with --chroot

The fix

The vulnerability was fixed in sudo 1.9.17p1; users should upgrade to that version or later.

How it was found

  1. Create a Dockerfile that installs a vulnerable sudo version and a non-privileged user.
  2. Build the Docker image and run a container as the non-privileged user.
  3. Create a malicious NSS module and a fake nsswitch.conf in a temporary directory.
  4. Run sudo with the --chroot option pointing to that directory to trigger the exploit.
  5. Obtain a root shell.

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 normal users run commands as the superuser (root). This bug lets any local user trick sudo into loading a malicious configuration file from a folder they control, and because sudo runs with high privileges, that file can make sudo run the attacker's code as root. The attacker ends up with full control of the system.

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.

More by Toshith

View all

1 more disclosed report, best first.

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.