CVE-2025-54121
Starlette has possible denial-of-service vector when parsing large files in multipart forms
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.
Attack profile
How easy it is to exploit
- Attack vector
- Network
- Complexity
- Low
- Privileges needed
- None
- User interaction
- None
What an attacker can affect
- Confidentiality
- None
- Integrity
- None
- Availability
- Low
Exploit likelihood
What each source reports
CVE List Score used
5.3
Starlette has possible denial-of-service vector when parsing large files in multipart forms
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.
- Record
CVE-2025-54121- CVSS 3.1
- 5.3 Medium
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L - Weakness
- CWE-770
- Updated
- 2026-11-02
EUVDEUVD-2025-22159
5.3
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.
- Record
EUVD-2025-22159- CVSS 3.1
- 5.3 Medium
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L - Updated
- 2026-11-02
GitHub AdvisoriesGHSA-2c2j-9gv5-cj73
5.3
Starlette has possible denial-of-service vector when parsing large files in multipart forms
Summary
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 we can't accept new connections.
Details
Please see this discussion for details: https://github.com/encode/starlette/discussions/2927#discussioncomment-13721403. In summary the following UploadFile code (copied from here) has a minor bug. Instead of just checking for self._in_memory we should also check if the additional bytes will cause a rollover.
@property
def _in_memory(self) -> bool:
# check for SpooledTemporaryFile._rolled
rolled_to_disk = getattr(self.file, "_rolled", True)
return not rolled_to_disk
async def write(self, data: bytes) -> None:
if self.size is not None:
self.size += len(data)
if self._in_memory:
self.file.write(data)
else:
await run_in_threadpool(self.file.write, data)
I have already created a PR which fixes the problem: https://github.com/encode/starlette/pull/2962
PoC
See the discussion here for steps on how to reproduce.
Impact
To be honest, very low and not many users will be impacted. Parsing large forms is already CPU intensive so the additional IO block doesn't slow down starlette that much on systems with modern HDDs/SSDs. If someone is running on tape they might see a greater impact.
- Record
GHSA-2c2j-9gv5-cj73- CVSS 3.1
- 5.3 Medium
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L - Weakness
- CWE-770
- Updated
- 2026-11-02
NVD
5.3
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.
- Record
CVE-2025-54121- CVSS 3.1
- 5.3 Medium
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L - Weakness
- CWE-770
- Updated
- 2026-11-02
OSV
5.3
Starlette has possible denial-of-service vector when parsing large files in multipart forms
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.
- Record
CVE-2025-54121- CVSS 3.1
- 5.3 Medium
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L - Weakness
- CWE-770
- Updated
- 2026-11-02
OSVDEBIAN-CVE-2025-54121
5.3
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.
- Record
DEBIAN-CVE-2025-54121- CVSS 3.1
- 5.3 Medium
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L - Updated
- 2026-11-02
Show 11 moreShow less
OSVGHSA-2c2j-9gv5-cj73
5.3
Starlette has possible denial-of-service vector when parsing large files in multipart forms
Summary
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 we can't accept new connections.
Details
Please see this discussion for details: https://github.com/encode/starlette/discussions/2927#discussioncomment-13721403. In summary the following UploadFile code (copied from here) has a minor bug. Instead of just checking for self._in_memory we should also check if the additional bytes will cause a rollover.
@property
def _in_memory(self) -> bool:
# check for SpooledTemporaryFile._rolled
rolled_to_disk = getattr(self.file, "_rolled", True)
return not rolled_to_disk
async def write(self, data: bytes) -> None:
if self.size is not None:
self.size += len(data)
if self._in_memory:
self.file.write(data)
else:
await run_in_threadpool(self.file.write, data)
I have already created a PR which fixes the problem: https://github.com/encode/starlette/pull/2962
PoC
See the discussion here for steps on how to reproduce.
Impact
To be honest, very low and not many users will be impacted. Parsing large forms is already CPU intensive so the additional IO block doesn't slow down starlette that much on systems with modern HDDs/SSDs. If someone is running on tape they might see a greater impact.
- Record
GHSA-2c2j-9gv5-cj73- CVSS 3.1
- 5.3 Medium
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L - Weakness
- CWE-770
- Updated
- 2026-11-02
OSVPYSEC-2026-1941
5.3
Starlette has possible denial-of-service vector when parsing large files in multipart forms
Summary
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 we can't accept new connections.
Details
Please see this discussion for details: https://github.com/encode/starlette/discussions/2927#discussioncomment-13721403. In summary the following UploadFile code (copied from here) has a minor bug. Instead of just checking for self._in_memory we should also check if the additional bytes will cause a rollover.
@property
def _in_memory(self) -> bool:
# check for SpooledTemporaryFile._rolled
rolled_to_disk = getattr(self.file, "_rolled", True)
return not rolled_to_disk
async def write(self, data: bytes) -> None:
if self.size is not None:
self.size += len(data)
if self._in_memory:
self.file.write(data)
else:
await run_in_threadpool(self.file.write, data)
I have already created a PR which fixes the problem: https://github.com/encode/starlette/pull/2962
PoC
See the discussion here for steps on how to reproduce.
Impact
To be honest, very low and not many users will be impacted. Parsing large forms is already CPU intensive so the additional IO block doesn't slow down starlette that much on systems with modern HDDs/SSDs. If someone is running on tape they might see a greater impact.
- Record
PYSEC-2026-1941- CVSS 3.1
- 5.3 Medium
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L - Updated
- 2026-11-02
OSVROOT-APP-PYPI-CVE-2025-54121
5.3
CVE-2025-54121 in starlette - Patched by Root
Root has patched CVE-2025-54121 in the starlette package for Root:PyPI. Multiple fixed versions available.
- Record
ROOT-APP-PYPI-CVE-2025-54121- CVSS 3.1
- 5.3 Medium
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L - Updated
- 2026-11-02
OSVUBUNTU-CVE-2025-54121
5.3
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.
- Record
UBUNTU-CVE-2025-54121- CVSS 3.1
- 5.3 Medium
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L - Updated
- 2026-11-02
OSVCLSA-2025-1764115957 No score
TuxCare security update for starlette (1 CVE)
TuxCare rebuilt starlette to address 1 CVE. Fixed in 0.27.0.post2+tuxcare.
- Record
CLSA-2025-1764115957- Updated
- 2026-11-02
OSVCLSA-2025-1764288754 No score
TuxCare security update for starlette (1 CVE)
TuxCare rebuilt starlette to address 1 CVE. Fixed in 0.13.6.post1+tuxcare.
- Record
CLSA-2025-1764288754- Updated
- 2026-11-02
OSVCLSA-2026-1789447406 No score
TuxCare security update for starlette (8 CVEs)
TuxCare rebuilt starlette to address 8 CVEs. Fixed in 0.25.0.post1+tuxcare.
- Record
CLSA-2026-1789447406- Updated
- 2026-11-02
OSVopenSUSE-SU-2025:15381-1 No score
python311-starlette-0.47.2-1.1 on GA media
These are all security issues fixed in the python311-starlette-0.47.2-1.1 package on the GA media of openSUSE Tumbleweed.
- Record
openSUSE-SU-2025:15381-1- Updated
- 2026-11-02
OSVopenSUSE-SU-2026:20975-1 No score
Security update for python-starlette
This update for python-starlette fixes the following issues
- CVE-2025-54121: denial-of-service when parsing a multi-part form with large files (bsc#1246855).
- CVE-2025-62727: DoS via Range header merging (bsc#1252805).
- CVE-2026-48710: Missing Host header validation poisons request.url.path, bypassing path-based security checks (bsc#1266369).
- Record
openSUSE-SU-2026:20975-1- Updated
- 2026-11-02
OSVSUSE-SU-2025:02544-1 No score
Security update for python-starlette
This update for python-starlette fixes the following issues:
- CVE-2025-54121: Correctly parse multi-part form with large files to avoid DoS. (bsc#1246855)
- Record
SUSE-SU-2025:02544-1- Updated
- 2026-11-02
OSVSUSE-SU-2026:22151-1 No score
Security update for python-starlette
This update for python-starlette fixes the following issues
- CVE-2025-54121: denial-of-service when parsing a multi-part form with large files (bsc#1246855).
- CVE-2025-62727: DoS via Range header merging (bsc#1252805).
- CVE-2026-48710: Missing Host header validation poisons request.url.path, bypassing path-based security checks (bsc#1266369).
- Record
SUSE-SU-2026:22151-1- Updated
- 2026-11-02
Affected products
Affected packages
| Package | Affected | Fixed |
|---|---|---|
starlettePyPI |
before 0.47.2 | 0.47.2 |
starletteTuxCare:PyPI |
0.27.0 up to 0.27.0.post2+tuxcare, plus listed versions 0.27.0.post1+tuxcare |
0.27.0.post2+tuxcare |
starletteTuxCare:PyPI |
0.13.6 up to 0.13.6.post1+tuxcare | 0.13.6.post1+tuxcare |
starletteTuxCare:PyPI From an advisory covering 8 CVEs |
0.25.0 up to 0.25.0.post1+tuxcare | 0.25.0.post1+tuxcare |
starletteDebian:12 |
before 0.26.1-1+deb12u1, plus listed versions 0.26.1-1 |
0.26.1-1+deb12u1 |
starletteDebian:13 |
before 0.46.1-3 | 0.46.1-3 |
starletteDebian:14 |
before 0.46.1-3 | 0.46.1-3 |
starlettePyPI |
before 0.47.2, plus listed versions 0.1.00.1.10.1.100.1.110.1.12 Show 45 moreShow less0.1.130.1.140.1.150.1.160.1.170.1.20.1.30.1.40.1.50.1.60.1.70.1.80.1.90.10.00.10.10.10.20.10.30.10.40.10.50.10.60.10.70.11.00.11.10.11.20.11.30.11.40.12.00.12.0b10.12.0b20.12.0b30.12.10.12.100.12.110.12.120.12.130.12.20.12.30.12.40.12.50.12.60.12.70.12.80.12.90.13.00.13.1 |
0.47.2 |
starletteRoot:PyPI |
before 0.22.0+aikido.7 | 0.22.0+aikido.70.45.3+aikido.100.45.3+aikido.110.45.3+aikido.50.45.3+aikido.60.45.3+aikido.70.45.3+aikido.80.45.3+aikido.90.47.0+aikido.30.22.0+aikido.30.46.2+aikido.30.46.2+aikido.40.41.3+aikido.60.46.2+aikido.60.45.3+aikido.130.45.3+aikido.140.41.3+aikido.70.46.2+aikido.70.22.0+aikido.50.45.3+aikido.150.22.0+aikido.6 |
rootio-starletteRoot:PyPI |
before 0.22.0+aikido.4 | 0.22.0+aikido.40.45.3+aikido.120.46.2+aikido.50.47.0+aikido.4 |
Show 10 moreShow less
| Package | Affected | Fixed |
|---|---|---|
python-starletteopenSUSE:Leap 15.6 |
before 0.35.1-150600.3.6.1 | 0.35.1-150600.3.6.1 |
python-starletteSUSE:Linux Enterprise Server 16.0 From an advisory covering 3 CVEs |
before 0.41.3-160000.3.1 | 0.41.3-160000.3.1 |
python-starletteSUSE:Linux Enterprise Server for SAP applications 16.0 From an advisory covering 3 CVEs |
before 0.41.3-160000.3.1 | 0.41.3-160000.3.1 |
starletteUbuntu:22.04:LTS |
All versions, plus listed versions 0.14.1-10.16.0-10.18.0-1 |
None known |
starletteUbuntu:24.04:LTS |
All versions, plus listed versions 0.30.0-10.31.1-1 |
None known |
starletteUbuntu:25.10 |
All versions, plus listed versions 0.46.1-20.46.1-3 |
None known |
starletteUbuntu:26.10 |
All versions, plus listed versions 0.50.0-11.1.0-11.3.1-11.7.0-2 |
None known |
starletteUbuntu:26.04:LTS |
All versions, plus listed versions 0.46.1-30.50.0-1 |
None known |
python-starletteopenSUSE:Tumbleweed |
before 0.47.2-1.1 | 0.47.2-1.1 |
python-starletteopenSUSE:Leap 16.0 From an advisory covering 3 CVEs |
before 0.41.3-160000.3.1 | 0.41.3-160000.3.1 |
History
| Recorded | Changed | Sources |
|---|---|---|
| affected, facts | ||
| first indexed | CVE List, EUVD, GitHub Advisories, NVD, OSV |
Dates are when Every CVE recorded each change. Upstream dates may differ.
In short
CVE-2025-54121 is a medium vulnerability (CVSS 5.3) in Encode Starlette, published July 21, 2025. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 0.66%, the 51st percentile. Fixed in starlette 0.47.2.
References
github.com/encode/starlette/security/advisories/GHSA-2c2j-9gv5-cj73
github.com/encode/starlette/commit/9f7ec2eb512fcc3fe90b43cb9dd9e1d08696bec1
github.com/encode/starlette/blob/fa5355442753f794965ae1af0f87f9fec1b9a3de/starlette/datastructures.py
github.com/encode/starlette/discussions/2927
nvd.nist.gov/vuln/detail/CVE-2025-54121
github.com/advisories/GHSA-2c2j-9gv5-cj73
Show 14 moreShow less
github.com/CVEProject/cvelistV5/tree/main/cves/2025/54xxx/CVE-2025-54121.json
security-tracker.debian.org/tracker/CVE-2025-54121
github.com/encode/starlette
pypi.org/project/starlette
suse.com/support/update/announcement/2025/suse-su-202502544-1
bugzilla.suse.com/1246855
suse.com/security/cve/CVE-2025-54121
suse.com/support/update/announcement/2026/suse-su-202622151-1
bugzilla.suse.com/1252805
bugzilla.suse.com/1266369
suse.com/security/cve/CVE-2025-62727
suse.com/security/cve/CVE-2026-48710
ubuntu.com/security/CVE-2025-54121
cve.org/CVERecord?id=CVE-2025-54121
Left out here: 128 versions. The JSON record has them.