Flask Path Traversal (CVE-2026-27641)
CVE-2026-27641
Flask-Reuploaded provides file uploads for Flask. A critical path traversal and extension bypass vulnerability in versions prior to 1.5.0 allows remote attackers to achieve arbitrary file write and re...
Overview
A critical security vulnerability has been identified in Flask-Reuploaded, a popular extension for handling file uploads in Flask web applications. This flaw could allow an attacker to completely compromise an affected server.
Vulnerability Explanation
In simple terms, this vulnerability is a combination of two issues in the file upload process. First, it allows an attacker to bypass security checks and upload files with dangerous extensions. Second, it enables “path traversal,” where an attacker can write the uploaded file to any location on the server’s filesystem, not just the intended upload directory. By combining these flaws, an attacker can upload a malicious web template file to a critical location and then trigger it, leading to full server control through Server-Side Template Injection (SSTI).
Potential Impact
The impact of this vulnerability is severe. A successful attack could result in:
- Arbitrary File Write: An attacker can overwrite or create files anywhere the web server has write permissions.
- Remote Code Execution (RCE): The attacker can run any code or command on the underlying server.
- Complete System Compromise: This can lead to data theft, service disruption, or use of the server as a foothold for further attacks within your network.
Remediation and Mitigation
Immediate action is required to secure affected systems.
Primary Solution – Update: The issue is fully patched in Flask-Reuploaded version 1.5.0. Upgrade your application’s dependencies to this version or higher as soon as possible.
Immediate Workarounds: If an immediate update is not possible, apply these strict configuration changes:
- Do Not Use User-Provided Filenames: Avoid passing any user-controlled input to the
nameparameter of the upload function. Use only auto-generated filenames (like UUIDs). - Implement Strict Validation: If you absolutely must use a custom
nameparameter, you must enforce rigorous validation. This includes stripping directory paths (../) and allowing only a strict, pre-approved set of safe file extensions. - Restrict Upload Directory Permissions: Ensure the upload directory is configured with the minimum necessary filesystem permissions and, if possible, is located outside of the web root.
All users of Flask-Reuploaded should prioritize upgrading to the patched version to eliminate this critical risk.
Never miss a critical vulnerability
Get real-time security alerts delivered to your preferred platform.
Am I Affected by CVE-2026-27641?
Pick an ecosystem, paste your installed version, and we'll compare it against the fixed version published on OSV.dev. Browser-only — nothing is sent to a server.
Heuristic comparison only. Always cross-check against the vendor advisory before making patching decisions.
Related Advisories
OpenCTI is an open source platform for managing cyber threat intelligence knowledge and observables. Prior to 6.9.5, the safeEjs.ts file does not properly sanitize EJS templates. Users with the Manage...
Due to the use of a vulnerable third-party Velocity template engine, a malicious actor with admin privilege may inject and execute arbitrary template syntax within server-side templates. Successful...
GitLab has remediated a vulnerability in the Duo Workflow Service component of GitLab AI Gateway affecting all versions of the AI Gateway from 18.1.6, 18.2.6, 18.3.1 to 18.6.1, 18.7.0, and 18.8.0 in w...
BentoML is a Python library for building online serving systems optimized for AI apps and model inference. Prior to 1.4.38, the Dockerfile generation function generate_containerfile() in src/bentoml/_...