Every CVE Search/ Get API key

CVE-2025-54121

Starlette has possible denial-of-service vector when parsing large files in multipart forms

5.3 MediumFix available

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

0.66%Up 0.6 points since Jul 22, 2025
90%50%10%1%

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 MediumCVSS: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 MediumCVSS: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 MediumCVSS: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 MediumCVSS: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 MediumCVSS: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 MediumCVSS: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 MediumCVSS: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 MediumCVSS: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 MediumCVSS: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 MediumCVSS: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

Affected packages
PackageAffectedFixed
starlette
PyPI
before 0.47.2
0.47.2
starlette
TuxCare:PyPI
0.27.0 up to 0.27.0.post2+tuxcare, plus listed versions
0.27.0.post1+tuxcare
0.27.0.post2+tuxcare
starlette
TuxCare:PyPI
0.13.6 up to 0.13.6.post1+tuxcare
0.13.6.post1+tuxcare
starlette
TuxCare:PyPI
From an advisory covering 8 CVEs
0.25.0 up to 0.25.0.post1+tuxcare
0.25.0.post1+tuxcare
starlette
Debian:12
before 0.26.1-1+deb12u1, plus listed versions
0.26.1-1
0.26.1-1+deb12u1
starlette
Debian:13
before 0.46.1-3
0.46.1-3
starlette
Debian:14
before 0.46.1-3
0.46.1-3
starlette
PyPI
before 0.47.2, plus listed versions
0.1.00.1.10.1.100.1.110.1.12
Show 45 moreShow less
0.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
starlette
Root: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-starlette
Root: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
Affected packages
PackageAffectedFixed
python-starlette
openSUSE:Leap 15.6
before 0.35.1-150600.3.6.1
0.35.1-150600.3.6.1
python-starlette
SUSE: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-starlette
SUSE: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
starlette
Ubuntu:22.04:LTS
All versions, plus listed versions
0.14.1-10.16.0-10.18.0-1
None known
starlette
Ubuntu:24.04:LTS
All versions, plus listed versions
0.30.0-10.31.1-1
None known
starlette
Ubuntu:25.10
All versions, plus listed versions
0.46.1-20.46.1-3
None known
starlette
Ubuntu:26.10
All versions, plus listed versions
0.50.0-11.1.0-11.3.1-11.7.0-2
None known
starlette
Ubuntu:26.04:LTS
All versions, plus listed versions
0.46.1-30.50.0-1
None known
python-starlette
openSUSE:Tumbleweed
before 0.47.2-1.1
0.47.2-1.1
python-starlette
openSUSE:Leap 16.0
From an advisory covering 3 CVEs
before 0.41.3-160000.3.1
0.41.3-160000.3.1

History

History
RecordedChangedSources
affected, facts
first indexedCVE 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

Show 14 moreShow less
This page doesn't list everything

Left out here: 128 versions. The JSON record has them.

MoveEnter Open