Vulnerability · Published Oct 15, 2024 · Assigned by GitHub_M
CVE-2024-47874Starlette Denial of service (DoS) via multipart/form-data
High 8.7
In plain English
A high-severity resource allocation without limits in starlette from encode. Proof-of-concept exploit code is public. The chance it is exploited in the next 30 days is estimated at 0.7% (higher than 51% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.
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.
Affected packages & fixed versions
| Ecosystem | Package | Fixed in | Advisory |
|---|---|---|---|
| Debian:12 | starlette | 0.26.1-1+deb12u1 | DEBIAN-CVE-2024-47874 |
| Debian:13 | starlette | 0.41.0-1 | DEBIAN-CVE-2024-47874 |
| Debian:14 | starlette | 0.41.0-1 | DEBIAN-CVE-2024-47874 |
| PyPI | starlette | 0.40.0 | PYSEC-2026-1943 |
| PyPI | starlette | 0.40.0 | GHSA-f96h-pmfr-66vw |
| Ubuntu:22.04:LTS | starlette | no fix listed | UBUNTU-CVE-2024-47874 |
| Ubuntu:24.04:LTS | starlette | no fix listed | UBUNTU-CVE-2024-47874 |
Affected products (as reported)
Weakness: CWE-770 · Vector: CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N