A Leader in the 2025 Gartner® Magic Quadrant™ for Endpoint Protection Platforms. Five years running.A Leader in the Gartner® Magic Quadrant™Read the Report
Experiencing a Breach?Blog
Get StartedContact Us
SentinelOne
  • Platform
    Platform Overview
    • Singularity Platform
      Welcome to Integrated Enterprise Security
    • AI Security Portfolio
      Leading the Way in AI-Powered Security Solutions
    • How It Works
      The Singularity XDR Difference
    • Singularity Marketplace
      One-Click Integrations to Unlock the Power of XDR
    • Pricing & Packaging
      Comparisons and Guidance at a Glance
    Data & AI
    • Purple AI
      Accelerate SecOps with Generative AI
    • Singularity Hyperautomation
      Easily Automate Security Processes
    • AI-SIEM
      The AI SIEM for the Autonomous SOC
    • Singularity Data Lake
      AI-Powered, Unified Data Lake
    • Singularity Data Lake for Log Analytics
      Seamlessly ingest data from on-prem, cloud or hybrid environments
    Endpoint Security
    • Singularity Endpoint
      Autonomous Prevention, Detection, and Response
    • Singularity XDR
      Native & Open Protection, Detection, and Response
    • Singularity RemoteOps Forensics
      Orchestrate Forensics at Scale
    • Singularity Threat Intelligence
      Comprehensive Adversary Intelligence
    • Singularity Vulnerability Management
      Application & OS Vulnerability Management
    Cloud Security
    • Singularity Cloud Security
      Block Attacks with an AI-powered CNAPP
    • Singularity Cloud Native Security
      Secure Cloud and Development Resources
    • Singularity Cloud Workload Security
      Real-Time Cloud Workload Protection Platform
    • Singularity Cloud Data Security
      AI-Powered Threat Detection for Cloud Storage
    • Singularity Cloud Security Posture Management
      Detect and Remediate Cloud Misconfigurations
    Identity Security
    • Singularity Identity
      Identity Threat Detection and Response
  • Why SentinelOne?
    Why SentinelOne?
    • Why SentinelOne?
      Cybersecurity Built for What’s Next
    • Our Customers
      Trusted by the World’s Leading Enterprises
    • Industry Recognition
      Tested and Proven by the Experts
    • About Us
      The Industry Leader in Autonomous Cybersecurity
    Compare SentinelOne
    • Arctic Wolf
    • Broadcom
    • CrowdStrike
    • Cybereason
    • Microsoft
    • Palo Alto Networks
    • Sophos
    • Splunk
    • Trellix
    • Trend Micro
    • Wiz
    Verticals
    • Energy
    • Federal Government
    • Finance
    • Healthcare
    • Higher Education
    • K-12 Education
    • Manufacturing
    • Retail
    • State and Local Government
  • Services
    Managed Services
    • Managed Services Overview
      Wayfinder Threat Detection & Response
    • Threat Hunting
      World-class Expertise and Threat Intelligence.
    • Managed Detection & Response
      24/7/365 Expert MDR Across Your Entire Environment
    • Incident Readiness & Response
      Digital Forensics, IRR & Breach Readiness
    Support, Deployment, & Health
    • Technical Account Management
      Customer Success with Personalized Service
    • SentinelOne GO
      Guided Onboarding & Deployment Advisory
    • SentinelOne University
      Live and On-Demand Training
    • Services Overview
      Comprehensive solutions for seamless security operations
    • SentinelOne Community
      Community Login
  • Partners
    Our Network
    • MSSP Partners
      Succeed Faster with SentinelOne
    • Singularity Marketplace
      Extend the Power of S1 Technology
    • Cyber Risk Partners
      Enlist Pro Response and Advisory Teams
    • Technology Alliances
      Integrated, Enterprise-Scale Solutions
    • SentinelOne for AWS
      Hosted in AWS Regions Around the World
    • Channel Partners
      Deliver the Right Solutions, Together
    • Partner Locator
      Your go-to source for our top partners in your region
    Partner Portal→
  • Resources
    Resource Center
    • Case Studies
    • Data Sheets
    • eBooks
    • Reports
    • Videos
    • Webinars
    • Whitepapers
    • Events
    View All Resources→
    Blog
    • Feature Spotlight
    • For CISO/CIO
    • From the Front Lines
    • Identity
    • Cloud
    • macOS
    • SentinelOne Blog
    Blog→
    Tech Resources
    • SentinelLABS
    • Ransomware Anthology
    • Cybersecurity 101
  • About
    About SentinelOne
    • About SentinelOne
      The Industry Leader in Cybersecurity
    • Investor Relations
      Financial Information & Events
    • SentinelLABS
      Threat Research for the Modern Threat Hunter
    • Careers
      The Latest Job Opportunities
    • Press & News
      Company Announcements
    • Cybersecurity Blog
      The Latest Cybersecurity Threats, News, & More
    • FAQ
      Get Answers to Our Most Frequently Asked Questions
    • DataSet
      The Live Data Platform
    • S Foundation
      Securing a Safer Future for All
    • S Ventures
      Investing in the Next Generation of Security, Data and AI
  • Pricing
