Vulnerabilities in pkg:pypi/flask-reuploaded

PACKAGE
Advisory Identifier: GHSA-65mp-fq8v-56jr
Advisory Summary

CVE-2026-27641 is a CRITICAL (CVSS 9.8) remote code execution vulnerability (CWE-1336: Improper Neutralization of Special Elements Used in a Template Engine) affecting Flask reuploaded libraries in the PyPI ecosystem. The issue involves flask-reuploaded vulnerable to remote code execution via server-side template injection. Remediation is available by upgrading affected packages to version 1.5.0.

1 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:pypi/flask-reuploaded

1 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:pypi/flask-reuploaded. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-65mp-fq8v-56jr CVE-2026-27641 CRITICAL Flask-Reuploaded vulnerable to Remote Code Execution via Server-Side Template Injection

CVE-2026-27641 at a Glance

CVE Identifier CVE-2026-27641
GHSA Identifier GHSA-65mp-fq8v-56jr
Severity CRITICAL
CVSS v3.1 Base Score 9.8
CWE Classification CWE-1336: Improper Neutralization of Special Elements Used in a Template Engine
Affected Product Flask reuploaded
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 9.8

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity High (I:H)
Availability High (A:H)

How to Fix CVE-2026-27641

To remediate this vulnerability, upgrade all affected Flask reuploaded dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

flask-reuploaded fixed: 1.5.0
pip install flask-reuploaded>=1.5.0
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

pip show flask-reuploaded

How to Check if You Are Affected

To determine whether your Python environment is affected by CVE-2026-27641, inspect your installed packages using pip:

pip show flask-reuploaded

Analyze the terminal output to locate any version of Flask reuploaded in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.5.0), your application is affected.

Note: The pip show flask-reuploaded command checks currently installed packages in your active Python environment.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-1336: Improper Neutralization of Special Elements Used in a Template Engine, where the product uses a template engine to insert or process externally-influenced input, but it does not neutralize or incorrectly neutralizes special elements or syntax that can be interpreted as template expressions or other code directives when processed by the engine. In Flask reuploaded, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

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

CVE-2026-27641 Affected Flask reuploaded Versions

1 component(s)
Fixed Versions:
1.5.0
Product / Package Ecosystem Affected Versions Fixed Version
flask-reuploaded
PyPI
< 1.5.0
1.5.0

References

Frequently Asked Questions

What is CVE-2026-27641?
CVE-2026-27641 is a security vulnerability in Flask reuploaded involving Flask-Reuploaded vulnerable to Remote Code Execution via Server-Side Template Injection under CWE-1336: Improper Neutralization of Special Elements Used in a Template Engine.
Which Flask reuploaded versions are affected?
Affected versions include releases prior to 1.5.0 across affected packages: flask-reuploaded.
What version fixes CVE-2026-27641?
Upgrading to 1.5.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is flask-reuploaded affected?
Yes, flask-reuploaded is affected in releases prior to 1.5.0. Upgrade your dependency to 1.5.0 or later.
What is the CVSS score of CVE-2026-27641?
CVE-2026-27641 has a CVSS v3.1 base score of 9.8 (CRITICAL) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H.
What CWE is associated with CVE-2026-27641?
CVE-2026-27641 is classified under CWE-1336: Improper Neutralization of Special Elements Used in a Template Engine (The product uses a template engine to insert or process externally-influenced input, but it does not neutralize or incorrectly neutralizes special elements or syntax that can be interpreted as template expressions or other code directives when processed by the engine.).
How can I check PyPI dependencies for CVE-2026-27641?
Run the dependency tree command: 'pip show flask-reuploaded'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-65mp-fq8v-56jr",
  "modified" : "2026-02-25T19:06:50Z",
  "published" : "2026-02-25T19:06:50Z",
  "aliases" : [ "CVE-2026-27641" ],
  "summary" : "Flask-Reuploaded vulnerable to Remote Code Execution via Server-Side Template Injection",
  "details" : "### Impact\nA 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).\n\n### Patches\nFlask-Reuploaded has been patched in version 1.5.0\n\n### Workarounds\n\n1. **Do not pass user input to the `name` parameter**\n2. Use auto-generated filenames only\n3. Implement strict input validation if `name` must be used\n\n```python\nfrom werkzeug.utils import secure_filename\nimport os\n\n# Sanitize user input before passing to save()\nsafe_name = secure_filename(request.form.get('custom_name'))\n# Remove path separators\nsafe_name = os.path.basename(safe_name)\n# Validate extension matches policy\nif not photos.extension_allowed(photos.get_extension(safe_name)):\n    abort(400)\n    \nfilename = photos.save(file, name=safe_name)\n```\n\n### Resources\nThe fix is documented in the pull request, see https://github.com/jugmac00/flask-reuploaded/pull/180.\n\nA 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.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "flask-reuploaded"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.5.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/jugmac00/flask-reuploaded/security/advisories/GHSA-65mp-fq8v-56jr"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-27641"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/jugmac00/flask-reuploaded/pull/180"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/jugmac00/flask-reuploaded/commit/d64c6b2f71cb73734fc38baa0e3e156926361288"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/jugmac00/flask-reuploaded"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-1336", "CWE-22" ],
    "severity" : "CRITICAL",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-02-25T19:06:50Z",
    "nvd_published_at" : "2026-02-25T04:16:04Z"
  }
}