
Proof-of-concept exploit for CVE-2025-32463, a local privilege escalation in sudo's chroot feature via malicious NSS library loading. Includes Docker-based testing environment.
The Dockerfile creates a safe, isolated testing environment with a vulnerable version of sudo (1.9.16p2) installed. This allows you to test the exploit without affecting your host system.
# Build the vulnerable test environment
docker build -t cve .
# Run the container (creates an unprivileged user 'testuser')
docker run -it cve
# Execute the proof-of-concept exploit
./poc.sh
After running poc.sh, you should obtain a root shell within the container, demonstrating the privilege escalation vulnerability.
The vulnerability is a local privilege escalation that involves the Sudo chroot feature. Exploitation does not require any sudo rules to be defined for the user. As such, any local user could potentially escalate to root if a vulnerable version of sudo is installed.
CVE-2025-32463 is a critical privilege escalation vulnerability in sudo's chroot feature (-R or --chroot option). The vulnerability allows an unprivileged local user to escalate to root without requiring any sudo permissions to be configured.
The vulnerability exploits a race condition in how sudo handles Name Service Switch (NSS) libraries when using the -R chroot option. When sudo performs a chroot operation:
/etc/nsswitch.confThe proof-of-concept exploit works as follows:
nsswitch.conf that redirects lookups to the attacker's NSS librarysudo -R <chroot_path> /bin/trueNote: Sudo versions <=1.8.32 are not vulnerable because the chroot feature does not exist
Upgrade to sudo version 1.9.17p1 or later, which includes a fix for this vulnerability.
sudo -R commandMonitor system logs for:
sudo -R command by unprivileged usersThis proof-of-concept is provided for educational and authorized security testing purposes only. Only use this exploit on systems you own or have explicit written permission to test. Unauthorized access to computer systems is illegal.
The CVE-2025-32463 Sudo chroot Elevation of Privilege Vulnerability was discovered by Rich Mirch of the Stratascale Cyber Research Unit. All the credit for the research and POC goes to him. Show some support and read the research here: https://www.stratascale.com/vulnerability-alert-CVE-2025-32463-sudo-chroot