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
    • 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-35939

CVE-2021-35939: RPM Privilege Escalation Vulnerability

CVE-2021-35939 is a privilege escalation vulnerability in RPM that allows local unprivileged users to gain root privileges through ancestor directory manipulation. This article covers technical details, affected versions, and mitigations.

Published: February 25, 2026

CVE-2021-35939 Overview

CVE-2021-35939 is a symbolic link following (symlink attack) vulnerability affecting the RPM Package Manager. The flaw stems from an incomplete fix for CVE-2017-7500 and CVE-2017-7501, where the security check was only implemented for the parent directory of the file to be created during package installation. A local unprivileged user who owns another ancestor directory could potentially exploit this flaw to gain root privileges during RPM package operations.

Critical Impact

This vulnerability enables local privilege escalation to root through symlink manipulation during package installation, threatening data confidentiality, integrity, and system availability.

Affected Products

  • RPM Package Manager (all versions prior to 4.18.0)
  • Red Hat Enterprise Linux 8.0
  • Linux distributions utilizing vulnerable RPM versions

Discovery Timeline

  • 2022-08-26 - CVE-2021-35939 published to NVD
  • 2024-11-21 - Last updated in NVD database

Technical Details for CVE-2021-35939

Vulnerability Analysis

This vulnerability is classified as CWE-59 (Improper Link Resolution Before File Access), commonly known as a symlink attack. The flaw exists in how RPM validates directory paths during file installation operations. While previous patches for CVE-2017-7500 and CVE-2017-7501 added validation checks for the immediate parent directory of files being created, the fix failed to account for validation of all ancestor directories in the path hierarchy.

When RPM installs files, it traverses the directory path and creates necessary directories. An attacker who controls an ancestor directory (other than the immediate parent) can create a symbolic link pointing to a sensitive location. When RPM follows this symlink during installation with elevated privileges, it may write files to unintended locations, allowing the attacker to overwrite critical system files or place malicious executables in privileged paths.

The vulnerability requires local access and the ability to control an ancestor directory in the installation path, but successful exploitation can result in complete system compromise through root privilege escalation.

Root Cause

The root cause is an incomplete security fix that only validated the immediate parent directory during file creation operations. The validation logic failed to recursively check all intermediate directories in the path for symbolic links that could redirect file operations to unauthorized locations. This oversight allowed attackers to bypass the security check by placing malicious symlinks in grandparent or higher-level ancestor directories.

Attack Vector

The attack requires local access and ownership of an ancestor directory in the file installation path. An attacker would:

  1. Identify an RPM package that installs files to a predictable path
  2. Create or control an ancestor directory in that path
  3. Replace the legitimate directory with a symbolic link to a target location (e.g., /etc/, /usr/bin/)
  4. Wait for or trigger an RPM installation operation running as root
  5. RPM follows the symlink and writes files to the attacker-controlled destination with root privileges

The security patch addresses this by implementing comprehensive path validation using POSIX functions like openat, mkdirat, and fstatat to safely traverse and validate intermediate symlinks during installation:

text
 which is available from
     http://www.gnu.org/
 
+Rpm requires a POSIX.1-2008 level operating system.
+
To compile RPM:
--------------

Source: GitHub RPM Commit 96ec957

The configure.ac changes add required POSIX functions for secure directory operations:

text
 
AC_CHECK_FUNCS(
   [mkstemp getcwd basename dirname realpath setenv unsetenv regcomp lchown \
-    utimes getline localtime_r statvfs getaddrinfo ],
+    utimes getline localtime_r statvfs getaddrinfo \
+    openat mkdirat fstatat ],
   [], [AC_MSG_ERROR([function required by rpm])])
 
AC_LIBOBJ(fnmatch)

Source: GitHub RPM Commit 96ec957

Detection Methods for CVE-2021-35939

Indicators of Compromise

  • Unexpected symbolic links in directory paths where RPM packages install files
  • Suspicious ownership of directories in system paths by non-root users
  • Unexplained modifications to system files following RPM operations
  • Audit logs showing file creation in unexpected locations during package installation

Detection Strategies

  • Monitor file system operations during RPM transactions using auditd rules for symlink creation
  • Implement integrity monitoring on critical system directories (/etc/, /usr/bin/, /usr/lib/)
  • Review directory ownership and permissions for unusual non-root ownership in system paths
  • Use rpm -V (verify) commands to detect unauthorized file modifications in installed packages

Monitoring Recommendations

  • Configure auditd to monitor symlink(), symlinkat(), link(), and linkat() system calls in sensitive paths
  • Enable SELinux or AppArmor policies to restrict symlink following during package operations
  • Implement file integrity monitoring (FIM) solutions to detect unauthorized changes to system files
  • Review RPM transaction logs (/var/log/dnf.log or /var/log/yum.log) for anomalous installation patterns

How to Mitigate CVE-2021-35939

Immediate Actions Required

  • Upgrade RPM to version 4.18.0 or later which contains the complete security fix
  • Apply vendor-specific patches from Red Hat or your Linux distribution
  • Audit directory ownership in paths where packages are installed for unauthorized user ownership
  • Restrict write access to system directories and implement stricter directory permission policies

Patch Information

The vulnerability has been addressed in RPM version 4.18.0 with commit 96ec957e281220f8e137a2d5eb23b83a6377d556. The patch implements comprehensive validation of intermediate symlinks during installation using POSIX.1-2008 functions (openat, mkdirat, fstatat) that allow safe traversal of directory paths without following symbolic links unexpectedly.

For Red Hat Enterprise Linux systems, refer to the Red Hat CVE-2021-35939 Advisory for distribution-specific patches. Gentoo users should refer to GLSA 202210-22 for update instructions.

Workarounds

  • Ensure all directories in package installation paths are owned by root and have appropriate permissions (typically 755)
  • Use SELinux in enforcing mode to restrict symlink following behavior
  • Implement mandatory access control policies to limit which processes can create symbolic links in system paths
  • Regularly audit and remove any unauthorized symbolic links in system directories
bash
# Audit directory ownership in common installation paths
find /usr /etc /var -type d ! -user root -ls 2>/dev/null

# Check for unexpected symbolic links in system paths
find /usr /etc /var -type l -ls 2>/dev/null

# Verify RPM version includes security fix
rpm --version
# Upgrade to 4.18.0 or later if vulnerable

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

  • Vulnerability Details
  • TypePrivilege Escalation

  • Vendor/TechRedhat Enterprise Linux

  • SeverityMEDIUM

  • CVSS Score6.7

  • EPSS Probability0.21%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:3.1/AV:L/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H
  • Impact Assessment
  • ConfidentialityLow
  • IntegrityNone
  • AvailabilityHigh
  • CWE References
  • CWE-59
  • Technical References
  • Red Hat CVE-2021-35939 Advisory

  • Red Hat Bug Report #1964129

  • Gentoo GLSA 202210-22 Notice
  • Vendor Resources
  • GitHub RPM Commit 96ec957

  • GitHub RPM Pull Request #1919

  • RPM Release 4.18.0 Information
  • Related CVEs
  • CVE-2023-6377: Redhat Enterprise Linux XKB Escalation Flaw

  • CVE-2023-50387: Red Hat Enterprise Linux DNS DoS Attack

  • CVE-2023-6121: Linux Kernel Buffer Overflow Vulnerability

  • CVE-2022-40982: Red Hat Enterprise Linux Info Disclosure
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