Vulnerability · Published Feb 5, 2024 · Assigned by GitHub_M

CVE-2024-24762python-multipart vulnerable to content-type header Regular expression Denial of Service

High 7.5

In plain English

A high-severity uncontrolled resource consumption in starlette from encode. Proof-of-concept exploit code is public. The chance it is exploited in the next 30 days is estimated at 1.5% (higher than 75% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.

Severity (CVSS 3.1)7.5High
Exploit odds (30 days)1.5%top 25.3% of all CVEs
Exploited in the wildNo reportsCISA SSVC: poc
Attack toolingNoneno public tooling known

Official description

`python-multipart` is a streaming multipart parser for Python. When using form data, `python-multipart` uses a Regular Expression to parse the HTTP `Content-Type` header, including options. An attacker could send a custom-made `Content-Type` option that is very difficult for the RegEx to process, consuming CPU resources and stalling indefinitely (minutes or more) while holding the main event loop. This means that process can't handle any more requests, leading to regular expression denial of service. This vulnerability has been patched in version 0.0.7.

Affected packages & fixed versions

EcosystemPackageFixed inAdvisory
Debian:12python-multipartno fix listedDEBIAN-CVE-2024-24762
Debian:13python-multipart0.0.9-1DEBIAN-CVE-2024-24762
Debian:14python-multipart0.0.9-1DEBIAN-CVE-2024-24762
PyPIfastapi0.109.1PYSEC-2024-38
PyPIfastapi0.109.1GHSA-qf9m-vfgh-m389
PyPIpython-multipart0.0.7PYSEC-2026-1850
PyPIpython-multipart0.0.7GHSA-2jv5-9r88-3w3p

Affected products (as reported)

VendorProductVersions
Kludex python-multipart 0 – before 0.0.7
tiangolo fastapi 0 – before 0.109.1
encode starlette 0 – before 0.36.2

Weakness: CWE-400 · Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

References