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.

Severity (CVSS 4.0)8.7High
Exploit odds (30 days)0.7%top 48.5% of all CVEs
Exploited in the wildNo reportsCISA SSVC: poc
Attack toolingNoneno public tooling known

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

EcosystemPackageFixed inAdvisory
Debian:12starlette0.26.1-1+deb12u1DEBIAN-CVE-2024-47874
Debian:13starlette0.41.0-1DEBIAN-CVE-2024-47874
Debian:14starlette0.41.0-1DEBIAN-CVE-2024-47874
PyPIstarlette0.40.0PYSEC-2026-1943
PyPIstarlette0.40.0GHSA-f96h-pmfr-66vw
Ubuntu:22.04:LTSstarletteno fix listedUBUNTU-CVE-2024-47874
Ubuntu:24.04:LTSstarletteno fix listedUBUNTU-CVE-2024-47874

Affected products (as reported)

VendorProductVersions
encode starlette < 0.40.0

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

References