Get StartedContact Us
CVE Vulnerability Database
Vulnerability Database/CVE-2023-22809

CVE-2023-22809: Sudo Privilege Escalation Vulnerability

CVE-2023-22809 is a privilege escalation vulnerability in Sudo's sudoedit feature that allows local attackers to append arbitrary files via environment variables. This article covers technical details, affected versions, impact, and mitigation.

Published: February 4, 2026

CVE-2023-22809 Overview

CVE-2023-22809 is a privilege escalation vulnerability in Sudo's sudoedit (also known as sudo -e) feature that affects versions 1.8.0 through 1.9.12p1. The vulnerability stems from improper handling of extra arguments passed through user-controlled environment variables (SUDO_EDITOR, VISUAL, and EDITOR). A local attacker with sudo privileges to run sudoedit can exploit this flaw to append arbitrary files to the list of files being edited, potentially allowing them to modify sensitive system files and escalate privileges to root.

Critical Impact

Local attackers can leverage sudoedit permissions to edit arbitrary files on the system, potentially overwriting critical configuration files like /etc/sudoers or /etc/shadow to achieve full root access.

Affected Products

  • Sudo Project Sudo versions 1.8.0 through 1.9.12p1
  • Debian Linux 10.0 and 11.0
  • Fedora 36 and 37
  • Apple macOS (multiple versions)

Discovery Timeline

  • 2023-01-18 - CVE CVE-2023-22809 published to NVD
  • 2025-04-04 - Last updated in NVD database

Technical Details for CVE-2023-22809

Vulnerability Analysis

The sudoedit feature in Sudo is designed to allow users to safely edit files with elevated privileges without granting full shell access. When sudoedit is invoked, it copies the target file to a temporary location, allows the user to edit it with their preferred editor (determined by environment variables), and then copies the modified file back to the original location.

The vulnerability exists in how sudoedit parses the editor command specified in environment variables. The code intended to prevent users from passing additional arguments to the editor by looking for spaces and quotes, but it failed to account for the -- argument separator convention used by POSIX-compliant programs. By crafting a malicious editor string containing -- followed by additional file paths, an attacker can inject arbitrary files into the list of files that sudoedit will process.

When a user has permission to edit specific files via sudoedit, they can exploit this flaw to also edit files they were never intended to access. This completely bypasses the security model that sudoedit was designed to enforce.

Root Cause

The root cause is improper input validation in the argument parsing logic for user-specified editor commands. The protection mechanism that was supposed to prevent additional arguments from being passed to the editor did not account for the -- end-of-options marker. This allowed attackers to use a carefully crafted EDITOR, VISUAL, or SUDO_EDITOR environment variable value to inject additional file paths that would be processed alongside the intended target file.

Attack Vector

The attack requires local access to a system where the attacker has permission to use sudoedit for at least one file. The attacker sets one of the editor environment variables (SUDO_EDITOR, VISUAL, or EDITOR) to include the -- argument followed by the path to a sensitive file they want to modify.

For example, if a user is granted sudoedit access to /etc/custom.conf, they can set their editor environment variable to include additional files like /etc/sudoers. When sudoedit runs, it processes both the permitted file and the injected file, allowing the attacker to grant themselves full sudo access.

The exploitation flow involves:

  1. Identifying a sudoedit permission granted to the attacker's user
  2. Setting the EDITOR or similar environment variable to include -- /path/to/sensitive/file
  3. Running sudoedit against the permitted file
  4. The editor opens both the permitted file and the injected sensitive file
  5. Modifying the sensitive file to escalate privileges (e.g., adding the attacker to sudoers)

Detection Methods for CVE-2023-22809

Indicators of Compromise

  • Unexpected modifications to system configuration files such as /etc/sudoers, /etc/passwd, or /etc/shadow
  • Audit logs showing sudoedit execution with unusual editor environment variable values containing --
  • New unauthorized entries in /etc/sudoers or /etc/sudoers.d/ directory
  • Timestamp anomalies on critical system files that should not have been modified

