Detecting Local Privilege Escalation via chroot (CVE-2025–32463)
A low-privileged user could exploit a flaw in sudo's chroot handling to load malicious libraries and gain root access. The attacker used this to escalate privileges inside a Docker container after brute-forcing SSH credentials.
Published on medium.com
Thanks to LetsDefend for making an amazing lab out of this . I will be using the platform to explain the attack chain and detection
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 does not properly drop privileges before loading libraries when the -R (chroot) option is used, allowing a local user to execute arbitrary code as root.
Impact
The attacker could gain root access inside the container and establish persistence via an SSH key, leading to full compromise of the container.
What the attacker needed
Local user account on the system; sudo version 1.9.14 to 1.9.17; ability to create files and directories
The fix
The vulnerability should be fixed by updating sudo to a version later than 1.9.17, and the report also recommends disabling password-based SSH authentication and restricting outbound connections.
How it was found
- The attacker gained initial access by brute-forcing SSH credentials for the user devuser on port 2222.
- The attacker downloaded a proof-of-concept exploit script from GitHub using wget.
- The attacker made the script executable with chmod +x.
- The attacker executed the script, which compiled a C payload and ran sudo -R woot woot to trigger the vulnerability.
- The attacker then added an SSH public key to /root/.ssh/authorized_keys for persistence.
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.
This is about a bug in 'sudo', a program that lets normal users run commands as the superuser (root). The bug lets someone trick sudo into running their own malicious code with full root powers, so they can take complete control of the computer.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.