CVE-2026-53538: Python-Multipart: Semicolon treated as querystring field separator enables parameter smuggling

Published Jun 15, 2026
·
Updated

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 pythonmultipart/multipart.py, the FIELDNAME and FIELDDATA states located the next separator by scanning for & and, failing that, for ;:

python seppos = data.find(b"&", i) if seppos == -1: seppos = 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, createformparser, and parseform 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.

Other sources

Python-Multipart is a streaming multipart parser for Python. Prior to 0.0.30, 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. This vulnerability is fixed in 0.0.30.

MITRE

Affected Software

2 affected componentsFixes available
pip/python-multipart<0.0.30
0.0.30
Fastapiexpert Python-multipart Python<0.0.30

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade pip/python-multipart to a version that resolves this vulnerability.

    Fixed in 0.0.30
  2. Upgrade

    Upgrade python-multipart to a version that resolves this vulnerability.

    Fixed in 0.0.30
  3. Compensating control

    For application/x-www-form-urlencoded requests inspected/filtered by a gateway/WAF, ensure the field separator parsing follows the WHATWG URL standard (treat only '&' as a separator; do not treat ';' as a field boundary) to prevent HTTP parameter pollution.

Event History

Jun 15, 2026
Advisory Published
via GitHub·08:22 PM
Data Sourced
via GitHub·08:22 PM
DescriptionSeverityWeaknessAffected Software
Jun 22, 2026
CVE Published
via MITRE·04:56 PM
Data Sourced
via MITRE·04:56 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·06:16 PM
DescriptionSeverityWeaknessAffected Software
Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is the severity of CVE-2026-53538?

The severity of CVE-2026-53538 is low, rated at 3.7.

2

What vulnerability does CVE-2026-53538 describe?

CVE-2026-53538 describes an issue where `QuerystringParser` incorrectly treats `;` as a field separator in `application/x-www-form-urlencoded` bodies.

3

How can I mitigate CVE-2026-53538 in my application?

To mitigate CVE-2026-53538, ensure that your application correctly interprets `application/x-www-form-urlencoded` data, focusing on the use of `&` as the only field separator.

4

Is CVE-2026-53538 vulnerable across all versions of pip/python-multipart?

CVE-2026-53538 affects specific versions of pip/python-multipart; it is recommended to check the library's documentation for the fixed version.

5

What impact does CVE-2026-53538 have on data integrity?

CVE-2026-53538 could lead to a slight risk of data integrity issues due to the incorrect parsing of query parameters.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203