python-multipart: Semicolon treated as querystring field separator enables parameter smuggling
Published 15 Jun 2026 · Updated 10 Sept 2026
Is your project on an affected python-multipart?
Look after several Python apps? Indie watches up to 15 repos, private ones too, for $5 a month. See Indie
Affected package
- Affected
- <0.0.30
- Fixed in
- 0.0.30
pip install 'python-multipart>=0.0.30'Details
Summary
QuerystringParser treated ; as a field separator in application/x-www-form-urlencoded bodies, in addition to &. The WHATWG URL standard, modern browsers, and Python's urllib.parse (since the CVE-2021-23336 fix) treat only & as a separator. This creates a parser differential: the same bytes are tokenized into different fields than a WHATWG compliant intermediary would produce, allowing an attacker to smuggle extra form fields past an upstream body inspecting component.
Details
In python_multipart/multipart.py, the FIELD_NAME and FIELD_DATA states located the next separator by scanning for & and, failing that, for ;:
sep_pos = data.find(b"&", i)
if sep_pos == -1:
sep_pos = data.find(b";", i)As a result, ; acted as a field boundary. Because the fallback only triggered when no & remained in the current chunk, tokenization also depended on unrelated bytes later in the buffer and on how the body was split across write() calls. This is the same class of issue as CVE-2021-23336 in CPython's urllib.parse.
For example, a body inspecting WAF or gateway that follows the WHATWG rule (only & separates fields) receives:
role=user&x=;role=admin
The upstream parses two fields, role=user and x=";role=admin", sees a benign role=user, and forwards the request. QuerystringParser parsed the same bytes as three fields: role="user", x="", and role="admin". The application (for example via Starlette/FastAPI request.form(), where the last value wins) then received role=admin, a value the upstream validator never saw.
The parser is reachable through the public QuerystringParser class, the high level FormParser, create_form_parser, and parse_form APIs, and Starlette/FastAPI request.form() for url encoded bodies.
Impact
Interpretation conflict / HTTP parameter pollution. An attacker can smuggle extra or overriding form fields past an upstream component that applies the WHATWG separator rule, reaching the backend with parameters the intermediary did not observe.
Mitigation
Upgrade to python-multipart 0.0.30 or later, which treats only & as a field separator per the WHATWG URL standard. ; is parsed as ordinary field data, matching urllib.parse, browsers, and other compliant parsers.
Is GHSA-6jv3-5f52-599m in any of your client repos?
Checking one package by hand is fine. Checking it across forty client projects is not. NPMscan reads the lockfiles in every GitHub repo you pick, finds each project with an affected python-multipart, and gives you the command that fixes it.
More advisories for python-multipart
- HighCVE-2026-53539python-multipart: Quadratic-time querystring parsing with semicolon separators causes CPU denial of service · 15 Jun 2026
- LowCVE-2026-53540python-multipart: Negative Content-Length in parse_form buffers the entire body in memory · 15 Jun 2026
- LowCVE-2026-53537python-multipart: Content-Disposition parameter smuggling via RFC 2231/5987 extended parameters · 15 Jun 2026
- HighCVE-2026-42561python-multipart has Denial of Service via unbounded multipart part headers · 6 May 2026
- MediumCVE-2026-40347python-multipart affected by Denial of Service via large multipart preamble or epilogue data · 15 Apr 2026
- HighCVE-2026-24486Python-Multipart has Arbitrary File Write via Non-Default Configuration · 26 Jan 2026
References
Advisory data from OSV.dev (opens OSV.dev in a new tab), refreshed daily.