CVE-2026-40347: Python-Multipart affected by Denial of Service via large multipart preamble or epilogue data
Summary
A denial of service vulnerability exists when parsing crafted multipart/form-data requests with large preamble or epilogue sections.
Details
Two inefficient multipart parsing paths could be abused with attacker-controlled input.
Before 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.
Impact
An 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.
Mitigation
Upgrade 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.
Other sources
Python-Multipart is a streaming multipart parser for Python. Versions prior to 0.0.26 have a denial of service vulnerability when parsing crafted multipart/form-data requests with large preamble or epilogue sections. Upgrade 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.
— MITRE
Affected Software
Event History
Frequently Asked Questions
What is the severity of CVE-2026-40347?
The CVE-2026-40347 vulnerability is classified as a denial of service (DoS) issue.
How can I fix CVE-2026-40347?
To fix CVE-2026-40347, update the python-multipart package to version 0.0.26 or later.
What causes the CVE-2026-40347 vulnerability?
CVE-2026-40347 is caused by inefficient multipart parsing paths that can be exploited with crafted multipart/form-data requests.
What types of attacks can be executed using CVE-2026-40347?
CVE-2026-40347 allows attackers to execute denial of service attacks by sending specially crafted multipart/form-data requests.
Is CVE-2026-40347 related to any specific software?
Yes, CVE-2026-40347 specifically affects the python-multipart package versions prior to 0.0.26.