HighGHSA-f96h-pmfr-66vwCVE-2024-47874PYSEC-2026-1943

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

Published 15 Oct 2024 · Updated 10 Sept 2026

Is your project on an affected starlette?

Private repo? Upload its lockfile instead, or connect GitHub to check every repo.

Look after several Python apps? Indie watches up to 15 repos, private ones too, for $5 a month. See Indie

Affected package

Affected
<0.40.0
Fixed in
0.40.0
Update to the fixed version for your release line, for example:pip install 'starlette>=0.40.0'

Details

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.

Is GHSA-f96h-pmfr-66vw in any of your client repos?

Checking one package by hand is fine. Checking it across forty client projects is not. NPMscan reads the lockfiles in every GitHub repo you pick, finds each project with an affected starlette, and gives you the command that fixes it.

More advisories for starlette

  • HighCVE-2026-54283Starlette: request.form() limits silently ignored for application/x-www-form-urlencoded enable DoS · 15 Jun 2026
  • LowCVE-2026-54282Starlette: Unvalidated request path concatenated into authority poisons request.url.hostname · 15 Jun 2026
  • HighCVE-2026-48818Starlette: SSRF and NTLM credential theft via UNC paths in StaticFiles on Windows · 15 Jun 2026
  • MediumCVE-2026-48817Starlette: Arbitrary HTTP method dispatched to `HTTPEndpoint` attributes via `getattr` · 15 Jun 2026
  • MediumCVE-2026-48710Starlette has missing Host header validation that poisons request.url.path, bypassing path-based security checks · 4 Jun 2026
  • HighCVE-2025-62727Starlette vulnerable to O(n^2) DoS via Range header merging in ``starlette.responses.FileResponse`` · 28 Oct 2025
All 10 advisories for starlette

References

Advisory data from OSV.dev (opens OSV.dev in a new tab), refreshed daily.