CVE-2024-47874Starlette Denial of service (DoS) via multipart/form-data
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.
What to do
Fixed builds are available from Debian, PyPI: see the table below for the fixed version per release.
Ubuntu has not shipped a fix for every release yet.
Is your server affected? One read-only command checks every installed package against this CVE and all others, using each vendor's fixed versions. Get started or get a free API key.
curl -sS "https://api.cvefocus.com/v1/check?format=text" -H "Authorization: Bearer $CVEFOCUS_KEY" \ -H "Content-Type: text/plain" --data-binary @inventory.txt
Vendor status at a glance
Status by vendor and release
From each vendor's own security data and VEX statements. "Fixed" means a fixed build is published for that release.
| Release | Package | Status | Fixed version | Advisory |
|---|---|---|---|---|
| Ubuntu 26.04 | starlette | Not affected vulnerable_code_not_present | ||
| Ubuntu 25.10 | starlette | Not affected vulnerable_code_not_present | ||
| Ubuntu 24.04 | starlette | Under investigation | UBUNTU-CVE-2024-47874 | |
| Ubuntu 22.04 | starlette | Under investigation | UBUNTU-CVE-2024-47874 | |
| Debian 14 | starlette | Fixed | 0.41.0-1 | DEBIAN-CVE-2024-47874 |
| Debian 13 | starlette | Fixed | 0.41.0-1 | DEBIAN-CVE-2024-47874 |
| Debian 12 | starlette | Fixed | 0.26.1-1+deb12u1 | DEBIAN-CVE-2024-47874 |
| PyPI library | starlette | Fixed | 0.40.0 | GHSA-f96h-pmfr-66vw |
What the vendor says
As published in the CVE record by GitHub_M, the CVE's assigner (usually the vendor). Check the vendor's advisory before acting.
- encode starlette: affected: < 0.40.0
References
- https://github.com/encode/starlette/security/advisories/GHSA-f96h-pmfr-66vw
- https://github.com/encode/starlette/commit/fd038f3070c302bff17ef7d173dbb0b007617733
About this page
Compiled by CVEfocus from the CVE List, the security data and VEX statements of Ubuntu, Debian, Red Hat, AlmaLinux, Rocky Linux and Microsoft, CISA's Known Exploited Vulnerabilities catalog and FIRST EPSS, refreshed several times a day (data status). Information only; see the disclaimer. Official record: cve.org · NVD.