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-21860

CVE-2026-21860: Werkzeug Path Traversal Vulnerability

CVE-2026-21860 is a path traversal flaw in Werkzeug that allows exploitation of Windows device names through safe_join function. This post covers the technical details, affected versions, impact, and mitigation.

Updated: January 22, 2026

CVE-2026-21860 Overview

CVE-2026-21860 is a path traversal vulnerability in Werkzeug, a comprehensive WSGI web application library widely used in Python web frameworks including Flask. The vulnerability exists in the safe_join function, which fails to properly sanitize path segments containing Windows device names with file extensions or trailing spaces. This allows attackers to potentially access restricted system resources through specially crafted path inputs.

Critical Impact

Attackers can bypass path sanitization controls to access Windows reserved device names (CON, AUX, NUL, etc.) by appending file extensions or trailing spaces, potentially enabling information disclosure or denial of service on Windows-based deployments.

Affected Products

  • Werkzeug versions prior to 3.1.5
  • Flask applications using vulnerable Werkzeug versions on Windows
  • Any Python WSGI application leveraging Werkzeug's safe_join function on Windows systems

Discovery Timeline

  • 2026-01-08 - CVE CVE-2026-21860 published to NVD
  • 2026-01-08 - Last updated in NVD database

Technical Details for CVE-2026-21860

Vulnerability Analysis

This vulnerability stems from improper handling of file names in Werkzeug's safe_join function (CWE-67: Improper Handling of Windows Device Names). The function is designed to safely join untrusted path components to a base directory, preventing path traversal attacks. However, the implementation fails to account for a Windows-specific behavior where reserved device names remain accessible regardless of file extensions or trailing characters.

On Windows operating systems, certain device names such as CON, AUX, NUL, PRN, COM1-COM9, and LPT1-LPT9 are reserved and implicitly present in every directory. Critically, Windows continues to recognize these device names even when a file extension is appended (e.g., CON.txt) or when trailing spaces are present (e.g., CON ). The safe_join function did not properly detect and reject these variations, allowing them to pass validation checks.

When an attacker provides a path segment like CON.txt to a web application using safe_join, the function incorrectly treats it as a safe file path. When the application subsequently attempts to read this "file," Windows redirects the operation to the console device, which could lead to resource exhaustion or application hangs.

Root Cause

The root cause of this vulnerability is the incomplete blocklist implementation in Werkzeug's safe_join function. While the function may have blocked direct references to Windows device names, it did not account for the variations that Windows accepts—specifically device names with file extensions and trailing whitespace. This oversight in input validation allows malicious path segments to bypass the intended security controls.

Attack Vector

The attack can be executed remotely over the network without authentication. An attacker would craft HTTP requests containing malicious path segments targeting the safe_join function. The exploitation requires the target application to be running on a Windows system and to process user-supplied path components through Werkzeug's file handling utilities.

A typical attack scenario involves sending requests with path components such as CON.txt, AUX.log, or NUL (with trailing space) to endpoints that serve static files or process file uploads. When the application attempts to access these paths, the operation is redirected to the corresponding Windows device, potentially causing the application to hang or behave unexpectedly.

Detection Methods for CVE-2026-21860

Indicators of Compromise

  • HTTP requests containing Windows device names with extensions in path parameters (e.g., /files/CON.txt, /static/AUX.log)
  • Unusual application hangs or timeouts when processing file requests on Windows systems
  • Log entries showing file access attempts to paths matching patterns like CON.*, AUX.*, NUL.*, PRN.*
  • Repeated requests with trailing spaces in filenames targeting reserved device names

Detection Strategies

  • Implement web application firewall (WAF) rules to detect and block requests containing Windows reserved device names with extensions or trailing spaces
  • Configure intrusion detection systems (IDS) to alert on path segments matching regex patterns for device name variations (e.g., (?i)(con|aux|nul|prn|com[1-9]|lpt[1-9])(\.[^/\\]*|\s+)?$)
  • Deploy application-level logging to capture and analyze all file path operations
  • Use SentinelOne's behavioral AI to detect anomalous file access patterns and application behavior indicative of exploitation attempts

Monitoring Recommendations

  • Monitor application logs for requests containing suspicious path patterns targeting Windows device names
  • Track application response times and timeout events that may indicate exploitation attempts causing hangs
  • Enable verbose logging on file serving endpoints to capture all path resolution attempts
  • Set up alerts for repeated requests from single sources targeting static file endpoints with unusual filenames

How to Mitigate CVE-2026-21860

Immediate Actions Required

  • Upgrade Werkzeug to version 3.1.5 or later immediately on all Windows deployments
  • Review application code for custom file path handling that may be affected by similar issues
  • Implement additional input validation at the application layer to reject Windows device names in any form
  • Consider deploying web application firewall rules as a temporary protective measure while patching

Patch Information

The Werkzeug development team has addressed this vulnerability in version 3.1.5. The fix enhances the safe_join function to properly detect and reject Windows device names regardless of file extensions or trailing whitespace. Organizations should update their dependencies by running pip install --upgrade werkzeug>=3.1.5 or updating their requirements files accordingly.

For detailed information about the patch, refer to the GitHub Commit and the GitHub Security Advisory.

Workarounds

  • Implement custom middleware or decorators to validate and sanitize file paths before they reach safe_join
  • Deploy applications behind a reverse proxy configured to reject requests with Windows device name patterns
  • Run affected applications on Linux/Unix systems where this vulnerability does not apply
  • Disable or restrict access to endpoints that process user-supplied file paths until patching is complete
bash
# Configuration example
# Upgrade Werkzeug to patched version
pip install --upgrade werkzeug>=3.1.5

# Verify installed version
pip show werkzeug | grep Version

# For applications using requirements.txt, update the constraint:
# werkzeug>=3.1.5

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

  • Vulnerability Details
  • TypePath Traversal

  • Vendor/TechWerkzeug

  • SeverityMEDIUM

  • CVSS Score6.3

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X
  • Impact Assessment
  • ConfidentialityLow
  • IntegrityNone
  • AvailabilityLow
  • CWE References
  • CWE-67
  • Technical References
  • GitHub Commit Update

  • GitHub Security Advisory GHSA-87hc-h4r5-73f7
  • Related CVEs
  • CVE-2026-27199: Werkzeug Path Traversal Vulnerability

  • CVE-2024-34069: Werkzeug Debugger RCE Vulnerability

  • CVE-2024-49767: Palletsprojects Quart DoS Vulnerability

  • CVE-2023-46136: Werkzeug Multipart Parsing DoS 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