Detection Strategies

  • Monitor process execution for sudoedit commands where the EDITOR, VISUAL, or SUDO_EDITOR environment variables contain the -- string followed by file paths
  • Implement file integrity monitoring on critical system files including /etc/sudoers, /etc/passwd, /etc/shadow, and SSH authorized_keys files
  • Configure audit rules to log all sudoedit executions and capture associated environment variables
  • Deploy SentinelOne endpoint protection to detect privilege escalation attempts and unauthorized file modifications

Monitoring Recommendations

  • Enable comprehensive auditd logging for sudo and sudoedit command execution with environment variable capture
  • Implement real-time alerting on modifications to privileged configuration files
  • Review sudo logs regularly for patterns indicating exploitation attempts
  • Monitor for new user accounts or permission changes that could indicate successful privilege escalation

How to Mitigate CVE-2023-22809

Immediate Actions Required

  • Upgrade Sudo to version 1.9.12p2 or later immediately on all affected systems
  • Review sudoers configuration to identify all users with sudoedit permissions
  • Audit recent modifications to sensitive system files for signs of exploitation
  • Consider temporarily removing sudoedit permissions until patches are applied

Patch Information

The Sudo Project has released version 1.9.12p2 which addresses this vulnerability. Organizations should update to this version or later through their distribution's package manager. Security patches are also available from major Linux distributions including Debian (DSA-5321), Fedora, and Gentoo (GLSA 202305-12). Apple has addressed this vulnerability in macOS updates documented in HT213758.

For detailed patch information, refer to the Sudo Security Advisory and the Synacktiv technical analysis.

Workarounds

  • Remove sudoedit (or sudo -e) permissions from users where possible until patching is complete
  • Use the NOEXEC tag in sudoers to prevent shell escapes, though this does not fully mitigate the vulnerability
  • Restrict the env_editor option by setting Defaults !env_editor in sudoers to disable user-controlled editor variables
  • Implement strict file integrity monitoring as a compensating control
bash
# Disable user-controlled editor environment variables in sudoers
# Add to /etc/sudoers or /etc/sudoers.d/security
Defaults !env_editor
Defaults editor="/usr/bin/vi"

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

  • Vulnerability Details
  • TypePrivilege Escalation

  • Vendor/TechSudo

  • SeverityHIGH

  • CVSS Score7.8

  • EPSS Probability55.10%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
  • Impact Assessment
  • ConfidentialityLow
  • IntegrityNone
  • AvailabilityHigh
  • CWE References
  • CWE-269
  • Technical References
  • Packet Storm Privilege Escalation

  • Packet Storm Sudoedit Exploit

  • Packet Storm Cisco Vulnerability

  • Full Disclosure Mailing List Post

  • Openwall OSS-Security Discussion

  • Debian LTS Security Announcement

  • Fedora Package Announcement Update

  • Fedora Package Security Notice

  • Gentoo GLSA 2023-05-12

  • NetApp Security Advisory

  • Apple Support Security Update

  • Debian DSA-5321 Security Release
  • Vendor Resources
  • Sudo Security Advisory on Sudoedit

  • Synacktiv CVE-2023-22809 Report
  • Related CVEs
  • CVE-2025-32463

  • CVE-2025-32462

  • CVE-2023-28487
Experience the World’s Most Advanced Cybersecurity Platform

Experience the World’s Most Advanced Cybersecurity Platform

See how our intelligent, autonomous cybersecurity platform can protect your organization now and into the future.

Try SentinelOne
  • Get Started
  • Get a Demo
  • Product Tour
  • Why SentinelOne
  • Pricing & Packaging
  • FAQ
  • Contact
  • Contact Us
  • Customer Support
  • SentinelOne Status
  • Language
  • English
  • Platform
  • Singularity Platform
  • Singularity Endpoint
  • Singularity Cloud
  • Singularity AI-SIEM
  • Singularity Identity
  • Singularity Marketplace
  • Purple AI
  • Services
  • Wayfinder TDR
  • SentinelOne GO
  • Technical Account Management
  • Support Services
  • Verticals
  • Energy
  • Federal Government
  • Finance
  • Healthcare
  • Higher Education
  • K-12 Education
  • Manufacturing
  • Retail
  • State and Local Government
  • Cybersecurity for SMB
  • Resources
  • Blog
  • Labs
  • Case Studies
  • Videos
  • Product Tours
  • Events
  • Cybersecurity 101
  • eBooks
  • Webinars
  • Whitepapers
  • Press
  • News
  • Ransomware Anthology
  • Company
  • About Us
  • Our Customers
  • Careers
  • Partners
  • Legal & Compliance
  • Security & Compliance
  • Investor Relations
  • S Foundation
  • S Ventures

©2026 SentinelOne, All Rights Reserved.

Privacy Notice Terms of Use