Join the Cyber Forum: Threat Intel on May 12, 2026 to learn how AI is reshaping threat defense.Join the Virtual Cyber Forum: Threat IntelRegister Now
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-2026-27641

CVE-2026-27641: Flask-Reuploaded Path Traversal Vulnerability

CVE-2026-27641 is a critical path traversal vulnerability in Flask-Reuploaded that enables arbitrary file writes and remote code execution through SSTI. This article covers the technical details, affected versions, and mitigation.

Published: February 27, 2026

CVE-2026-27641 Overview

Flask-Reuploaded is a popular Flask extension that provides file upload functionality for Python web applications. A critical path traversal and extension bypass vulnerability exists in versions prior to 1.5.0 that allows remote attackers to achieve arbitrary file write and remote code execution through Server-Side Template Injection (SSTI). This vulnerability enables attackers to write files to arbitrary locations on the filesystem and bypass extension restrictions, creating a severe security risk for any Flask application using the affected library.

Critical Impact

Remote attackers can exploit this vulnerability to write arbitrary files to the server filesystem and execute malicious code through SSTI, potentially leading to complete system compromise.

Affected Products

  • Flask-Reuploaded versions prior to 1.5.0
  • Flask applications using vulnerable Flask-Reuploaded versions with user-controlled name parameter input

Discovery Timeline

  • 2026-02-25 - CVE-2026-27641 published to NVD
  • 2026-02-25 - Last updated in NVD database

Technical Details for CVE-2026-27641

Vulnerability Analysis

This vulnerability combines two dangerous attack techniques: path traversal and extension bypass. When user-controlled input is passed to the name parameter in Flask-Reuploaded's file upload handling, the application fails to properly sanitize the input before processing. This allows attackers to craft malicious filenames containing directory traversal sequences (such as ../) to escape the intended upload directory and write files to arbitrary locations on the filesystem.

The extension bypass component of the vulnerability allows attackers to circumvent file type restrictions that would normally prevent uploading dangerous file types. By manipulating the name parameter, attackers can override the original filename's extension, enabling them to upload executable templates or scripts disguised with allowed extensions.

When combined with Flask's Jinja2 templating engine, successful exploitation can lead to Server-Side Template Injection (SSTI), where malicious template code is executed on the server, resulting in remote code execution.

Root Cause

The root cause stems from insufficient input validation and sanitization of the name parameter in the file upload handling code. The vulnerability manifests due to:

  1. Missing secure_filename() application - The name parameter was not sanitized using Werkzeug's secure_filename() function, allowing path traversal sequences to pass through
  2. Inadequate extension re-validation - After a name override, the file extension was not re-validated against allowed extensions
  3. No path containment checks - The code did not verify that the final file path remained within the designated upload directory
  4. Unsanitized folder extraction - When the name parameter contained path separators, the extracted folder component was not sanitized

Attack Vector

The attack is network-based and requires no authentication or user interaction. An attacker can exploit this vulnerability by:

  1. Sending a crafted HTTP file upload request to a vulnerable Flask application
  2. Including directory traversal sequences in the name parameter (e.g., ../../../templates/malicious.html)
  3. Bypassing extension restrictions by manipulating the filename after the folder split operation
  4. Writing a malicious Jinja2 template file to the application's template directory
  5. Triggering the template to execute arbitrary Python code on the server

The security patch addresses these issues by applying proper sanitization:

python
         if not isinstance(storage, FileStorage):
             raise TypeError("storage must be a werkzeug.FileStorage")
 
+        # Track if name ends with dot before any processing
+        name_ends_with_dot = name is not None and name.rstrip().endswith('.')
+
         if folder is None and name is not None and "/" in name:
             folder, name = os.path.split(name)
+            # Check again after split
+            name_ends_with_dot = name.rstrip().endswith('.')
+            # Sanitize folder and name extracted from name parameter
+            if folder:
+                folder = secure_filename(folder)
+            if name:
+                name = secure_filename(name)
         if storage.filename is None:
             raise ValueError("Filename must not be empty!")
         basename = self.get_basename(storage.filename)

Source: GitHub Commit

Detection Methods for CVE-2026-27641

Indicators of Compromise

  • Unexpected files appearing outside the designated upload directory
  • Template files with suspicious content in Flask template directories
  • Web server logs showing file upload requests with path traversal patterns (../, ..%2f, etc.)
  • Unusual server-side template execution errors or unexpected template rendering behavior

Detection Strategies

  • Monitor file system activity for writes outside configured upload directories
  • Implement web application firewall (WAF) rules to detect path traversal sequences in HTTP requests
  • Review Flask-Reuploaded version in requirements.txt or pyproject.toml for versions below 1.5.0
  • Audit application code for instances where user input is passed to the name parameter

Monitoring Recommendations

  • Enable detailed logging for file upload operations including full request parameters
  • Set up alerts for file creation events in sensitive directories such as /templates/ or application root
  • Monitor for anomalous HTTP POST requests to file upload endpoints with encoded path separators
  • Implement integrity monitoring on template directories to detect unauthorized modifications

How to Mitigate CVE-2026-27641

Immediate Actions Required

  • Upgrade Flask-Reuploaded to version 1.5.0 or later immediately
  • Audit existing uploaded files for any suspicious content or unauthorized file locations
  • Review application code to identify any instances where user input is passed to the name parameter
  • Implement temporary input validation if immediate upgrade is not possible

Patch Information

Flask-Reuploaded version 1.5.0 contains the complete security fix for this vulnerability. The patch applies secure_filename() to the name parameter, re-validates file extensions after name override, adds path containment checks, and sanitizes folder components extracted from the name parameter.

Upgrade using pip:

bash
pip install --upgrade flask-reuploaded>=1.5.0

For additional details, refer to the GitHub Security Advisory GHSA-65mp-fq8v-56jr and Pull Request #180.

Workarounds

  • Do not pass user-controlled input to the name parameter under any circumstances
  • Use auto-generated filenames only by allowing Flask-Reuploaded to derive filenames from the uploaded file
  • Implement strict input validation if the name parameter must be used, rejecting any input containing path separators or traversal sequences
  • Deploy the application in a containerized environment with restricted filesystem access as defense-in-depth
bash
# Configuration example
# Verify your Flask-Reuploaded version
pip show flask-reuploaded | grep Version

# Upgrade to patched version
pip install flask-reuploaded>=1.5.0

# Verify upgrade was successful
pip show flask-reuploaded | grep Version

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

  • Vulnerability Details
  • TypePath Traversal

  • Vendor/TechFlask Reuploaded

  • SeverityCRITICAL

  • CVSS Score9.8

  • EPSS Probability0.15%

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

  • GitHub Pull Request #180

  • GitHub Security Advisory GHSA-65mp-fq8v-56jr
  • Latest CVEs
  • CVE-2025-52793: Esselink.nu Settings CSRF Vulnerability

  • CVE-2025-52772: Virtual Moderator CSRF Vulnerability

  • CVE-2025-48279: WC MyParcel Belgium XSS Vulnerability

  • CVE-2025-39381: KiotViet Sync 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