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.
Published Apr 15, 2026 · Updated Apr 24, 2026
Affected packages
python-multipart
- Ecosystem
- PyPI
- Affected
- < 0.0.26
- Fixed in
- 0.0.26
- Check
pip show python-multipart
Advisory details
From the GitHub Advisory Database (CC BY 4.0).
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.
Credited to HamdaanAliQuatil, defnull.
References
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. No analysis has been written for this entry yet. Methodology
More PyPI vulnerabilities
All PyPI entriesCVE-2026-53537
python-multipart: Content-Disposition parameter smuggling via RFC 2231/5987 extended parameters
low3.7Jun 15, 2026CVE-2026-53538
python-multipart: Semicolon treated as querystring field separator enables parameter smuggling
low3.7Jun 15, 2026CVE-2026-53539
python-multipart: Quadratic-time querystring parsing with semicolon separators causes CPU denial of service
high7.5Jun 15, 2026CVE-2026-53540
python-multipart: Negative Content-Length in parse_form buffers the entire body in memory
low3.7Jun 15, 2026CVE-2026-42561
python-multipart has Denial of Service via unbounded multipart part headers
high7.5May 6, 2026CVE-2026-24486
Python-Multipart has Arbitrary File Write via Non-Default Configuration
high8.6Jan 26, 2026
