CVE-2026-53539: CWE-400: Uncontrolled Resource Consumption in Kludex python-multipart
### Summary When parsing `application/x-www-form-urlencoded` bodies, `QuerystringParser` located the field separator with a two step lookup: it first scanned the entire remaining buffer for `&`, and only when no `&` existed anywhere ahead did it fall back to scanning for `;`. For a body that uses `;` as the separator and contains no `&`, every field iteration performed a full failed `&` scan over the entire remaining buffer before locating the nearby `;`. With N semicolon separated fields in a chunk of size B, this yields O(B^2) byte comparisons per chunk. An attacker can submit a small crafted body of the form `a;a;a;...` and cause the parser to spend seconds of CPU per request. A handful of concurrent requests can exhaust worker processes. ### Details In `python_multipart/multipart.py`, both the `FIELD_NAME` and `FIELD_DATA` states located the next separator like this: ```python sep_pos = data.find(b"&", i) if sep_pos == -1: sep_pos = data.find(b";", i) ``` `data.find(b"&", i)` scans from `i` to the end of the buffer and returns `-1` only when there is no `&` anywhere in the remainder. For a `;` separated body with no `&`, this failed full buffer scan repeats once per field, making parsing quadratic in the body length. For example, a 1 MiB url encoded body consisting of `a;` repeated ~500,000 times, submitted with `Content-Type: application/x-www-form-urlencoded`, causes the parser to perform on the order of 10^11 byte comparisons, consuming several seconds of CPU for a single request. Cost scales quadratically with chunk size. The parser is reachable through the public `QuerystringParser` class and through the high level `FormParser`, `create_form_parser`, and `parse_form` APIs for url encoded bodies. It is also the parser Starlette and FastAPI use for `application/x-www-form-urlencoded` request bodies via `request.form()`. ### Impact Uncontrolled CPU consumption (denial of service). Parsing is synchronous, so a single small crafted form body occupies the handling worker for seconds, blocking any other work on that worker until parsing finishes. Sustained concurrent requests keep workers continuously busy, degrading or denying service. ### Mitigation Upgrade to `python-multipart` `0.0.30` or later, which treats only `&` as a field separator (per the [WHATWG URL standard](https://url.spec.whatwg.org/#urlencoded-parsing)) using a single bounded scan, making parsing linear in the body length.
AI Analysis
Technical Summary
The python-multipart library versions before 0.0.30 contain a performance flaw in the QuerystringParser when parsing application/x-www-form-urlencoded bodies that use semicolon (;) as field separators without ampersands (&). The parser performs a full scan for '&' on each field iteration before falling back to scanning for ';', resulting in O(B^2) byte comparisons for a chunk of size B with N semicolon-separated fields. This inefficiency can be exploited by an attacker sending crafted bodies like 'a;a;a;...' to cause excessive CPU usage and potentially exhaust worker processes. The issue is addressed in version 0.0.30.
Potential Impact
The vulnerability causes high CPU consumption leading to denial of service conditions by exhausting worker processes handling requests. It does not impact confidentiality or integrity but affects availability due to resource exhaustion.
Mitigation Recommendations
Upgrade python-multipart to version 0.0.30 or later where this vulnerability is fixed. Patch status is confirmed by the vendor's versioning. No other mitigations are indicated.
CVE-2026-53539: CWE-400: Uncontrolled Resource Consumption in Kludex python-multipart
Description
### Summary When parsing `application/x-www-form-urlencoded` bodies, `QuerystringParser` located the field separator with a two step lookup: it first scanned the entire remaining buffer for `&`, and only when no `&` existed anywhere ahead did it fall back to scanning for `;`. For a body that uses `;` as the separator and contains no `&`, every field iteration performed a full failed `&` scan over the entire remaining buffer before locating the nearby `;`. With N semicolon separated fields in a chunk of size B, this yields O(B^2) byte comparisons per chunk. An attacker can submit a small crafted body of the form `a;a;a;...` and cause the parser to spend seconds of CPU per request. A handful of concurrent requests can exhaust worker processes. ### Details In `python_multipart/multipart.py`, both the `FIELD_NAME` and `FIELD_DATA` states located the next separator like this: ```python sep_pos = data.find(b"&", i) if sep_pos == -1: sep_pos = data.find(b";", i) ``` `data.find(b"&", i)` scans from `i` to the end of the buffer and returns `-1` only when there is no `&` anywhere in the remainder. For a `;` separated body with no `&`, this failed full buffer scan repeats once per field, making parsing quadratic in the body length. For example, a 1 MiB url encoded body consisting of `a;` repeated ~500,000 times, submitted with `Content-Type: application/x-www-form-urlencoded`, causes the parser to perform on the order of 10^11 byte comparisons, consuming several seconds of CPU for a single request. Cost scales quadratically with chunk size. The parser is reachable through the public `QuerystringParser` class and through the high level `FormParser`, `create_form_parser`, and `parse_form` APIs for url encoded bodies. It is also the parser Starlette and FastAPI use for `application/x-www-form-urlencoded` request bodies via `request.form()`. ### Impact Uncontrolled CPU consumption (denial of service). Parsing is synchronous, so a single small crafted form body occupies the handling worker for seconds, blocking any other work on that worker until parsing finishes. Sustained concurrent requests keep workers continuously busy, degrading or denying service. ### Mitigation Upgrade to `python-multipart` `0.0.30` or later, which treats only `&` as a field separator (per the [WHATWG URL standard](https://url.spec.whatwg.org/#urlencoded-parsing)) using a single bounded scan, making parsing linear in the body length.
CVSS v3.1
Score 7.5high
Affected software
Kludex
python-multipart
Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
The python-multipart library versions before 0.0.30 contain a performance flaw in the QuerystringParser when parsing application/x-www-form-urlencoded bodies that use semicolon (;) as field separators without ampersands (&). The parser performs a full scan for '&' on each field iteration before falling back to scanning for ';', resulting in O(B^2) byte comparisons for a chunk of size B with N semicolon-separated fields. This inefficiency can be exploited by an attacker sending crafted bodies like 'a;a;a;...' to cause excessive CPU usage and potentially exhaust worker processes. The issue is addressed in version 0.0.30.
Potential Impact
The vulnerability causes high CPU consumption leading to denial of service conditions by exhausting worker processes handling requests. It does not impact confidentiality or integrity but affects availability due to resource exhaustion.
Mitigation Recommendations
Upgrade python-multipart to version 0.0.30 or later where this vulnerability is fixed. Patch status is confirmed by the vendor's versioning. No other mitigations are indicated.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- GitHub_M
- Date Reserved
- 2026-06-09T18:13:07.263Z
- Cvss Version
- 3.1
- State
- PUBLISHED
Threat ID: 6a39735aeed863c81e396233
Added to database: 06/22/2026, 17:39:38 UTC
Last enriched: 06/29/2026, 21:51:05 UTC
Last updated: 09/21/2026, 22:01:35 UTC
Views: 102
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
External Links
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.