The SentinelOne Annual Threat Report - A Defenders Guide from the FrontlinesThe SentinelOne Annual Threat ReportGet the Report
Experiencing a Breach?Blog
Get StartedContact Us
SentinelOne
  • Platform
    Platform Overview
    • Singularity Platform
      Welcome to Integrated Enterprise Security
    • AI for Security
      Leading the Way in AI-Powered Security Solutions
    • Securing AI
      Accelerate AI Adoption with Secure AI Tools, Apps, and Agents.
    • 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
    • AI Data Pipelines
      Security Data Pipeline for AI SIEM and Data Optimization
    • 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
    • Singularity Identity
      Identity Threat Detection and Response
    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
    Securing AI
    • Prompt Security
      Secure AI Tools Across Your Enterprise
  • 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
      DFIR, Breach Readiness, & Compromise Assessments
    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
    • SentinelOne for Google Cloud
      Unified, Autonomous Security Giving Defenders the Advantage at Global Scale
    • 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-2021-23239

CVE-2021-23239: Sudo Race Condition Vulnerability

CVE-2021-23239 is a race condition flaw in Sudo's sudoedit personality that enables local unprivileged users to test directory existence via symlink manipulation. This article covers technical details, affected versions, and mitigations.

Published: February 25, 2026

CVE-2021-23239 Overview

The sudoedit personality of Sudo before version 1.9.5 contains a race condition vulnerability that may allow a local unprivileged user to perform arbitrary directory-existence tests. The flaw exists in the sudo_edit.c file where a race condition can be exploited by replacing a user-controlled directory with a symlink to an arbitrary path, enabling information disclosure about the file system structure.

Critical Impact

Local attackers can exploit this symlink race condition to determine the existence of arbitrary directories on the system, potentially aiding in reconnaissance for further attacks.

Affected Products

  • Sudo Project Sudo (versions before 1.9.5)
  • NetApp Cloud Backup
  • NetApp HCI Management Node
  • NetApp SolidFire
  • Fedora 32 and 33
  • Debian Linux 10.0

Discovery Timeline

  • 2021-01-12 - CVE-2021-23239 published to NVD
  • 2024-11-21 - Last updated in NVD database

Technical Details for CVE-2021-23239

Vulnerability Analysis

This vulnerability is classified as CWE-59 (Improper Link Resolution Before File Access), commonly known as a symlink attack. The flaw resides in the sudoedit functionality of Sudo, which is designed to allow users to edit files with elevated privileges in a controlled manner.

The vulnerable code path in sudo_edit.c fails to properly handle the time-of-check to time-of-use (TOCTOU) window when processing user-controlled directories. An attacker with local access can exploit this race condition by rapidly replacing a directory they control with a symbolic link pointing to an arbitrary location on the file system.

When the sudoedit process attempts to access the directory, the attacker can determine whether the target path exists based on the behavior or error messages returned. While this vulnerability does not directly enable code execution or privilege escalation, it facilitates information disclosure that could be leveraged as part of a more sophisticated attack chain.

Root Cause

The root cause is a race condition in the sudo_edit.c file where the application checks directory permissions and then subsequently accesses the directory without atomic verification. This TOCTOU gap allows an attacker to substitute a legitimate directory with a malicious symlink between the check and use operations, bypassing the intended security constraints.

Attack Vector

The attack requires local access to the system with low privileges. An attacker must be able to:

  1. Create directories in a location accessible to their user account
  2. Execute sudoedit with a path they control
  3. Win the race condition by replacing the directory with a symlink at the precise moment between Sudo's check and use operations

The exploitation is performed locally and requires the attacker to repeatedly attempt the race condition until successful. The attacker can then probe for the existence of arbitrary directories on the file system by observing the behavior differences when the symlink target exists versus when it does not.

Detection Methods for CVE-2021-23239

Indicators of Compromise

  • Unusual sudoedit invocations with rapidly changing directory paths
  • High volume of directory creation and deletion operations in user-controlled paths
  • Symlink creation activity targeting sensitive system directories
  • Repeated sudoedit failures or unusual error patterns in authentication logs

Detection Strategies

  • Monitor /var/log/auth.log or /var/log/secure for anomalous sudoedit command patterns
  • Implement file integrity monitoring on directories commonly targeted for symlink attacks
  • Configure auditd rules to track symlink creation and directory manipulation in user home directories
  • Deploy behavioral analysis to detect rapid file system operations indicative of race condition exploitation

Monitoring Recommendations

  • Enable verbose Sudo logging by configuring log_input and log_output in sudoers
  • Set up alerting for sudoedit commands executed with unusual path arguments
  • Monitor process creation events for sudoedit invocations paired with rapid filesystem modifications
  • Correlate sudo activity with file system events to identify potential race condition attempts

How to Mitigate CVE-2021-23239

Immediate Actions Required

  • Upgrade Sudo to version 1.9.5 or later immediately
  • Review sudo logs for evidence of exploitation attempts
  • Audit systems for unauthorized symlinks in user-writable directories
  • Consider temporarily restricting sudoedit access if immediate patching is not feasible

Patch Information

The Sudo Project has addressed this vulnerability in version 1.9.5. System administrators should update to this version or later to remediate the race condition in sudoedit. Patches are available from the Sudo Project Stable Release page.

Distribution-specific patches have been released:

  • Fedora users should apply updates via the Fedora Package Announcement
  • Debian users can reference the Debian LTS Announcement
  • Gentoo users should follow the Gentoo GLSA 202101-33 advisory
  • NetApp customers should review the NetApp Security Advisory

Workarounds

  • Restrict sudoedit access to trusted users only by modifying sudoers configuration
  • Implement filesystem quotas and inode limits to make race condition exploitation more difficult
  • Use mandatory access control systems like SELinux or AppArmor to restrict symlink creation in sensitive paths
  • Monitor and alert on sudoedit usage until patches can be applied
bash
# Configuration example
# Verify current sudo version
sudo --version

# Update sudo on Debian/Ubuntu systems
sudo apt-get update && sudo apt-get install sudo

# Update sudo on RHEL/CentOS/Fedora systems
sudo dnf update sudo

# Restrict sudoedit in /etc/sudoers (temporary workaround)
# Comment out or remove sudoedit permissions for non-essential users
# Example: Remove NOPASSWD entries for sudoedit

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

  • Vulnerability Details
  • TypeRace Condition

  • Vendor/TechSudo

  • SeverityLOW

  • CVSS Score2.5

  • EPSS Probability0.15%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:L/I:N/A:N
  • Impact Assessment
  • ConfidentialityHigh
  • IntegrityNone
  • AvailabilityNone
  • CWE References
  • CWE-59
  • Technical References
  • SUSE Bugzilla CVE-2021-23239

  • Debian LTS Announcement

  • Fedora Package Announcement

  • Fedora Package Announcement

  • Gentoo GLSA 202101-33

  • NetApp Security Advisory
  • Vendor Resources
  • Sudo Project Stable Release
  • Latest CVEs
  • CVE-2026-40322: SiYuan Knowledge Management RCE Vulnerability

  • CVE-2026-40318: SiYuan Path Traversal Vulnerability

  • CVE-2026-40259: SiYuan Auth Bypass Vulnerability

  • CVE-2026-40255: AdonisJS HTTP Server CSRF Vulnerability
Default Legacy - Prefooter | 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
  • 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

English