First published: Mon Jan 16 2023(Updated: )
A vulnerability was found in sudo. Exposure in how sudoedit handles user-provided environment variables leads to arbitrary file writing with privileges of the RunAs user (usually root). The prerequisite for exploitation is that the current user must be authorized by the sudoers policy to edit a file using sudoedit.
Credit: CVE-2023-22809 cve@mitre.org James Duffy (mangoSecure) Kirin @Pwnrin Arsenii Kostromin (0x3c3e) Wenchao Li Alibaba GroupXiaolong Bai Alibaba GroupMickey Jin @patch1t Tencent Security Xuanwu LabZhipeng Huo @R3dF09 Tencent Security Xuanwu Lab an anonymous researcher Khiem Tran Gergely Kalman @gergely_kalman SecuRing SecuRingWojciech Reguła SecuRingYiğit Can YILMAZ @yilmazcanyigit Satish Panduranga Ivan Fratric Google Project ZeroAdam M. Wojciech Regula SecuRingIgnacio Sanmillan @ulexec Clément Lecigne Google's Threat Analysis GroupDonncha Ó Cearbhaill Amnesty InternationalPan ZhenPeng @Peterpan0927 STAR Labs SG PteThijs Alkemade Computest Sector 7Mickey Jin @patch1t Jonathan Fritz Julian Szulc Holger Fuhrmannek Deutsche Telekom Security GmbH on behalf of BSIYiğit Can YILMAZ @yilmazcanyigit FFRI Security IncKoh M. Nakagawa FFRI Security IncKirin @Pwnrin Offensive SecurityJeff Johnson (underpassapp.com) Offensive Security Offensive SecurityCsaba Fitzl @theevilbit Offensive SecurityGerhard Muth Dimitrios Tatsis Cisco TalosZitong Wu (吴梓桐) Zhuhai NoMeysam Firouzi @R00tkitSMM Mbition MercedesMeysam Firouzi @R00tkitsmm Trend Micro Zero Day Initiativehou xuewei vmk msu @p1ay8y3ar CertiK SkyFall Team Pinauten GmbHLinus Henze Pinauten GmbH08Tc3wBB JamfAdam Doupé ASU SEFCOMEloi Benoist-Vanderbeken @elvanderb SynacktivWojciech Reguła @_r3ggi SecuRingOSS-Fuzz Google Project ZeroNed Williamson Google Project ZeroJonathan Bar Or MicrosoftAnurag Bohra Microsoft MicrosoftMichael Pearse MicrosoftThijs Alkemade @xnyhps Computest Sector 7Gergely Kalman @gergely_kalman Michael DePlante @izobashi Trend Micro Zero Day InitiativeSergii Kryvoblotskyi MacPaw IncABC Research s.r.o.
Affected Software | Affected Version | How to fix |
---|---|---|
redhat/sudo | <0:1.8.6p3-29.el6_10.7 | 0:1.8.6p3-29.el6_10.7 |
redhat/sudo | <0:1.8.23-10.el7_9.3 | 0:1.8.23-10.el7_9.3 |
redhat/sudo | <0:1.8.19p2-12.el7_4.3 | 0:1.8.19p2-12.el7_4.3 |
redhat/sudo | <0:1.8.23-3.el7_6.3 | 0:1.8.23-3.el7_6.3 |
redhat/sudo | <0:1.8.23-4.el7_7.4 | 0:1.8.23-4.el7_7.4 |
redhat/sudo | <0:1.8.29-8.el8_7.1 | 0:1.8.29-8.el8_7.1 |
redhat/sudo | <0:1.8.25p1-8.el8_1.3 | 0:1.8.25p1-8.el8_1.3 |
redhat/sudo | <0:1.8.29-5.el8_2.2 | 0:1.8.29-5.el8_2.2 |
redhat/sudo | <0:1.8.29-7.el8_4.2 | 0:1.8.29-7.el8_4.2 |
redhat/sudo | <0:1.8.29-8.el8_6.1 | 0:1.8.29-8.el8_6.1 |
redhat/sudo | <0:1.9.5p2-7.el9_1.1 | 0:1.9.5p2-7.el9_1.1 |
redhat/sudo | <0:1.9.5p2-7.el9_0.2 | 0:1.9.5p2-7.el9_0.2 |
debian/sudo | <=1.8.27-1+deb10u3 | 1.8.27-1+deb10u5 1.9.5p2-3+deb11u1 1.9.13p3-1+deb12u1 1.9.14p2-1 1.9.15p2-2 |
redhat/sudo | <1.9.12 | 1.9.12 |
Apple macOS | <13.4 | 13.4 |
IBM InfoSphere Guardium z/OS | <=11.3 | |
IBM InfoSphere Guardium z/OS | <=11.4 | |
IBM InfoSphere Guardium z/OS | <=11.5 | |
Sudo Project Sudo | >=1.8.0<1.9.12 | |
Sudo Project Sudo | =1.9.12 | |
Sudo Project Sudo | =1.9.12-p1 | |
Debian | =10.0 | |
Debian | =11.0 | |
Fedora | =36 | |
Fedora | =37 | |
Apple iOS and macOS | <13.4 |
It is possible to prevent a user-specified editor from being used by sudoedit by adding the following line to the sudoers file. ~~~ Defaults!sudoedit env_delete+="SUDO_EDITOR VISUAL EDITOR" ~~~ To restrict the editor when editing specific files, a Cmnd_Alias can be used, for example: ~~~ Cmnd_Alias EDIT_MOTD = sudoedit /etc/motd Defaults!EDIT_MOTD env_delete+="SUDO_EDITOR VISUAL EDITOR" user ALL = EDIT_MOTD ~~~ But if possible please update the affected package as soon as possible.
Sign up to SecAlerts for real-time vulnerability data matched to your software, aggregated from hundreds of sources.
(Appears in the following advisories)
(Found alongside the following vulnerabilities)
CVE-2023-22809 is a vulnerability in the sudo package that allows a local attacker to escalate privileges by appending arbitrary entries to the list of files to process.
CVE-2023-22809 is considered to be a high severity vulnerability with a severity value of 7.
CVE-2023-22809 affects sudo versions before 1.9.12p2.
To fix CVE-2023-22809, update sudo to version 1.9.12p2 or later.
You can find more information about CVE-2023-22809 at the following sources: - [CVE Website](https://www.cve.org/CVERecord?id=CVE-2023-22809) - [NVD Website](https://nvd.nist.gov/vuln/detail/CVE-2023-22809) - [Sudo GitHub](https://github.com/sudo-project/sudo/releases/tag/SUDO_1_9_12p2) - [Red Hat Bugzilla](https://bugzilla.redhat.com/show_bug.cgi?id=2161142) - [Red Hat Advisory](https://access.redhat.com/errata/RHSA-2023:0287)