CVE-2025-54121: encode starlette · Unthrottled Resource Allocation
Affects encode starletteSource CVE Database V5
Not known to be exploited · CVSS 5.3 Medium : upgrade to 0.47.2 when convenient.
Data as of 25 Oct 2026, 19:02 UTC
- EPSS
- 0.6% chance of exploitation in 30 days – higher than 51% of CVEsExploit Prediction Scoring System: the likelihood attackers will use this flaw soon.
- Patch
- Available – fixed in 0.47.2
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:LExploitation evidence
Disclosed: evidence found.
CVE published 21 Jul 2025
Detectable: no evidence on record.
No public nuclei template indexed
Weaponised: no evidence on record.
No public exploit code indexed in Metasploit or Exploit-DB
Exploited in the wildExploited: no evidence on record.
Not in CISA KEV and no source reports exploitation
Observed by OffSeq MirageSeen by Mirage: no evidence on record.
No attack traffic recorded by OffSeq Mirage sensors
A missing step is not evidence of safety. Sources: cve.org (opens in a new tab), the Metasploit, Exploit-DB and nuclei-templates index as of 2026-10-25.
What to do
Upgrade encode starlette to 0.47.2.
Affected software
| Product | Affected | Fixed in |
|---|---|---|
PyPIstarlettepkg:pypi/starletteOther threats | Affected
| Fixed in
|
Check your own hosts for these packages with threat-finder (opens in a new tab), our free open-source scanner.
AI-suggested
European organizations should immediately assess their use of the Starlette framework and identify any deployments running versions below 0.47.2. The primary mitigation is to upgrade Starlette to version 0.47.2 or later, where the bug in the UploadFile rollover logic is fixed. In addition to patching, organizations should implement the following practical controls: 1) Enforce strict limits on maximum file upload sizes at the application or web server level to prevent excessively large uploads that trigger rollover blocking. 2) Implement asynchronous or background processing for large file uploads to avoid blocking the main event loop. 3) Monitor application performance metrics and event loop responsiveness to detect abnormal blocking or slowdowns indicative of exploitation attempts. 4) Use web application firewalls (WAFs) or API gateways to throttle or block suspicious large multipart/form-data requests. 5) Conduct regular dependency audits and integrate automated vulnerability scanning in CI/CD pipelines to detect outdated Starlette versions. These measures collectively reduce the risk of denial-of-service attacks exploiting this vulnerability and improve overall resilience of asynchronous Python web services.
Description
Starlette is a lightweight ASGI (Asynchronous Server Gateway Interface) framework/toolkit, designed for building async web services in Python. In versions 0.47.1 and below, when parsing a multi-part form with large files (greater than the default max spool size) starlette will block the main thread to roll the file over to disk. This blocks the event thread which means the application can't accept new connections. The UploadFile code has a minor bug where instead of just checking for self._in_memory, the logic should also check if the additional bytes will cause a rollover. The vulnerability is fixed in version 0.47.2.
References
- github.com/encode/starlette/security/advisories/GHSA-2c2j-9gv5-cj73 (opens in a new tab)
- github.com/encode/starlette/commit/9f7ec2eb512fcc3fe90b43cb9dd9e1d08696bec1 (opens in a new tab)
- github.com/encode/starlette/blob/fa5355442753f794965ae1af0f87f9fec1b9a3de/starlette/datastructures.py (opens in a new tab)
- github.com/encode/starlette/discussions/2927 (opens in a new tab)