Skip to content
RCE Write-up Advanced

A Flaw in sudo Strikes Again — Privilege Escalation via chroot and nsswitch

A logic flaw in how sudo handles its --chroot option, combined with the Name Service Switch system, lets a local unprivileged user escalate to root privileges. The text claims no memory corruption is needed, only abuse of trusted boundaries.

Aaron Follow

Published on infosecwriteups.com

Aaron

Aaron, on infosecwriteups.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 a logic error in how sudo handles the --chroot option together with its Name Service Switch integration, letting a restricted environment be escaped or misused.

Impact

A local unprivileged user could escalate to root privileges on the affected system.

What the attacker needed

Local account on the system

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 a normal user run commands as the powerful root user, and it is specially marked so it always runs with root power. This report says a mistake in how sudo sets up a restricted directory (a chroot jail) and looks up user information (NSS) can be abused by someone who already has a normal account to gain full control of the machine.

What is RCE?

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

More by Aaron

View all

5 more disclosed reports, best first.

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.