8.7high
Starlette Denial of service (DoS) via multipart/form-data
- Severity
- 8.7high CVSS:4.0 by GitHub_M
- Exploit likelihood
- 0.92% (higher than 59% of CVEs)
- Published
- Last changed
- Assigned by
- GitHub_M
- Also known as
- GHSA-f96h-pmfr-66vwPYSEC-2026-1943
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
| Product or package | Versions | Reported by |
|---|---|---|
| encode starlette | < 0.40.0, before 0.40.0 | CVE List |
| starlette (PyPI) | before 0.40.0 | GitHub Advisory Database, PyPA Advisory Database |
All scores
| GitHub_M | 8.7high CVSS:4.0 | 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 |
| GitHub | 0.0high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:N |
| GitHub | high CVSS:4.0 | 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 |
| PyPA Advisory Database | 0.0none CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:N |
| PyPA Advisory Database | Not scored CVSS:4.0 | 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 |
Classification
SSVC (CISA-ADP): exploitation poc, automatable yes, technical impact partial.
What each source says
CVE List
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.
GitHub Advisory Database
Summary
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.
PoC
from starlette.applications import Starlette
from starlette.routing import Route
async def poc(request):
async with request.form():
pass
app = Starlette(routes=[
Route('/', poc, methods=["POST"]),
])
curl http://localhost:8000 -F 'big=</dev/urandom'
Impact
This Denial of service (DoS) vulnerability affects all applications built with Starlette (or FastAPI) accepting form requests.
NVD (es)
Starlette es un conjunto de herramientas/marco de interfaz de puerta de enlace de servidor asincrónico (ASGI). Antes de la versión 0.40.0, Starlette trata las partes `multipart/form-data` sin un `filename` como campos de formulario de texto y las almacena en búfer en cadenas de bytes sin límite de tamaño. Esto permite a un atacante cargar campos de formulario arbitrarios de gran tamaño y hacer que Starlette se ralentice significativamente debido a asignaciones de memoria excesivas y operaciones de copia, y también consuma cada vez más memoria hasta que el servidor comienza a intercambiar y se detiene, o el sistema operativo finaliza el proceso del servidor con un error OOM. Cargar múltiples solicitudes de este tipo en paralelo puede ser suficiente para dejar un servicio prácticamente inutilizable, incluso si se aplican límites de tamaño de solicitud razonables mediante un proxy inverso frente a Starlette. Esta vulnerabilidad de denegación de servicio (DoS) afecta a todas las aplicaciones creadas con Starlette (o FastAPI) que aceptan solicitudes de formulario. La versión 0.40.0 corrige este problema.
References
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2024-47874 changed 2024-11-21 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-f96h-pmfr-66vw changed 2026-09-10 | CC-BY-4.0 |
| NVD | CVE-2024-47874 changed 2026-06-17 | Public domain |
| PyPA Advisory Database | PYSEC-2026-1943 changed 2026-07-07 | CC-BY-4.0 |