/

CVE-2026-54567

Severity:

HIGH RISK

(7.5)

Case-Sensitive Extension Bypass (CWE-178) in Flask-Reuploaded

CVE-2026-54567

Deferred

Vulnerability type

Category:

Improper Case Handling

CWE:

CWE-178, CWE-434

Impact:

Unrestricted File Upload and Potential Remote Code Execution

Severity:

HIGH RISK

(7.5)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

Flask-Reuploaded can incorrectly evaluate caller-supplied upload names with case-sensitive extension handling, allowing a dangerous mixed-case extension to bypass a lowercase denylist.

If the uploaded file is stored in a web-served directory and the deployment resolves or executes extensions case-insensitively, an attacker may execute the file with the web server's privileges.

Affected context

The issue affects Flask-Reuploaded configurations that use UploadSet.save() with a caller-controlled name override and an AllExcept extension denylist. It becomes risky when uploaded content is placed in a served directory and the surrounding web server or runtime treats extension casing case-insensitively. Pure extension allowlists and deployments that do not execute uploaded files are generally less exposed.

Exploit preconditions

  • Attack surface: File-upload functionality using Flask-Reuploaded
  • Required access: Ability to submit an upload and influence the caller-supplied filename
  • Trigger point: Extension validation during UploadSet.save(storage, name=...)
  • Required configuration: A denylist-based AllExcept policy using lowercase dangerous extensions
  • Deployment condition: The upload directory is web-served and the server or runtime resolves or executes extensions without case sensitivity
  • Why exploitation is possible: The supplied name uses case-preserving extension handling while the denylist comparison expects lowercase values

Why this happens

The vulnerability results from inconsistent canonicalization of file extensions. The default upload path applies lowercase normalization, but a caller-supplied name retains extension casing before it is evaluated against an AllExcept denylist.

A mixed-case dangerous extension can therefore evade a case-sensitive comparison even though it represents the same effective extension to a case-insensitive web server. This maps primarily to CWE-178: Improper Handling of Case Sensitivity and is also related to CWE-434: Unrestricted Upload of File with Dangerous Type.

Potential impact

  • An attacker could store a file with a dangerous executable extension in a served upload directory.
  • The uploaded file could execute with the web server's privileges.
  • Confidentiality, integrity, and availability of the application or host could be affected.
  • The issue could enable follow-on compromise depending on process permissions and deployment isolation.

General mitigation guidance

Mitigation generally focuses on eliminating inconsistent filename normalization and reducing trust in client-controlled names.

Common defensive patterns include:

  • Canonicalizing extensions using a consistent, case-insensitive policy before validation.
  • Preferencing strict allowlists of permitted file types over denylist-only controls.
  • Generating server-side storage names rather than preserving user-supplied names.
  • Storing uploads outside web-served and execution-capable directories.
  • Serving uploaded content with non-executable content-disposition and restrictive response policies.
  • Applying least privilege to the web server and upload-processing processes.
  • Validating file content and format independently of the filename extension.

How teams detect issues like this

Detection approaches can include:

  • Static analysis for extension checks that compare unnormalized user-controlled strings against denylist entries.
  • Code review of upload APIs that accept caller-supplied storage names or preserve filename extensions.
  • Tests covering mixed-case variants of blocked extensions and different upload storage paths.
  • Policy enforcement requiring allowlists, canonicalization, and non-executable upload locations.
  • Runtime monitoring for executable content, unexpected extension variants, or process execution from upload directories.

Automated security review tools can help identify inconsistent normalization and dangerous file-upload patterns.

Sources

SourceLink
github.comgithub.com/jugmac00/flask-reuploaded/commit/5ded76092429c6eb8a4af941b14fbde40a38fff4
github.comgithub.com/jugmac00/flask-reuploaded/pull/186
github.comgithub.com/jugmac00/flask-reuploaded/security/advisories/GHSA-937x-gpqr-72gg

Frequently asked

questions

It can be exploitable through a network-facing upload feature when an attacker can control the supplied filename, the application uses the affected denylist configuration, and the deployment serves or executes the resulting file.

Authentication requirements depend on the application's upload endpoint. The attacker must have whatever access is required to submit an upload and influence the name override.

Normalize extension casing before every comparison, prefer a strict allowlist, generate server-controlled filenames, and keep uploaded content outside execution-capable web directories.

Treat filenames as untrusted metadata, test case variations during security review, validate file content separately, and enforce least privilege and non-executable upload storage.

Find out what's already
exploitable in your codebase.