CVE-2024-47874: Starlette Denial of service (DoS) via multipart/form-data

Published Oct 15, 2024
·
Updated

Summary Starlette treats multipart/form-data parts without a filename as text form fields and buffers those in byte strings with no size limit. This allows an attacker to upload arbitrary large form fields and cause Starlette to both slow down significantly due to excessive memory allocations and copy operations, and also consume more and more memory until the server starts swapping and grinds to a halt, or the OS terminates the server process with an OOM error. Uploading multiple such requests in parallel may be enough to render a service practically unusable, even if reasonable request size limits are enforced by a reverse proxy in front of Starlette.

PoC

python from starlette.applications import Starlette from starlette.routing import Route

async def poc(request): async with request.form(): pass

app = Starlette(routes=[ Route('/', poc, methods=["POST"]), ])

sh curl http://localhost:8000 -F 'big=</dev/urandom'

Impact This Denial of service (DoS) vulnerability affects all applications built with Starlette (or FastAPI) accepting form requests.

Other sources

Starlette is an Asynchronous Server Gateway Interface (ASGI) framework/toolkit. Prior to version 0.40.0, Starlette treats multipart/form-data parts without a filename as text form fields and buffers those in byte strings with no size limit. This allows an attacker to upload arbitrary large form fields and cause Starlette to both slow down significantly due to excessive memory allocations and copy operations, and also consume more and more memory until the server starts swapping and grinds to a halt, or the OS terminates the server process with an OOM error. Uploading multiple such requests in parallel may be enough to render a service practically unusable, even if reasonable request size limits are enforced by a reverse proxy in front of Starlette. This Denial of service (DoS) vulnerability affects all applications built with Starlette (or FastAPI) accepting form requests. Verison 0.40.0 fixes this issue.

— MITRE

Affected Software

6 affected componentsFixes available
pip/starlette<0.40.0
0.40.0
debian/starlette<0.26.1-1+deb12u1
0.26.1-1+deb12u1
debian/starlette<0.41.0-1
0.41.0-1
debian/starlette<0.41.0-1
0.41.0-1
debian/starlette
0.26.1-1+deb12u10.26.1-1+deb12u20.46.1-3+deb13u31.9.0-1
IBM Concert Software<=1.0-3.0.1.1

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade pip/starlette to a version that resolves this vulnerability.

    Fixed in 0.40.0
  2. Upgrade

    Upgrade debian/starlette to a version that resolves this vulnerability.

    Fixed in 0.26.1-1+deb12u1
  3. Upgrade

    Upgrade debian/starlette to a version that resolves this vulnerability.

    Fixed in 0.41.0-1
  4. Upgrade

    Upgrade debian/starlette to a version that resolves this vulnerability.

    Fixed in 0.26.1-1+deb12u1Fixed in 0.26.1-1+deb12u2Fixed in 0.46.1-3+deb13u3Fixed in 1.9.0-1
  5. Upgrade

    Upgrade Starlette to a version that resolves this vulnerability.

    Fixed in 0.40.0

Event History

Oct 15, 2024
CVE Published
via MITRE·03:45 PM
Data Sourced
via MITRE·03:45 PM
DescriptionWeakness
Data Sourced
via NVD·04:15 PM
DescriptionSeverityWeakness
Data Sourced
via OSV·04:15 PM
DescriptionSeverityAffected Software
Advisory Published
via GitHub·06:12 PM
Oct 29, 2026
Data Sourced
via IBM·12:00 AM
DescriptionAffected Software

Parent advisories

This vulnerability appears in the following advisories.

Frequently Asked Questions

1

What is the severity of CVE-2024-47874?

CVE-2024-47874 is classified as a high severity vulnerability due to the potential for denial of service attacks.

2

How do I fix CVE-2024-47874?

To address CVE-2024-47874, upgrade Starlette to version 0.40.0 or later.

3

What types of attacks are possible with CVE-2024-47874?

CVE-2024-47874 allows attackers to upload excessively large form fields, leading to performance degradation and potential denial of service.

4

Is CVE-2024-47874 present in earlier versions of Starlette?

Yes, CVE-2024-47874 affects all versions of Starlette prior to 0.40.0.

5

How can I determine if my application is affected by CVE-2024-47874?

Check if your application uses Starlette versions lower than 0.40.0 to identify if it is affected by CVE-2024-47874.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203