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-2024-49766

CVE-2024-49766: Werkzeug Path Traversal Vulnerability

CVE-2024-49766 is a path traversal flaw in Palletsprojects Werkzeug affecting Windows systems with Python < 3.11. This post covers the technical details, affected versions, security impact, and mitigation steps.

Updated: January 22, 2026

CVE-2024-49766 Overview

CVE-2024-49766 is a Path Traversal vulnerability in Werkzeug, the popular Web Server Gateway Interface (WSGI) web application library used extensively in Python web frameworks like Flask. The vulnerability exists in the safe_join() function, which fails to properly validate UNC paths (e.g., //server/share) on Windows systems running Python versions earlier than 3.11.

The root cause lies in the behavior of os.path.isabs() on older Python versions for Windows, which does not recognize UNC paths as absolute paths. Since Werkzeug's safe_join() relies on this check to prevent path traversal attacks, an attacker can potentially bypass the security control and access unintended files or data on the system.

Critical Impact

Applications running on Windows with Python < 3.11 may be vulnerable to unauthorized file access through UNC path manipulation, potentially exposing sensitive data or configuration files.

Affected Products

  • Palletsprojects Werkzeug (versions prior to 3.0.6)
  • Microsoft Windows (when running Python < 3.11)
  • Flask and other Python web frameworks utilizing Werkzeug's safe_join() function

Discovery Timeline

  • 2024-10-25 - CVE-2024-49766 published to NVD
  • 2025-12-03 - Last updated in NVD database

Technical Details for CVE-2024-49766

Vulnerability Analysis

The vulnerability stems from an inconsistency in how Python's os.path.isabs() function handles UNC paths on Windows across different Python versions. On Python versions prior to 3.11, the ntpath.isabs() function (which os.path.isabs() uses on Windows) does not correctly identify UNC paths like //server/share as absolute paths, returning False when it should return True.

Werkzeug's safe_join() function is designed to safely join untrusted user input to a base directory, preventing path traversal attacks. However, when the security check using os.path.isabs() fails to catch UNC paths, an attacker can supply a path that appears relative but actually points to a completely different location on the network or system.

This vulnerability is classified as CWE-22 (Improper Limitation of a Pathname to a Restricted Directory), commonly known as Path Traversal. The attack requires network access but does not require authentication or user interaction, though exploitation complexity is considered high due to the specific environment requirements.

Root Cause

The root cause is a platform-specific inconsistency in Python's path handling on Windows. The ntpath.isabs() function in Python versions before 3.11 does not properly recognize UNC paths (paths starting with // or \\) as absolute paths. Since Werkzeug's security validation relies on this check, the oversight allows malicious paths to bypass the intended security restrictions.

The vulnerable code path occurs when:

  1. An application uses safe_join() to combine a base directory with user-supplied input
  2. The user supplies a UNC path (e.g., //attacker-server/share/malicious-file)
  3. Python's os.path.isabs() incorrectly returns False for this path
  4. The path passes validation and potentially allows access to unintended locations

Attack Vector

An attacker can exploit this vulnerability by submitting a crafted UNC path to any application endpoint that uses Werkzeug's safe_join() function for file path construction. The attack vector is network-based, typically through HTTP requests to web applications.

For example, if an application serves files from a specific directory using safe_join(), an attacker could request a path like //malicious-server/share/file to potentially access files outside the intended directory or trigger connections to attacker-controlled SMB servers.

python
# Security patch in src/werkzeug/security.py - Merge commit from fork
        if (
            any(sep in filename for sep in _os_alt_seps)
            or os.path.isabs(filename)
+            # ntpath.isabs doesn't catch this on Python < 3.11
+            or filename.startswith("/")
            or filename == ".."
            or filename.startswith("../")
        ):

Source: GitHub Commit Details

Detection Methods for CVE-2024-49766

Indicators of Compromise

  • HTTP requests containing UNC-style paths (paths starting with // or \\) in file retrieval parameters
  • Unusual SMB connection attempts from web application servers to external or internal network shares
  • Access log entries showing path patterns like //server/share in URL parameters or request bodies
  • Failed file access attempts with network path errors in application logs

Detection Strategies

  • Implement web application firewall (WAF) rules to detect and block requests containing UNC path patterns in user input
  • Configure intrusion detection systems (IDS) to alert on outbound SMB connections from web servers
  • Add application-level logging for all safe_join() operations to capture attempted path manipulations
  • Deploy file integrity monitoring on directories served by the application to detect unauthorized access patterns

Monitoring Recommendations

  • Monitor outbound network connections from web application servers, especially SMB/CIFS traffic on ports 445 and 139
  • Review application access logs for requests containing double forward slashes or backslashes in path parameters
  • Set up alerts for repeated failed file access attempts that may indicate exploitation attempts
  • Track dependency versions in your applications to ensure Werkzeug is updated to version 3.0.6 or later

How to Mitigate CVE-2024-49766

Immediate Actions Required

  • Upgrade Werkzeug to version 3.0.6 or later, which contains the security patch for this vulnerability
  • Audit all applications using Werkzeug to identify those running on Windows with Python < 3.11
  • Consider upgrading Python to version 3.11 or later on Windows systems as an additional defense layer
  • Review application code for custom implementations of path joining that may have similar vulnerabilities

Patch Information

The Werkzeug development team has released version 3.0.6 which addresses this vulnerability. The patch adds an explicit check for paths starting with / to catch UNC paths that ntpath.isabs() misses on older Python versions. The fix is available through the official Werkzeug repository and PyPI.

For detailed patch information, refer to:

  • GitHub Security Advisory GHSA-f9vj-2wh5-fj8j
  • GitHub Release 3.0.6
  • Security patch commit

Workarounds

  • Upgrade Python to version 3.11 or later on Windows systems, which correctly identifies UNC paths as absolute
  • Implement additional input validation at the application level to reject paths containing // or \\ prefixes
  • Use network segmentation to prevent web application servers from initiating outbound SMB connections
  • Deploy a web application firewall with rules to block UNC path patterns in user-supplied input
bash
# Configuration example - Upgrade Werkzeug using pip
pip install --upgrade werkzeug>=3.0.6

# Verify the installed version
pip show werkzeug | grep Version

# For requirements.txt, specify minimum version
echo "werkzeug>=3.0.6" >> requirements.txt

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

  • Vulnerability Details
  • TypePath Traversal

  • Vendor/TechWindows

  • SeverityMEDIUM

  • CVSS Score6.3

  • EPSS Probability0.79%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:4.0/AV:N/AC:H/AT:N/PR:N/UI:N/VC:L/VI:N/VA:N/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
  • ConfidentialityHigh
  • IntegrityNone
  • AvailabilityNone
  • CWE References
  • CWE-22
  • Technical References
  • GitHub Release 3.0.6

  • NetApp Security Advisory
  • Vendor Resources
  • GitHub Commit Details

  • GitHub Security Advisory
  • Related CVEs
  • CVE-2026-21249: Windows 10 1607 Path Traversal Flaw

  • CVE-2026-23889: Pnpm Path Traversal Vulnerability

  • CVE-2026-20925: Windows NTLM Path Traversal Vulnerability

  • CVE-2026-20872: Windows NTLM Path Traversal 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