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-2026-22701

CVE-2026-22701: Python filelock Race Condition Vulnerability

CVE-2026-22701 is a TOCTOU race condition vulnerability in Python's filelock package that allows attackers to exploit symlink manipulation. This article covers technical details, affected versions, and mitigation.

Updated: January 22, 2026

CVE-2026-22701 Overview

A Time-of-Check Time-of-Use (TOCTOU) race condition vulnerability has been discovered in the SoftFileLock implementation of the Python filelock package, a widely-used platform-independent file locking library. Prior to version 3.20.3, an attacker with local filesystem access and permissions to create symlinks can exploit a race window between permission validation and file creation to cause lock operations to fail or behave unexpectedly.

The vulnerability occurs in the _acquire() method, specifically between the raise_on_not_writable_file() permission check and the subsequent os.open() file creation call. During this race window, an attacker can create a symlink at the lock file path, potentially causing the lock to operate on an unintended target file or leading to denial of service conditions.

Critical Impact

Local attackers can exploit the symlink race condition to redirect lock file operations to unintended targets, potentially causing application failures, data corruption, or denial of service in systems relying on filelock for synchronization.

Affected Products

  • filelock Python package versions prior to 3.20.3
  • Applications using SoftFileLock class for file locking
  • Systems running on platforms without O_NOFOLLOW support (such as GraalPy)

Discovery Timeline

  • 2026-01-10 - CVE-2026-22701 published to NVD
  • 2026-01-13 - Last updated in NVD database

Technical Details for CVE-2026-22701

Vulnerability Analysis

This vulnerability is classified under CWE-59 (Improper Link Resolution Before File Access), commonly known as a symlink attack. The root issue is a classic TOCTOU race condition where the time gap between validating that a file path is safe and actually using that path creates an exploitable window.

The SoftFileLock implementation performs a permission check using raise_on_not_writable_file() before attempting to create the lock file with os.open(). However, between these two operations, the filesystem state can change. An attacker with local access can monitor for lock file creation attempts and rapidly create a symlink at the target path during the race window.

If successful, the symlink could point to a sensitive file, causing the lock operation to create or modify an unintended target. On platforms where O_NOFOLLOW is not available, this attack has a higher likelihood of success since the os.open() call will follow the symlink.

Root Cause

The vulnerability stems from two factors:

  1. Temporal Gap: The separation between the permission validation (raise_on_not_writable_file()) and the actual file operation (os.open()) creates a window where the filesystem state can be manipulated.

  2. Missing Symlink Protection: Prior to the patch, the os.open() call did not include the O_NOFOLLOW flag, allowing the operation to follow symlinks if present at the target path.

The SoftFileLock class is designed as a portable fallback when OS-level locking mechanisms are unavailable, but this portability came at the cost of reduced security guarantees.

Attack Vector

The attack requires local filesystem access with the following prerequisites:

  • Permission to create symlinks in the directory where lock files are created
  • Ability to monitor or predict when lock file creation will occur
  • Timing precision to win the race between permission check and file creation

The attack flow involves:

  1. Monitoring for applications attempting to acquire locks
  2. Detecting the target lock file path
  3. Creating a symlink at that path pointing to an attacker-chosen target
  4. The victim application then operates on the symlink target instead of the intended lock file

The patched code adds the O_NOFOLLOW flag to prevent following symlinks:

python
    def _acquire(self) -> None:
        raise_on_not_writable_file(self.lock_file)
        ensure_directory_exists(self.lock_file)
        flags = (
            os.O_WRONLY  # open for writing only
            | os.O_CREAT
            | os.O_EXCL  # together with above raise EEXIST if the file specified by filename exists
            | os.O_TRUNC  # truncate the file to zero byte
        )
        o_nofollow = getattr(os, "O_NOFOLLOW", None)
        if o_nofollow is not None:
            flags |= o_nofollow
        try:
            file_handler = os.open(self.lock_file, flags, self._context.mode)
        except OSError as exception:  # re-raise unless expected exception

Source: GitHub Commit

Detection Methods for CVE-2026-22701

Indicators of Compromise

  • Unexpected symlinks appearing in directories where lock files are typically created
  • Lock file operations failing with unexpected OSError exceptions
  • Application logs showing file locking errors pointing to unusual file paths
  • Monitoring tools detecting rapid symlink creation/deletion in lock file directories

Detection Strategies

  • Audit installed Python packages for filelock versions below 3.20.3 using dependency scanning tools
  • Monitor filesystem events for symlink creation in directories used for lock files
  • Implement file integrity monitoring on directories containing lock files
  • Review application logs for unusual file locking behavior or path traversal patterns

Monitoring Recommendations

  • Enable filesystem auditing on directories where applications create lock files
  • Configure alerts for symlink creation events in sensitive directories
  • Implement process monitoring to detect suspicious local privilege escalation attempts
  • Use SentinelOne's Singularity platform to monitor for anomalous file system operations and potential TOCTOU exploitation patterns

How to Mitigate CVE-2026-22701

Immediate Actions Required

  • Upgrade the filelock package to version 3.20.3 or later immediately
  • Audit applications to identify usage of SoftFileLock class
  • For security-sensitive applications, migrate to UnixFileLock or WindowsFileLock which provide stronger OS-level guarantees
  • Review filesystem permissions to restrict symlink creation in lock file directories

Patch Information

The vulnerability has been patched in filelock version 3.20.3. The fix adds the O_NOFOLLOW flag to the os.open() call when available on the platform, preventing the operation from following symlinks.

Security patches are available at:

  • GitHub Commit 255ed06
  • GitHub Commit 41b42dd
  • GitHub Security Advisory GHSA-qmgc-5h2g-mvrw

Workarounds

  • Switch from SoftFileLock to UnixFileLock or WindowsFileLock for applications requiring stronger security guarantees
  • Restrict filesystem permissions on lock file directories to prevent unauthorized symlink creation
  • Implement additional validation in applications to verify lock file integrity before and after lock operations
  • On platforms without O_NOFOLLOW support (such as GraalPy), consider using alternative locking mechanisms
bash
# Upgrade filelock to patched version
pip install --upgrade filelock>=3.20.3

# Verify installed version
pip show filelock | grep Version

# For poetry users
poetry add filelock@^3.20.3

# For pipenv users
pipenv install filelock>=3.20.3

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

  • Vulnerability Details
  • TypeRace Condition

  • Vendor/TechFilelock

  • SeverityMEDIUM

  • CVSS Score5.3

  • EPSS Probability0.01%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:L/A:H
  • Impact Assessment
  • ConfidentialityHigh
  • IntegrityNone
  • AvailabilityHigh
  • CWE References
  • CWE-59
  • Technical References
  • GitHub Commit Changes

  • GitHub Commit Changes

  • GitHub Security Advisory
  • Latest CVEs
  • CVE-2026-35467: Browser API Key Information Disclosure

  • CVE-2026-35466: cveInterface.js XSS Vulnerability

  • CVE-2026-30252: ZenShare Suite XSS Vulnerability

  • CVE-2026-30251: ZenShare Suite v17.0 XSS Vulnerability
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