CVE-2025-54121: PYSEC-2026-1941 - Starlette has possible denial-of-service vector when parsing large files in multipart forms

CVE-2025-54121 · Severity: low · CVSS 3.1 · Published 2026-07-07

Starlette is a lightweight Python web framework used to build high-performance web APIs and applications. When processing multipart form submissions containing large files, the framework can block its main event thread during file operations, preventing it from accepting new incoming connections and causing a temporary denial of service.

Technologies: starlette (PyPI). Vendors: PyPI.

Quick answers

Is CVE-2025-54121 exploited in the wild?
No. Junglewise Threat Intelligence has no report of CVE-2025-54121 being exploited in the wild.
How severe is CVE-2025-54121?
Low severity, with a CVSS score of 3.1, published 7 July 2026.
Which products and versions are affected?
starlette (PyPI) ECOSYSTEM:introduced=0,fixed=0.47.2.
Is there a fix for CVE-2025-54121?
Yes. starlette (PyPI): upgrade to 0.47.2 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
How is CVE-2025-54121 attacked?
It is attacked over the network, in a software library.
Am I affected by CVE-2025-54121?
Check whether you run starlette (PyPI) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

How to fix

  • starlette (PyPI): upgrade to 0.47.2 or later
    pip install "starlette>=0.47.2"

Technical details

The vulnerability exists in Starlette's UploadFile class, which handles multipart form file uploads. When a file exceeds the default in-memory spool size, the code should check whether additional incoming data will trigger a rollover to disk before writing, but instead only checks the current state. This causes blocking disk I/O operations to execute on the main thread instead of a threadpool, stalling the async event loop. The vulnerability affects all versions prior to 0.47.2. The attack requires sending multipart form data with large files but no special privileges or authentication; the impact on modern storage systems is minimal, though systems with slower I/O may experience more noticeable delays.

Affected products

  • Encode Starlette before 0.47.2

Identifiers

  • CVE-2025-54121
  • GHSA-2c2j-9gv5-cj73
  • PYSEC-2026-1941

Timeline

  • 2025-07-21: disclosed
  • 2025-07-21: patched: Fixed in version 0.47.2

References

This page as Markdown. Free to reuse under CC BY 4.0 with a link back.