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

High 7.5 Published Updated

An attacker can cause a denial of service in applications using python-multipart by sending a crafted Content-Type header that triggers excessive CPU usage.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
Not needed
Fix
Available

What is CVE-2024-24762?

CVE-2024-24762 is a high-severity denial of service vulnerability in Kludex fastapi, published on 5 Feb 2024. An attacker can exploit it over the internet without logging in, with no action from the victim.

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.

Weakness: CWE-1333, CWE-400

Which versions are affected by CVE-2024-24762?

6 open source packages ship an affected version, including fastapi and python-multipart. It affects 1 product.

PackageAffectedFixed in
fastapi PyPIAll versions0.109.1
fastapi PyPIAll versions0.109.1
fastapi PyPIAll versions0.109.1
python-multipart PyPIAll versions0.0.7
python-multipart PyPIAll versions0.0.7
python-multipart PyPIAll versions0.0.7
Linux distribution packages (2)
python-fastapi openSUSE:TumbleweedAll versions0.138.0-2.1
python-python-multipart openSUSE:TumbleweedAll versions0.0.32-1.3

Products include Fastapiexpert Python-Multipart.

How do I fix CVE-2024-24762?

Upgrade fastapi to 0.109.1 or later.

Upgrade, then put limits on request size, rate and nesting depth so one client cannot exhaust the service. More about Denial of service.

Is CVE-2024-24762 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2024-24762 exists.

Sources

Also known as CLSA-2025-1755043914, CLSA-2025-1755735112, CLSA-2025-1758586346, CLSA-2026-1787305298, DEBIAN-CVE-2024-24762, GHSA-2jv5-9r88-3w3p and 10 more.

Is CVE-2024-24762 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free