CVE-2023-30798: MultipartParser DOS with too many fields or files in Starlette Framework

Published Feb 14, 2023
·
Updated

Duplicate Advisory This advisory has been withdrawn because it is a duplicate of GHSA-74m5-2c7w-9w3x. This link is maintained to preserve external references.

Original Description There MultipartParser usage in Encode's Starlette python framework before versions 0.25.0 allows an unauthenticated and remote attacker to specify any number of form fields or files which can cause excessive memory usage resulting in denial of service of the HTTP service.

Other sources

Impact

The MultipartParser using the package python-multipart accepts an unlimited number of multipart parts (form fields or files).

Processing too many parts results in high CPU usage and high memory usage, eventually leading to an <abbr title="out of memory">OOM</abbr> process kill.

This can be triggered by sending too many small form fields with no content, or too many empty files.

For this to take effect application code has to:

Have python-multipart installed and call request.form() or via another framework like FastAPI, using form field parameters or UploadFile parameters, which in turn calls request.form().

Patches

The vulnerability is solved in Starlette 0.25.0 by making the maximum fields and files customizable and with a sensible default (1000).

Applications will be secure by just upgrading their Starlette version to 0.25.0 (or FastAPI to 0.92.0).

If application code needs to customize the new max field and file number, there are new request.form() parameters (with the default values):

maxfiles=1000 maxfields=1000

Workarounds

Applications that don't install python-multipart or that don't use form fields are safe.

In older versions, it's also possible to instead of calling request.form() call request.stream() and parse the form data in internal code.

In most cases, the best solution is to upgrade the Starlette version.

References

This was reported in private by @das7pad via internal email. He also coordinated the fix across multiple frameworks and parsers.

The details about how multipart/form-data is structured and parsed are in the RFC 7578.

GitHub

Encode Starlette is vulnerable to a denial of service, caused by a flaw with accepting unlimited number of multipart parts in the python-multipart package in the MultipartParser. By sending a specially-crafted request, a remote attacker could exploit this vulnerability to cause high CPU and memory usages, and results in a denial of service condition.

IBM

Affected Software

5 affected componentsFixes available
pip/starlette<0.25.0
0.25.0
IBM Cloud Pak for Business Automation<=V22.0.2 - V22.0.2-IF004
IBM Cloud Pak for Business Automation<=V21.0.3 - V21.0.3-IF020
IBM Cloud Pak for Business Automation<=V22.0.1 - V22.0.1-IF006 and later fixesV21.0.2 - V21.0.2-IF012 and later fixesV21.0.1 - V21.0.1-IF007 and later fixesV20.0.1 - V20.0.3 and later fixesV19.0.1 - V19.0.3 and later fixesV18.0.0 - V18.0.2 and later fixes
Encode Starlette python<0.25.0

Event History

Feb 14, 2023
Advisory Published
via GitHub·09:31 PM
Apr 21, 2023
CVE Published
via MITRE·03:27 PM
Data Sourced
via MITRE·03:27 PM
DescriptionSeverityWeakness
Oct 28, 2024
Withdrawn
via GitHub·03:22 PM

Parent advisories

This vulnerability appears in the following advisories.

Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is CVE-2023-30798?

CVE-2023-30798 is a vulnerability in the MultipartParser of Encode Starlette, which allows an attacker to cause a denial of service by sending specially-crafted requests.

2

What is the severity of CVE-2023-30798?

The severity of CVE-2023-30798 is high, with a CVSS score of 7.5.

3

How does CVE-2023-30798 affect Starlette framework?

CVE-2023-30798 affects the Encode Starlette framework in versions prior to 0.25.0.

4

How can an attacker exploit CVE-2023-30798?

An attacker can exploit CVE-2023-30798 by sending specially-crafted requests to the affected system.

5

Is there a fix available for CVE-2023-30798?

Yes, the vulnerability in Encode Starlette can be fixed by upgrading to version 0.25.0 or later.

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