CVE-2023-22809: Buffer Overflow

Published 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.

Other sources

Accessibility. A privacy issue was addressed with improved private data redaction for log entries.

— Apple

Accessibility. This issue was addressed with improved checks.

— Apple

Accounts. A permissions issue was addressed with improved redaction of sensitive information.

— Apple

AMD. A buffer overflow issue was addressed with improved memory handling.

— Apple

AppleMobileFileIntegrity. This issue was addressed by forcing hardened runtime on the affected binaries at the system level.

— Apple

Credit

CVE-2023-22809, James Duffy (mangoSecure), Kirin@@Pwnrin, Arsenii Kostromin (0x3c3e), Wenchao Li(Alibaba Group), Xiaolong Bai(Alibaba Group), Mickey Jin@@patch1t(Tencent Security Xuanwu Lab), Zhipeng Huo@@R3dF09(Tencent Security Xuanwu Lab), an anonymous researcher, Khiem Tran, Gergely Kalman@@gergely_kalman(SecuRing), (SecuRing), Wojciech Reguła(SecuRing), Yiğit Can YILMAZ@@yilmazcanyigit, Satish Panduranga, Ivan Fratric(Google Project Zero), Adam M., Wojciech Regula(SecuRing), Ignacio Sanmillan@@ulexec, Clément Lecigne(Google's Threat Analysis Group), Donncha Ó Cearbhaill(Amnesty International), Pan ZhenPeng@@Peterpan0927(STAR Labs SG Pte), Thijs Alkemade(Computest Sector 7), Mickey Jin@@patch1t, Jonathan Fritz, Julian Szulc, Holger Fuhrmannek(Deutsche Telekom Security GmbH on behalf of BSI), Yiğit Can YILMAZ@@yilmazcanyigit(FFRI Security Inc), Koh M. Nakagawa(FFRI Security Inc), Kirin@@Pwnrin(Offensive Security), Jeff Johnson (underpassapp.com)(Offensive Security), (Offensive Security), Csaba Fitzl@@theevilbit(Offensive Security), Gerhard Muth, Dimitrios Tatsis(Cisco Talos), Zitong Wu (吴梓桐)(Zhuhai No), Meysam Firouzi@@R00tkitSMM(Mbition Mercedes), Meysam Firouzi@@R00tkitsmm(Trend Micro Zero Day Initiative), hou xuewei vmk msu@@p1ay8y3ar, CertiK SkyFall Team(Pinauten GmbH), Linus Henze(Pinauten GmbH), 08Tc3wBB(Jamf), Adam Doupé(ASU SEFCOM), Eloi Benoist-Vanderbeken@@elvanderb(Synacktiv), Wojciech Reguła@@_r3ggi(SecuRing), OSS-Fuzz(Google Project Zero), Ned Williamson(Google Project Zero), Jonathan Bar Or(Microsoft), Anurag Bohra(Microsoft), (Microsoft), Michael Pearse(Microsoft), Thijs Alkemade@@xnyhps(Computest Sector 7), Gergely Kalman@@gergely_kalman, Michael DePlante@@izobashi(Trend Micro Zero Day Initiative), Sergii Kryvoblotskyi(MacPaw Inc), ABC Research s.r.o.

Affected Software

38 affected componentsFixes available
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+deb10u51.9.5p2-3+deb11u11.9.13p3-1+deb12u11.9.14p2-11.9.15p2-2
redhat/sudo<1.9.12
1.9.12
IBM Security Guardium<=11.3
IBM Security Guardium<=11.4
IBM Security Guardium<=11.5
Apple macOS Ventura<13.4
13.4
Sudo Project Sudo>=1.8.0<1.9.12
Sudo Project Sudo=1.9.12
Sudo Project Sudo=1.9.12-p1
Debian Debian Linux=10.0
Debian Debian Linux=11.0
Fedoraproject Fedora=37
Fedoraproject Fedora=36
Apple macOS<13.4
Microsoft cbl2 sudo 1.9.12p2-1
Microsoft cm1 sudo 1.9.12p2-1
alpine/sudo>=1.8.0<1.9.12_p2-r0
1.9.12_p2-r0
alpine/sudo>=1.8.0<1.9.12_p2-r0
1.9.12_p2-r0
alpine/sudo>=1.8.0<1.9.12_p2-r0
1.9.12_p2-r0
alpine/sudo>=1.8.0<1.9.12_p2-r0
1.9.12_p2-r0
alpine/sudo>=1.8.0<1.9.12_p2-r0
1.9.12_p2-r0
alpine/sudo>=1.8.0<1.9.12_p2-r0
1.9.12_p2-r0
alpine/sudo>=1.8.0<1.9.12_p2-r0
1.9.12_p2-r0
alpine/sudo>=1.8.0<1.9.12_p2-r0
1.9.12_p2-r0
alpine/sudo>=1.8.0<1.9.12_p2-r0
1.9.12_p2-r0
alpine/sudo>=1.8.0<1.9.12_p2-r0
1.9.12_p2-r0

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade redhat/sudo to a version that resolves this vulnerability.

    Fixed in 0:1.8.6p3-29.el6_10.7
  2. Upgrade

    Upgrade redhat/sudo to a version that resolves this vulnerability.

    Fixed in 0:1.8.23-10.el7_9.3
  3. Upgrade

    Upgrade redhat/sudo to a version that resolves this vulnerability.

    Fixed in 0:1.8.19p2-12.el7_4.3
  4. Upgrade

    Upgrade redhat/sudo to a version that resolves this vulnerability.

    Fixed in 0:1.8.23-3.el7_6.3
  5. Upgrade

    Upgrade redhat/sudo to a version that resolves this vulnerability.

    Fixed in 0:1.8.23-4.el7_7.4
  6. Upgrade

    Upgrade redhat/sudo to a version that resolves this vulnerability.

    Fixed in 0:1.8.29-8.el8_7.1
  7. Upgrade

    Upgrade redhat/sudo to a version that resolves this vulnerability.

    Fixed in 0:1.8.25p1-8.el8_1.3
  8. Upgrade

    Upgrade redhat/sudo to a version that resolves this vulnerability.

    Fixed in 0:1.8.29-5.el8_2.2
  9. Upgrade

    Upgrade redhat/sudo to a version that resolves this vulnerability.

    Fixed in 0:1.8.29-7.el8_4.2
  10. Upgrade

    Upgrade redhat/sudo to a version that resolves this vulnerability.

    Fixed in 0:1.8.29-8.el8_6.1
  11. Upgrade

    Upgrade redhat/sudo to a version that resolves this vulnerability.

    Fixed in 0:1.9.5p2-7.el9_1.1
  12. Upgrade

    Upgrade redhat/sudo to a version that resolves this vulnerability.

    Fixed in 0:1.9.5p2-7.el9_0.2
  13. Upgrade

    Upgrade debian/sudo to a version that resolves this vulnerability.

    Fixed in 1.8.27-1+deb10u5Fixed in 1.9.5p2-3+deb11u1Fixed in 1.9.13p3-1+deb12u1Fixed in 1.9.14p2-1Fixed in 1.9.15p2-2
  14. Upgrade

    Upgrade redhat/sudo to a version that resolves this vulnerability.

    Fixed in 1.9.12
  15. Upgrade

    Upgrade macOS Ventura to a version that resolves this vulnerability.

    Fixed in 13.4
  16. Upgrade

    Upgrade alpine/sudo to a version that resolves this vulnerability.

    Fixed in 1.9.12_p2-r0
  17. Upgrade

    Upgrade sudo to a version that resolves this vulnerability.

    Fixed in 1.9.12p2
  18. Configuration

    Add `Defaults!sudoedit env_delete+="SUDO_EDITOR VISUAL EDITOR"` to the sudoers file to prevent a user-specified editor from being used by sudoedit.

    sudoers env_delete = SUDO_EDITOR VISUAL EDITOR
  19. Configuration

    Restrict sudoedit to specific files by defining `Cmnd_Alias EDIT_MOTD = sudoedit /etc/motd` and granting the authorized user `user ALL = EDIT_MOTD`; apply `Defaults!EDIT_MOTD env_delete+="SUDO_EDITOR VISUAL EDITOR"` for that alias.

    sudoers Cmnd_Alias = sudoedit /etc/motd

Event History

Jan 18, 2023
CVE Published
via MITRE·12:00 AM
Data Sourced
via MITRE·12:00 AM
Description
Data Sourced
via NVD·05:15 PM
DescriptionSeverityWeaknessAffected Software
Data Sourced
via OSV·05:15 PM
DescriptionSeverityAffected Software
Oct 1, 2025
Data Sourced
via Microsoft·11:11 PM
DescriptionSeverityWeaknessAffected Software

Frequently Asked Questions

1

What is CVE-2023-22809?

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.

2

How severe is CVE-2023-22809?

CVE-2023-22809 is considered to be a high severity vulnerability with a severity value of 7.

3

How does CVE-2023-22809 affect sudo?

CVE-2023-22809 affects sudo versions before 1.9.12p2.

4

How can I fix CVE-2023-22809?

To fix CVE-2023-22809, update sudo to version 1.9.12p2 or later.

5

Where can I find more information about CVE-2023-22809?

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)

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203