MultipartParser denial of service with too many fields or files
Published 14 Feb 2023 · Updated 8 Jul 2026
Is your project on an affected starlette?
Look after several Python apps? Indie watches up to 15 repos, private ones too, for $5 a month. See Indie
Affected package
- Affected
- <0.25.0
- Fixed in
- 0.25.0
pip install 'starlette>=0.25.0'Details
Impact
The MultipartParser using the package python-multipart accepts an unlimited number of multipart parts (form fields or files).
Processing too many parts results in high CPU usage and high memory usage, eventually leading to an <abbr title="out of memory">OOM</abbr> process kill.
This can be triggered by sending too many small form fields with no content, or too many empty files.
For this to take effect application code has to:
- Have
python-multipartinstalled and - call
request.form() - or via another framework like FastAPI, using form field parameters or
UploadFileparameters, which in turn callsrequest.form().
Patches
The vulnerability is solved in Starlette 0.25.0 by making the maximum fields and files customizable and with a sensible default (1000).
Applications will be secure by just upgrading their Starlette version to 0.25.0 (or FastAPI to 0.92.0).
If application code needs to customize the new max field and file number, there are new request.form() parameters (with the default values):
max_files=1000max_fields=1000
Workarounds
Applications that don't install python-multipart or that don't use form fields are safe.
In older versions, it's also possible to instead of calling request.form() call request.stream() and parse the form data in internal code.
In most cases, the best solution is to upgrade the Starlette version.
References
This was reported in private by @das7pad via internal email. He also coordinated the fix across multiple frameworks and parsers.
The details about how multipart/form-data is structured and parsed are in the RFC 7578.
Is GHSA-74m5-2c7w-9w3x 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
References
- Linkgithub.com/encode/starlette/security/advisories/GHSA-74m5-2c7w-9w3x
- Advisorynvd.nist.gov/vuln/detail/CVE-2023-30798
- Linkgithub.com/encode/starlette/commit/8c74c2c8dba7030154f8af18e016136bea1938fa
- Packagegithub.com/encode/starlette
- Linkgithub.com/pypa/advisory-database/tree/main/vulns/starlette/PYSEC-2023-48.yaml
- Linkvulncheck.com/advisories/starlette-multipartparser-dos
Advisory data from OSV.dev (opens OSV.dev in a new tab), refreshed daily.