CVE-2023-22809
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.
What to do
Likely to be exploited: EPSS gives a 55% chance of exploitation in the next 30 days. Treat it as urgent if you run an affected version.
Fixed builds are available from AlmaLinux, Alpine, Debian, Red Hat, Rocky Linux, Ubuntu: see the table below for the fixed version per release.
Ubuntu has not shipped a fix for every release yet.
Is your server affected? One read-only command checks every installed package against this CVE and all others, using each vendor's fixed versions. Get started or get a free API key.
curl -sS "https://api.cvefocus.com/v1/check?format=text" -H "Authorization: Bearer $CVEFOCUS_KEY" \ -H "Content-Type: text/plain" --data-binary @inventory.txt
Vendor status at a glance
Status by vendor and release
From each vendor's own security data and VEX statements. "Fixed" means a fixed build is published for that release.
| Release | Package | Status | Fixed version | Advisory |
|---|---|---|---|---|
| Ubuntu 22.04 | sudo | Fixed | 1.9.9-1ubuntu2.2 | UBUNTU-CVE-2023-22809 |
| Ubuntu 20.04 | sudo | Fixed | 1.8.31-1ubuntu1.4 | UBUNTU-CVE-2023-22809 |
| Ubuntu 18.04 | sudo | Fixed | 1.8.21p2-3ubuntu1.5 | UBUNTU-CVE-2023-22809 |
| Ubuntu 16.04 | sudo | Fix pending | 1.8.16-0ubuntu1.10+esm1 (Ubuntu Pro) | UBUNTU-CVE-2023-22809 |
| Ubuntu 14.04 | sudo | Fix pending | 1.8.9p5-1ubuntu1.5+esm7 (Ubuntu Pro) | UBUNTU-CVE-2023-22809 |
| Debian 14 | sudo | Fixed | 1.9.12p2-1 | DEBIAN-CVE-2023-22809 |
| Debian 13 | sudo | Fixed | 1.9.12p2-1 | DEBIAN-CVE-2023-22809 |
| Debian 12 | sudo | Fixed | 1.9.12p2-1 | DEBIAN-CVE-2023-22809 |
| Red Hat Enterprise Linux 9 | sudo | Fixed | 0:1.9.5p2-7.el9_1.1 | RHSA-2023:0282 |
| Red Hat Enterprise Linux 9 | sudo-python-plugin | Fixed | 0:1.9.5p2-7.el9_1.1 | RHSA-2023:0282 |
| Red Hat Enterprise Linux 8 | sudo | Fixed | 0:1.8.29-8.el8_7.1 | RHSA-2023:0284 |
| Red Hat Enterprise Linux 7 | sudo | Fixed | 0:1.8.23-10.el7_9.3 | RHSA-2023:0291 |
| Red Hat Enterprise Linux 7 | sudo-devel | Fixed | 0:1.8.23-10.el7_9.3 | RHSA-2023:0291 |
| AlmaLinux 9 | sudo | Fixed | 1.9.5p2-7.el9_1.1 | ALSA-2023:0282 |
| AlmaLinux 9 | sudo-python-plugin | Fixed | 1.9.5p2-7.el9_1.1 | ALSA-2023:0282 |
| AlmaLinux 8 | sudo | Fixed | 1.8.29-8.el8_7.1 | ALSA-2023:0284 |
| Rocky Linux 9 | sudo | Fixed | 0:1.9.5p2-7.el9_1.1 | RLSA-2023:0282 |
| Rocky Linux 8 | sudo | Fixed | 0:1.8.29-8.el8_7.1 | RLSA-2023:0284 |
| Alpine Linux 3.24 | sudo | Fixed | 1.9.12_p2-r0 | ALPINE-CVE-2023-22809 |
| Alpine Linux 3.23 | sudo | Fixed | 1.9.12_p2-r0 | ALPINE-CVE-2023-22809 |
| Alpine Linux 3.22 | sudo | Fixed | 1.9.12_p2-r0 | ALPINE-CVE-2023-22809 |
| Alpine Linux 3.21 | sudo | Fixed | 1.9.12_p2-r0 | ALPINE-CVE-2023-22809 |
| Alpine Linux 3.20 | sudo | Fixed | 1.9.12_p2-r0 | ALPINE-CVE-2023-22809 |
| Alpine Linux 3.19 | sudo | Fixed | 1.9.12_p2-r0 | ALPINE-CVE-2023-22809 |
| Alpine Linux 3.18 | sudo | Fixed | 1.9.12_p2-r0 | ALPINE-CVE-2023-22809 |
| Alpine Linux 3.17 | sudo | Fixed | 1.9.12_p2-r0 | ALPINE-CVE-2023-22809 |
| Alpine Linux 3.15 | sudo | Fixed | 1.9.12_p2-r0 | ALPINE-CVE-2023-22809 |
| Alpine Linux 3.14 | sudo | Fixed | 1.9.12_p2-r0 | ALPINE-CVE-2023-22809 |
What the vendor says
As published in the CVE record by mitre, the CVE's assigner (usually the vendor). Check the vendor's advisory before acting.
Vendor advisories:
- https://www.debian.org/security/2023/dsa-5321 (vendor-advisory)
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/… (vendor-advisory)
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/… (vendor-advisory)
- https://security.gentoo.org/glsa/202305-12 (vendor-advisory)
References
- https://www.synacktiv.com/sites/default/files/2023-01/sudo-CVE-2023-22809.pdf
- https://www.sudo.ws/security/advisories/sudoedit_any/
- https://lists.debian.org/debian-lts-announce/2023/01/msg00012.html
- https://www.debian.org/security/2023/dsa-5321
- http://www.openwall.com/lists/oss-security/2023/01/19/1
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/2QDGFCGAV5QRJCE6IXRXIS4XJHS57DDH/
- https://security.netapp.com/advisory/ntap-20230127-0015/
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/G4YNBTTKTRT2ME3NTSXAPTOKYUE47XHZ/
- http://packetstormsecurity.com/files/171644/sudo-1.9.12p1-Privilege-Escalation.html
- https://security.gentoo.org/glsa/202305-12
- https://support.apple.com/kb/HT213758
- http://packetstormsecurity.com/files/172509/Sudoedit-Extra-Arguments-Privilege-Escalation.html
- http://seclists.org/fulldisclosure/2023/Aug/21
- http://packetstormsecurity.com/files/174234/Cisco-ThousandEyes-Enterprise-Agent-Virtual-Appliance-Arbitrary-File-Modification.html
About this page
Compiled by CVEfocus from the CVE List, the security data and VEX statements of Ubuntu, Debian, Red Hat, AlmaLinux, Rocky Linux and Microsoft, CISA's Known Exploited Vulnerabilities catalog and FIRST EPSS, refreshed several times a day (data status). Information only; see the disclaimer. Official record: cve.org · NVD.