CVE-2026-27641: Flask-Reuploaded Remote Code Execution via Server-Side Template Injection

flask-reuploaded Updated 25 Feb 2026

Summary

25/02/2026
Yes i
Critical
9.8

CVE-2026-27641: Flask-Reuploaded vulnerable to Remote Code Execution via Server-Side Template Injection. Affects flask-reuploaded versions < 1.5.0. Fixed in 1.5.0. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Penetration testing for web, API and mobile Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

Flask-Reuploaded is a popular extension for Flask that simplifies file uploads. It provides an easy way to handle file uploads while ensuring security and flexibility. However, it has a critical vulnerability that allows remote attackers to exploit the application through Server-Side Template Injection, leading to arbitrary file writes and remote code execution.

Vulnerability Detail

The vulnerability arises from a critical path traversal and extension bypass issue in Flask-Reuploaded. Attackers can manipulate the name parameter to inject malicious code, resulting in unauthorized file writes and potential remote code execution. This vulnerability is particularly dangerous as it can compromise the integrity and confidentiality of the application, allowing attackers to execute arbitrary code on the server.

How To Fix

Latest published version: 1.6.0 as of 22 Oct 2026

pip install --upgrade "flask-reuploaded==1.6.0"

Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.

If you need the minimum change

1.5.0

This is the first release that contains the fix.

pip install --upgrade "flask-reuploaded==1.5.0"

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

If you cannot update the package immediately, consider implementing the following 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.

Here is an example of how to sanitize user input before saving a file:

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)

Conclusion

The Flask-Reuploaded package has a critical vulnerability that allows remote code execution through Server-Side Template Injection. It is essential to update to version 1.5.0 or later to mitigate this risk. If immediate updates are not possible, follow the provided workarounds to secure your application.

See every vulnerability recorded for flask-reuploaded →

Share this vulnerability

FAQ

The CVSS score of this vulnerability is 9.8, indicating a critical severity level.

You can use Vulert to monitor and alert for open-source vulnerabilities in your software. Visit the Vulert playground at Vulert Scanner to check if your application is affected without any signup.

The vulnerability can lead to arbitrary file writes and remote code execution, compromising the security and integrity of the application.

Yes, the vulnerability has been patched in Flask-Reuploaded version 1.5.0. It is recommended to update to this version.

If you cannot update immediately, implement the suggested workarounds to mitigate the risk until you can apply the patch.

Related vulnerabilities

Recent vulnerabilities recorded for flask-reuploaded.

How To Fix

Latest published version: 1.6.0 as of 22 Oct 2026

pip install --upgrade "flask-reuploaded==1.6.0"

Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.

If you need the minimum change

1.5.0

This is the first release that contains the fix.

pip install --upgrade "flask-reuploaded==1.5.0"

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback