Skip to main content

Boteraser | Website and Server Security Solutions

🛡️ CVE-2025-54121 — starlette

🟡 CVSS 5.3 — Medium ✅ No Known Exploit CWE-770 NVD
5.3
CVSS Score
0 Low4 Medium7 High9 Critical10

Description

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](https://github.com/encode/starlette/blob/fa5355442753f794965ae1af0f87f9fec1b9a3de/starlette/formparsers.py#L126)) 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](https://github.com/encode/starlette/blob/fa5355442753f794965ae1af0f87f9fec1b9a3de/starlette/datastructures.py#L436C5-L447C14)) has a minor bug. Instead of just checking for self._in_memory we should also check if the additional bytes will cause a rollover.

```python

@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](https://github.com/encode/starlette/discussions/2927#discussioncomment-13721403) 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.

How this vulnerability can be exploited

This issue can be reached over the network, attack complexity is low, an attacker needs no privileges on the target. No user interaction is required. The scope is unchanged, so the impact stays within the vulnerable component. Rated impact: confidentiality none, integrity none, availability low.

CVSS metrics in full

The score comes from this vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L

  • Attack vector: Network — reachable from anywhere that can route to the service.
  • Attack complexity: Low — the attack works reliably, with no preparation.
  • Privileges required: None — an unauthenticated stranger can try it.
  • User interaction: None — nobody has to be tricked into anything.
  • Scope: Unchanged — the damage stays inside the vulnerable component.
  • Confidentiality impact: None.
  • Integrity impact: None.
  • Availability impact: Low — limited, and the attacker does not choose what is affected.

Weakness class

CVE-2025-54121 is classified as CWE-770: Allocation of Resources Without Limits. Resources are allocated on request with no cap, so a client can exhaust them.

Affected software

CVE-2025-54121 is recorded against 2 packages.

  • starlette (fixed in 0.47.2)
  • unknown

Timeline and source

Published on 7 July 2026. No public exploit is currently recorded for this entry. A vendor advisory or fix has been published. Record sourced from NVD.

References

github.com (Web)
nvd.nist.gov (Advisory)
github.com (Fix)
github.com (Package)
github.com (Web)
github.com (Web)
pypi.org (Package)
github.com (Advisory)

Other advisories for this package

starlette has other advisories on record. If you are patching this one, these are worth checking on the same host:

Same weakness in other software

These advisories are the same class of weakness (CWE-770: Allocation of Resources Without Limits) in other software:

CVE-2025-54121 on other distributions

Each distribution ships its own build and its own fixed version. Pick the one you run:

Details

Severity Medium
CVSS Score 5.3
CVSS Vector CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L
CWE CWE-770
Public Exploit ✅ No
Source NVD
Published 2026-07-07
Updated 2026-08-20
Modified 2026-07-07

Affected Packages

Software From version Fixed in
starlette 0.47.2
unknown

Vulnerability Monitoring

Track new vulnerabilities in starlette

CVE-2025-54121 is rated CVSS 5.3 Medium. BotEraser monitors your WordPress installation and notifies you when software you use appears in our vulnerability database.

Set Up Free Alerts →

No credit card required  ·  Results in minutes

ⓘ Data Notice: The information presented above has been compiled from publicly available internet sources. Boteraser aggregates this data solely for informational purposes and does not independently classify, evaluate, or endorse any findings about the vulnerabilities listed. The accuracy and completeness of this information is the sole responsibility of the original publishers. Boteraser and its operators accept no liability for any decisions made based on this data.

Browse related advisories

All advisoriesCVECVE 2025