Vulnerability
CVE-2023-22809
Vulnerability details
- Score
- 7.8
- Severity
- high
CVSS 3.1 · CISA-ADP
Vector string
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:HDescription
In Sudo before 1.9.12p2, the sudoedit (aka -e) feature mishandles extra arguments passed in the user-provided environment variables (SUDO_EDITOR, VISUAL, and EDITOR), allowing a local attacker to append arbitrary entries to the list of files to process. This can lead to privilege escalation. Affected versions are 1.8.0 through 1.9.12.p1. The problem exists because a user-specified editor may contain a "--" argument that defeats a protection mechanism, e.g., an EDITOR='vim -- /path/to/extra/file' value.
CVE ProgramExploit source choices
15 sourcesThis exploit takes advantage of a vulnerability in sudoedit, part of the sudo package. The sudoedit (aka sudo -e) feature mishandles extra arguments passed in the user-provided environment variables (SUDO_EDITOR, VISUAL, and EDITOR), allowing a local attacker to append arbitrary entries to the list of files to process. This can lead to privilege escalation. by appending extra entries on /etc/sudoers allowing for execution of an arbitrary payload with root privileges. Affected versions are 1.8.0 through 1.9.12.p1. However THIS module only works against Ubuntu 22.04 and 22.10. This module was tested against sudo 1.9.9-1ubuntu2 on Ubuntu 22.04, and 1.9.11p3-1ubuntu1 on Ubuntu 22.10.
OSCP Cheat Sheet
A script to automate privilege escalation with CVE-2023-22809 vulnerability
cvedb/awesome-cve-repo source repository
asepsaepdin/cve-2023-22809 source repository
m4fiab0y/cve-2023-22809 source repository
CVE-2023-22809 Linux Sudo
Analysis & Exploit
cvedb/top source repository
d0rda4an919/cve-2023-22809-exploiter source repository
Running this exploit on a vulnerable system allows a local attacker to gain a root shell on the machine.
asepsaepdin/cve-2021-1732 source repository
Automates vulnerability check for sudo versions and privilege escalation via sudoedit if exploitable, helping users test and gain root access.
Implementation of the CVE-2023-22809