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

Medium 5.3 Published Updated

Attackers can cause denial of service by uploading large files, blocking the main thread and preventing new connections in Starlette applications.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
Not needed
Fix
Available

What is CVE-2025-54121?

CVE-2025-54121 is a medium-severity denial of service vulnerability in encode starlette, published on 21 Jul 2025. An attacker can exploit it over the internet without logging in, with no action from the victim.

Official description

Starlette is a lightweight ASGI (Asynchronous Server Gateway Interface) framework/toolkit, designed for building async web services in Python. In versions 0.47.1 and below, when parsing a multi-part form with large files (greater than the default max spool size) starlette will block the main thread to roll the file over to disk. This blocks the event thread which means the application can't accept new connections. The UploadFile code has a minor bug where instead of just checking for self._in_memory, the logic should also check if the additional bytes will cause a rollover. The vulnerability is fixed in version 0.47.2.

Weakness: CWE-770

Which versions are affected by CVE-2025-54121?

3 open source packages ship an affected version, including starlette.

PackageAffectedFixed in
starlette PyPIAll versions0.47.2
starlette PyPIAll versions0.47.2
starlette PyPIAll versions0.47.2
Linux distribution packages (2)
python-starlette openSUSE:Leap 15.6All versions0.35.1-150600.3.6.1
python-starlette openSUSE:TumbleweedAll versions0.47.2-1.1

How do I fix CVE-2025-54121?

Upgrade starlette to 0.47.2 or later.

Upgrade, then put limits on request size, rate and nesting depth so one client cannot exhaust the service. More about Denial of service.

Is CVE-2025-54121 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2025-54121 exists.

Sources

Also known as CLEANSTART-2026-YZ00893, CLSA-2025-1764115957, CLSA-2025-1764288754, DEBIAN-CVE-2025-54121, GHSA-2c2j-9gv5-cj73, MINI-mfg9-9m76-wmxh and 5 more.

Is CVE-2025-54121 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free