---
schema_version: '1.0'
id: security-20260812-520b10
title: 'CVE-2026-53539: python-multipart: Quadratic-time querystring parsing with
  semicolon separators causes CPU denial of service'
url: https://osv.dev/vulnerability/GHSA-5rvq-cxj2-64vf
url_hash: 520b10f41d0a2e73f3c42e79f44b3292e58bf9dc4fced9d27002e5d93d63b49f
canonical_url: https://osv.dev/vulnerability/GHSA-5rvq-cxj2-64vf
source: osv:ghsa
category: security/library
category_raw: cve/library
region: null
tags:
- cve
- CVE-2026-53539
- GHSA-5rvq-cxj2-64vf
- severity:CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
- python-multipart
- PyPI
lang: en
published_at: '2026-06-15T20:24:09Z'
fetched_at: '2026-08-12T16:00:04.780766Z'
updated_at: '2026-08-22T14:49:09Z'
status: published
content_hash: 4633cc82bbc49a96da93ddfee636f899475f54cc5ebd1c62b3e193130749b06e
content_changed_at: '2026-08-22T13:15:21.936941Z'
license_note: full
summary: 'python-multipart: Quadratic-time querystring parsing with semicolon separators
  causes CPU denial of service'
summary_source: rss
summary_en: 'python-multipart: Quadratic-time querystring parsing with semicolon separators
  causes CPU denial of service'
summary_omitted_reason: null
redistribution: true
keywords_en:
- causes
- CPU
- CVE
- CVE-2026-53539
- denial
- GHSA-5rvq-cxj2-64vf
- library vulnerability
- parsing
- PyPI
- python-multipart
- Quadratic-time
- querystring
- semicolon
- separators
- service
- severity:CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
- software security
- with
- with B
entities_en:
- name: CVE
  type: data
- name: PyPI
  type: artifact
- name: with B
  type: organization
topics_en:
- library vulnerability
- software security
numeric_facts: []
entities:
- name: CVE
  type: data
- name: PyPI
  type: artifact
- name: with B
  type: organization
related_auto:
- name: ブルゾンちえみ
  type: person
  weight: 5.0
- name: Portal
  type: organization
  weight: 1.0
- name: Hugging Face
  type: organization
  weight: 1.0
computed_at: '2026-08-22T14:49:07Z'
---

# CVE-2026-53539: python-multipart: Quadratic-time querystring parsing with semicolon separators causes CPU denial of service

## TL;DR
python-multipart: Quadratic-time querystring parsing with semicolon separators causes CPU denial of service

## Key Points
- cve / CVE-2026-53539 / GHSA-5rvq-cxj2-64vf / severity:CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H / python-multipart / PyPI

## Details
**Severity:** CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
**Advisory:** GHSA-5rvq-cxj2-64vf (CVE-2026-53539)

**Details:**
### 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.

**References:**
- https://github.com/Kludex/python-multipart/security/advisories/GHSA-5rvq-cxj2-64vf
- https://github.com/Kludex/python-multipart

_Data: OSV.dev (upstream: ghsa) — https://osv.dev/vulnerability/GHSA-5rvq-cxj2-64vf_

## Source
元記事: [CVE-2026-53539: python-multipart: Quadratic-time querystring parsing with semicolon separators causes CPU denial of service](https://osv.dev/vulnerability/GHSA-5rvq-cxj2-64vf) — published 2026-06-15T20:24:09Z
