python-multipart
CVE-2026-42561
HIGH
Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessIdentify multipart upload endpoint
-
DeliveryCraft malformed multipart request with unbounded headers
-
ExploitSend HTTP POST to target
-
ExecutionTrigger unbounded parser loop
-
PersistExhaust worker CPU and block event loop
-
ImpactDeny service to legitimate users
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A06:2025 - Insecure Design
ASVS 5.0
V2 - Validation and Business Logic Resource allocation limits
MITRE ATT&CK
1 technique across 1 tactic: Impact The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up. |
| Exploitation Conditions | Exploitation requires that the target application accepts multipart/form-data requests from attacker-controlled sources, specifically any endpoint invoking python-multipart's MultipartParser on untrusted input. This includes file upload forms, API endpoints with multipart content-type handlers, and webhook receivers processing form submissions. The vulnerability is exploitable against default configurations of affected python-multipart versions (<0.0.27) with no special feature enablement required. Attack success is NOT limited by authentication mechanisms-unauthenticated public endpoints are vulnerable, but so are authenticated endpoints if the attacker has valid credentials. Attack effectiveness is reduced (but not eliminated) by external request size limits at reverse proxy or framework layers, though these controls do not prevent CPU exhaustion within the allowed payload size. Asynchronous ASGI applications (Starlette, FastAPI) are more severely impacted than synchronous WSGI applications due to event-loop blocking amplifying the denial of service effect across multiple concurrent requests. |
| Impact | CVSS 7.5 (AV:N/AC:L/PR:N/UI:N) indicates high-severity remote unauthenticated denial of service with low attack complexity. However, real-world risk varies significantly by deployment context. Applications accepting file uploads from untrusted sources (public-facing forms, API endpoints) face immediate risk of service disruption. The attack is trivially automatable and requires no authentication, making it suitable for both targeted attacks and opportunistic scanning. No EPSS score or CISA KEV data provided, suggesting exploitation is not yet widespread, though publicly available exploit code exists via GitHub advisory GHSA-pp6c-gr5w-3c5g with technical details sufficient for weaponization. The impact is strictly availability (A:H with C:N/I:N), meaning data confidentiality and integrity remain intact. Organizations with request size limits at reverse proxy or WAF layers have partial mitigation, but these controls do not address the core parsing inefficiency. Priority should be HIGH for internet-facing Python web applications using FastAPI/Starlette, MEDIUM for internal applications with upload functionality, and LOW for applications that do not parse multipart/form-data. |
| Exploit ScenarioDerived | An attacker identifies a public API endpoint that accepts file uploads via multipart/form-data, such as a profile picture upload or document submission form running on FastAPI. They craft an HTTP POST request containing a multipart part with thousands of repeated 'Content-Disposition' headers or a single header with a multi-megabyte value. Upon receiving this request, the python-multipart parser enters an infinite-like loop attempting to process the unbounded header block, consuming 100% CPU on the worker thread. In ASGI deployments, this blocks the event loop, preventing the worker from handling any other requests until the malicious request times out or memory exhaustion occurs. Repeating this attack with multiple concurrent connections exhausts all available workers, causing complete service unavailability for legitimate users. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – May 06, 2026
CPU exhaustion in python-multipart allows remote unauthenticated attackers to cause denial of service through crafted multipart/form-data requests with unbounded header blocks. Applications using Starlette, FastAPI, or other ASGI frameworks that parse attacker-controlled file uploads are vulnerable to worker thread starvation and event-loop blocking. Vendor-released patch available in version 0.0.27, which enforces default limits on both header count and individual header size during multipart parsing.
RemediationAI
Upgrade python-multipart to version 0.0.27 or later, which introduces default enforcement of maximum header count and maximum header size limits during multipart parsing. For Python environments using pip, execute 'pip install --upgrade python-multipart>=0.0.27' and verify the installation with 'pip show python-multipart'. If frameworks like FastAPI or Starlette are pinning python-multipart versions in requirements.txt or pyproject.toml, update those constraints accordingly. The fix is non-breaking and requires no code changes in consuming applications. For environments where immediate upgrade is not feasible, implement compensating controls at the infrastructure layer: configure reverse proxies (nginx, Apache, HAProxy) or cloud load balancers to enforce strict request body size limits (e.g., client_max_body_size in nginx), set WAF rules to reject requests with abnormally large header blocks, and enable rate limiting on upload endpoints to prevent resource exhaustion from repeated attacks. Note these mitigations only reduce attack surface and do not eliminate the vulnerability-affected parser versions will still attempt unbounded header processing within the constrained body size. Review application logs for signs of exploitation, such as slow request processing times on multipart endpoints or worker timeout errors. GitHub security advisory available at https://github.com/Kludex/python-multipart/security/advisories/GHSA-pp6c-gr5w-3c5g.
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 1 package in pypi
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
The python-multipart library (pkg:pip/python-multipart) implements RFC 7578 multipart/form-data parsing for Python web applications, commonly used through ASGI frameworks like Starlette and FastAPI. The vulnerability exists in the MultipartParser state machine, specifically in the HEADER_FIELD_START, HEADER_FIELD, HEADER_VALUE_START, HEADER_VALUE, and HEADER_VALUE_ALMOST_DONE parser states. Prior to version 0.0.27, no bounds checking occurred during part header parsing, allowing attackers to exploit CWE-770 (Allocation of Resources Without Limits or Throttling) by sending either extremely large individual header values or an excessive number of header lines without proper termination. The parser would continue consuming CPU cycles attempting to process these malformed headers until either memory exhaustion or external timeout mechanisms triggered, blocking worker threads or event loops in asynchronous applications.
Know when Python gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Primary rating from Vendor (https://github.com/Kludex/python-multipart).
CVSS VectorVendor: https://github.com/Kludex/python-multipart
DescriptionCVE.org
Summary
python-multipart has a denial of service vulnerability in multipart part header parsing. When parsing multipart/form-data, MultipartParser previously had no limit on the number of part headers or the size of an individual part header. An attacker could send a request with either many repeated headers without terminating the header block or a single very large header value, causing excessive CPU work before request rejection or completion.
Impact
Applications that parse attacker-controlled multipart/form-data with affected versions of python-multipart can experience CPU exhaustion. ASGI applications using Starlette, FastAPI, or other frameworks that invoke python-multipart may have worker or event-loop delays while processing malicious upload requests.
Details
The affected parser states are HEADER_FIELD_START, HEADER_FIELD, HEADER_VALUE_START, HEADER_VALUE, and HEADER_VALUE_ALMOST_DONE. The issue can be triggered by:
- A multipart part with an oversized individual header value.
- A multipart part with many repeated header lines or an unterminated header block.
Both variants are addressed by enforcing default parser limits for maximum header count and maximum header size.
Mitigation
Upgrade to python-multipart 0.0.27 or later.
If upgrading is not immediately possible, reduce exposure by enforcing request body size limits at the server, proxy, or framework layer. This is only a mitigation; affected versions of python-multipart still parse multipart part headers without the default header count and header size limits.
Blast Radius
ecosystem impact- 31 pypi packages depend on python-multipart (29 direct, 2 indirect)
Ecosystem-wide dependent count for version 0.0.27.
Executive ViewAI
CVE-2026-42561 is a denial-of-service vulnerability in python-multipart that allows unauthenticated attackers to exhaust CPU resources and freeze application workers through malicious file upload requests, directly impacting availability of FastAPI, Starlette, and ASGI-based services. Organizations running these frameworks with user-facing file upload functionality face immediate risk of service disruption affecting customer-facing operations.
Vendor-released patch: python-multipart version 0.0.27. If immediate patching is not possible: (1) Implement reverse proxy rate limiting on file upload endpoints (e.g., nginx, AWS WAF) to cap multipart requests per source IP; (2) Configure framework-level timeout enforcement to fail requests exceeding 30-second processing time; (3) Restrict file upload access to authenticated users only where operationally feasible; (4) Temporarily disable public file upload endpoints pending patch deployment.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
Denial of Service attacks render applications or systems unavailable by overwhelming resources or triggering failure conditions.
Affected Products (CPE)CVE.org
Wazuh SIEM platform versions 4.4.0 through 4.9.0 contain an unsafe deserialization vulnerability in the DistributedAPI t
BentoML version 1.4.2 and earlier contains an unauthenticated remote code execution vulnerability through insecure deser
pgAdmin 4 contains critical remote code execution vulnerabilities in the Query Tool download and Cloud Deployment endpoi
The renderLocalView function in render/views.py in graphite-web in Graphite 0.9.5 through 0.9.10 uses the pickle Python
BentoML is a Python library for building online serving systems optimized for AI apps and model inference. Rated critica
OpenSSL before 0.9.8za, 1.0.0 before 1.0.0m, and 1.0.1 before 1.0.1h does not properly restrict processing of ChangeCiph
pyLoad download manager version prior to 0.5.0b3.dev77 exposes the Flask SECRET_KEY through an unauthenticated endpoint.
Langflow (a visual LLM pipeline builder) contains a critical unauthenticated code execution vulnerability (CVE-2026-3301
In Mercurial before 4.1.3, "hg serve --stdio" allows remote authenticated users to launch the Python debugger, and conse
Unauthenticated remote code execution affects Kestra OSS (the open-source event-driven orchestration platform) prior to
Unauthenticated remote code execution in Marimo ≤0.20.4 allows attackers to execute arbitrary system commands via the `/
pyLoad is the free and open-source Download Manager written in pure Python. Rated medium severity (CVSS 5.3), this vulne
Same technique Denial Of Service
View allVendor StatusVendor
SUSE
Severity: High| Product | Status |
|---|---|
| openSUSE Tumbleweed | Fixed |
| SUSE Linux Enterprise Server 16.0 | Fixed |
| SUSE Linux Enterprise Server 16.1 | Fixed |
| SUSE Linux Enterprise Server for SAP applications 16.0 | Fixed |
| SUSE Linux Enterprise Server for SAP applications 16.1 | Fixed |
| openSUSE Leap 15.6 | Fixed |
GHSA-pp6c-gr5w-3c5g
NVD
CVE.org
EPSS
Exploit-DB