High

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

  • Disclosed: 15.10.2024
  • Updated: 11.10.2026 15:17

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

python
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"]),
])
bash
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.

Affected software

Click a technology to see all vulnerabilities affecting it.

PlatformPackageVulnerable versionsFixed in
Python (PyPI) starlette < 0.40.0 0.40.0

References

CVSS score 0
CVSS vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:N
Weakness (CWE)
CWE-770
Platform
Python (PyPI)
Package
starlette
Disclosed
15.10.2024
Updated
11.10.2026 15:17

Sources and licenses

OSV / GitHub Advisory Database - PYSEC-2026-1943 - PyPA Advisory Database; CC BY 4.0

OSV / GitHub Advisory Database - GHSA-f96h-pmfr-66vw - CC BY 4.0

Vulnerability history: starlette

All published vulnerabilities of this package (Python (PyPI)), newest first. Shows whether this is a one-off slip or a package that needs watching.

All (10) in the archive
Total entries
10
First → latest
02.2023 06.2026
Without a fix
0
Exploited in attacks
1

Severity breakdown

  • High 5
  • Medium 4
  • Low 1

Disclosures per year

  1. 2023: 2
  2. 2024: 1
  3. 2025: 2
  4. 2026: 5
Severity:
  1. Starlette Denial of service (DoS) via multipart/form-data this entry
    High · 0.0 CVE-2024-47874 < 0.40.0 0.40.0
  2. High · 7.5 CVE-2023-30798 < 0.25.0 0.25.0

Know which vulnerabilities affect your application

With the DockRay integration and software inventory enabled, DockRay checks reported component versions against known vulnerabilities and notifies you about confirmed matches. Coverage depends on the supported technology and available advisory data.

Connect your application
DockRay newsletter

Application security in your inbox

Important vulnerabilities, actionable guidance and practical advice for your applications. Choose your technologies and follow what matters to your project.

  • A daily digest of new vulnerabilities, critical ones included.
  • Notifications about important updates.
  • Practical advice on application security and monitoring.

Leave empty to receive updates for every technology.

Free to subscribe. Unsubscribe with one click in any email.