All vulnerabilities
CVE-2026-27641GHSA-65mp-fq8v-56jrPYSEC-2026-341

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

jugmac00 flask-reuploadedpipFrameworks
CVSS
9.8Critical
ExploitationNo known exploitationNot in CISA KEV, which does not prove it is unexploitedCISA KEV
Exploit odds (EPSS)1.34%Chance of exploitation activity in the next 30 days, higher than 71% of CVEs. Scored 27 Oct 2026FIRST EPSS
Fixed in1.5.0Fixed versionGitHub
Published25 Feb 2026Updated 27 Oct 2026CVE List

What fixes it

  • 1.5.0flask-reuploaded, pipGitHub
  • 1.5.0flask-reuploaded, PyPIOSVpip install "flask-reuploaded>=1.5.0"

A fixed version on one release line is not the upgrade target for every line. Check your exact version and any vendor backports.

Description

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
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.

Text from GitHub Advisory Database

Affected versions 13

  • flask-reuploaded, pip< 1.5.0GitHub
  • flask-reuploadedaffected: < 1.5.0CVE List
  • flask-reuploaded, PyPIfrom first release, fixed in 1.5.0OSV
  • flask-reuploaded, PyPI0.3OSV
  • flask-reuploaded, PyPI0.3.1OSV
  • flask-reuploaded, PyPI0.3.2OSV
  • flask-reuploaded, PyPI0.4.0OSV
  • flask-reuploaded, PyPI0.5.0OSV
  • flask-reuploaded, PyPI1.0.0OSV
  • flask-reuploaded, PyPI1.1.0OSV
  • flask-reuploaded, PyPI1.2.0OSV
  • flask-reuploaded, PyPI1.3.0OSV
  • flask-reuploaded, PyPI1.4.0OSV

References 7