CVE-2024-47874 Starlette Denial of service (DoS) via multipart/form-data

High 8.7 Published Updated

Attackers can cause denial of service in Starlette applications by sending large multipart form fields, exhausting server memory.

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

What is CVE-2024-47874?

CVE-2024-47874 is a high-severity denial of service vulnerability in encode starlette, published on 15 Oct 2024. An attacker can exploit it over the internet without logging in, with no action from the victim.

Official description

Starlette is an Asynchronous Server Gateway Interface (ASGI) framework/toolkit. Prior to version 0.40.0, Starlette treats `multipart/form-data` parts without a `filename` as text form fields and buffers those in byte strings with no size limit. This allows an attacker to upload arbitrary large form fields and cause Starlette to both slow down significantly due to excessive memory allocations and copy operations, and also consume more and more memory until the server starts swapping and grinds to a halt, or the OS terminates the server process with an OOM error. Uploading multiple such requests in parallel may be enough to render a service practically unusable, even if reasonable request size limits are enforced by a reverse proxy in front of Starlette. This Denial of service (DoS) vulnerability affects all applications built with Starlette (or FastAPI) accepting form requests. Verison 0.40.0 fixes this issue.

Weakness: CWE-770

Which versions are affected by CVE-2024-47874?

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

PackageAffectedFixed in
starlette PyPIAll versions0.40.0
starlette PyPIAll versions0.40.0
starlette PyPIAll versions0.40.0
Linux distribution packages (3)
python-starlette openSUSE:Leap 15.6All versions0.35.1-150600.3.3.1
python-starlette openSUSE:TumbleweedAll versions0.41.0-1.1
python-starlette openSUSE:TumbleweedAll versions1.6.0-1.1

How do I fix CVE-2024-47874?

Upgrade starlette to 0.40.0 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-2024-47874 being exploited?

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

Sources

Also known as CLSA-2025-1757031156, CVE-2024-12868, DEBIAN-CVE-2024-47874, GHSA-f96h-pmfr-66vw, PYSEC-2026-1943, ROOT-APP-PYPI-CVE-2024-47874 and 4 more.

Is CVE-2024-47874 in your software?

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

Check your SBOMs for free