Critical

Flask-Reuploaded vulnerable to Remote Code Execution via Server-Side Template Injection

  • Disclosed: 25.02.2026
  • Updated: 11.10.2026 12:20

Impact

A critical path traversal and extension bypass vulnerability in Flask-Reuploaded allows remote attackers to achieve arbitrary file write and remote code execution through Server-Side Template Injection (SSTI).

Patches

Flask-Reuploaded has been patched in version 1.5.0

Workarounds

  1. Do not pass user input to the name parameter
  2. Use auto-generated filenames only
  3. Implement strict input validation if name must be used
python
from werkzeug.utils import secure_filename
import os

# Sanitize user input before passing to save()
 safe_name = secure_filename(request.form.get('custom_name'))
# Remove path separators
 safe_name = os.path.basename(safe_name)
# Validate extension matches policy
if not photos.extension_allowed(photos.get_extension(safe_name)):
    abort(400)
    
filename = photos.save(file, name=safe_name)

Resources

The fix is documented in the pull request, see https://github.com/jugmac00/flask-reuploaded/pull/180.

A proper write-up was created by the reporter of the vulnerability, Jaron Cabral (https://www.linkedin.com/in/jaron-cabral-751994357/), but is not yet available as of time of this publication.

Affected software

Click a technology to see all vulnerabilities affecting it.

PlatformPackageVulnerable versionsFixed in
Python (PyPI) flask-reuploaded < 1.5.0 1.5.0

References

CVSS score 9.8/10
CVSS vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Weakness (CWE)
CWE-1336, CWE-22
Platform
Python (PyPI)
Package
flask-reuploaded
Disclosed
25.02.2026
Updated
11.10.2026 12:20

Sources and licenses

OSV / GitHub Advisory Database - GHSA-65mp-fq8v-56jr - CC BY 4.0

OSV / GitHub Advisory Database - PYSEC-2026-341 - PyPA Advisory Database; CC BY 4.0

Vulnerability history: flask-reuploaded

All published vulnerabilities of this package (Python (PyPI)), newest first. Shows whether this is a one-off slip or a package that needs watching.

Total entries
2
First → latest
02.2026 07.2026
Without a fix
0
Exploited in attacks
0

Severity breakdown

  • Critical 1
  • High 1

Disclosures per year

  1. 2026: 2
  1. Flask-Reuploaded vulnerable to Remote Code Execution via Server-Side Template Injection this entry
    Critical · 9.8 CVE-2026-27641 < 1.5.0 1.5.0

Know which vulnerabilities affect your application

With the DockRay integration and software inventory enabled, DockRay checks reported component versions against known vulnerabilities and notifies you about confirmed matches. Coverage depends on the supported technology and available advisory data.

Connect your application
DockRay newsletter

Application security in your inbox

Important vulnerabilities, actionable guidance and practical advice for your applications. Choose your technologies and follow what matters to your project.

  • A daily digest of new vulnerabilities, critical ones included.
  • Notifications about important updates.
  • Practical advice on application security and monitoring.

Leave empty to receive updates for every technology.

Free to subscribe. Unsubscribe with one click in any email.