CVE-2026-40347: Python multipart Denial of Service Vulnerability
MODERATECVE-2026-40347 is a MODERATE (CVSS 5.3) denial of service vulnerability (CWE-834: Excessive Iteration) affecting Python multipart libraries in the PyPI ecosystem. The issue involves python-multipart affected by denial of service via large multipart preamble or epilogue data. Remediation is available by upgrading affected packages to version 0.0.26.
CVE-2026-40347 at a Glance
Security Impact
CVSS: 5.3
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L).
How to Fix CVE-2026-40347
To remediate this vulnerability, upgrade all affected Python multipart dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
pip install python-multipart>=0.0.26
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
pip show python-multipart
How to Check if You Are Affected
To determine whether your Python environment is affected by CVE-2026-40347, inspect your installed packages using pip:
pip show python-multipart
Analyze the terminal output to locate any version of Python multipart in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.0.26), your application is affected.
Note: The pip show python-multipart command checks currently installed packages in your active Python environment.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-834: Excessive Iteration, where the product performs an iteration or loop without sufficiently limiting the number of times that the loop is executed. In Python multipart, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2026-40347 Affected Python multipart Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
python-multipart
|
PyPI |
< 0.0.26
|
0.0.26
|
References
Frequently Asked Questions
What is CVE-2026-40347?
Which Python multipart versions are affected?
What version fixes CVE-2026-40347?
Is python-multipart affected?
What is the CVSS score of CVE-2026-40347?
What CWE is associated with CVE-2026-40347?
How can I check PyPI dependencies for CVE-2026-40347?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-mj87-hwqh-73pj",
"modified" : "2026-04-24T20:51:11Z",
"published" : "2026-04-15T19:45:44Z",
"aliases" : [ "CVE-2026-40347" ],
"summary" : "python-multipart affected by Denial of Service via large multipart preamble or epilogue data",
"details" : "### Summary\n\nA denial of service vulnerability exists when parsing crafted `multipart/form-data` requests with large preamble or epilogue sections.\n\n### Details\n\nTwo inefficient multipart parsing paths could be abused with attacker-controlled input.\n\nBefore the first multipart boundary, the parser handled leading CR and LF bytes inefficiently while searching for the start of the first part. After the closing boundary, the parser continued processing trailing epilogue data instead of discarding it immediately. As a result, parsing time could grow with the size of crafted data placed before the first boundary or after the closing boundary.\n\n### Impact\n\nAn attacker can send oversized malformed multipart bodies that consume excessive CPU time during request parsing, reducing request-handling capacity and delaying legitimate requests. This issue degrades availability but does not typically result in a complete denial of service for the entire application.\n\n### Mitigation\n\nUpgrade to version `0.0.26` or later, which skips ahead to the next boundary candidate when processing leading CR/LF data and immediately discards epilogue data after the closing boundary.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "PyPI",
"name" : "python-multipart"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "0.0.26"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/Kludex/python-multipart/security/advisories/GHSA-mj87-hwqh-73pj"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-40347"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/Kludex/python-multipart"
}, {
"type" : "WEB",
"url" : "https://github.com/Kludex/python-multipart/releases/tag/0.0.26"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-400", "CWE-834" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2026-04-15T19:45:44Z",
"nvd_published_at" : "2026-04-18T00:16:38Z"
}
}