CVE-2023-30798: MultipartParser denial of service with too many fields or files
(updated )
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 OOM 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 callsrequest.form()
.
References
- github.com/advisories/GHSA-74m5-2c7w-9w3x
- github.com/encode/starlette
- github.com/encode/starlette/commit/8c74c2c8dba7030154f8af18e016136bea1938fa
- github.com/encode/starlette/security/advisories/GHSA-74m5-2c7w-9w3x
- github.com/pypa/advisory-database/tree/main/vulns/starlette/PYSEC-2023-48.yaml
- nvd.nist.gov/vuln/detail/CVE-2023-30798
- vulncheck.com/advisories/starlette-multipartparser-dos
Detect and mitigate CVE-2023-30798 with GitLab Dependency Scanning
Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →