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

> 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.

- **Severity:** High 7.5 (`CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 5 Feb 2024
- **Updated:** 9 May 2025
- **Also known as:** CLSA-2025-1755043914, CLSA-2025-1755735112, CLSA-2025-1758586346, CLSA-2026-1787305298, DEBIAN-CVE-2024-24762, GHSA-2jv5-9r88-3w3p, GHSA-qf9m-vfgh-m389, PYSEC-2024-38, PYSEC-2026-1850, ROOT-APP-PYPI-CVE-2024-24762, ROOT-APP-PYPI-GHSA-qf9m-vfgh-m389, UBUNTU-CVE-2024-24762, openSUSE-SU-2024:13664-1, openSUSE-SU-2024:13684-1, openSUSE-SU-2026:11710-1, openSUSE-SU-2026:12032-1

## 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 (Inefficient Regular Expression Complexity), CWE-400 (Uncontrolled Resource Consumption)

## 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.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `fastapi` | PyPI | All versions | 0.109.1 |
| `fastapi` | PyPI | All versions | 0.109.1 |
| `fastapi` | PyPI | All versions | 0.109.1 |
| `python-multipart` | PyPI | All versions | 0.0.7 |
| `python-multipart` | PyPI | All versions | 0.0.7 |
| `python-multipart` | PyPI | All versions | 0.0.7 |
| `python-fastapi` | openSUSE:Tumbleweed | All versions | 0.138.0-2.1 |
| `python-python-multipart` | openSUSE:Tumbleweed | All versions | 0.0.32-1.3 |

Products: Fastapiexpert Python-Multipart.

## How do I fix CVE-2024-24762?

Upgrade fastapi to 0.109.1 or later.

## Is CVE-2024-24762 being exploited?

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

## Other vulnerabilities in Kludex fastapi

- [CVE-2026-24486](https://insights.sbomify.com/CVE-2026-24486/): Python-Multipart has Arbitrary File Write via Non-Default Configuration (high 8.6)
- [CVE-2026-53539](https://insights.sbomify.com/CVE-2026-53539/): Python-Multipart: Quadratic-time querystring parsing with semicolon separators causes CPU denial of service (high 7.5)
- [CVE-2026-40347](https://insights.sbomify.com/CVE-2026-40347/): Python-Multipart affected by Denial of Service via large multipart preamble or epilogue data (medium 5.3)
- [CVE-2026-53537](https://insights.sbomify.com/CVE-2026-53537/): Python-Multipart: Content-Disposition parameter smuggling via RFC 2231/5987 extended parameters (low 3.7)
- [CVE-2026-53538](https://insights.sbomify.com/CVE-2026-53538/): Python-Multipart: Semicolon treated as querystring field separator enables parameter smuggling (low 3.7)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2024-24762 and fix it if it is affected.

What it is: 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.
Exploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2024-24762 exists.

Affected packages and fixed versions:
- fastapi (PyPI): affected all versions; fixed in 0.109.1
- fastapi (PyPI): affected all versions; fixed in 0.109.1
- fastapi (PyPI): affected all versions; fixed in 0.109.1
- python-multipart (PyPI): affected all versions; fixed in 0.0.7
- python-multipart (PyPI): affected all versions; fixed in 0.0.7
- python-multipart (PyPI): affected all versions; fixed in 0.0.7

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2024-24762/ (Markdown: https://insights.sbomify.com/CVE-2024-24762/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2024-24762
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2024-24762
- OSV: https://osv.dev/vulnerability/CVE-2024-24762

---
From sbomify Insights: https://insights.sbomify.com/CVE-2024-24762/
Summaries are generated and may contain mistakes; the official description above is the record.
