{"id":"CVE-2026-53538","aliases":["CVE-2026-53538","GHSA-6jv3-5f52-599m","PYSEC-2026-3037"],"related":[],"kind":"vulnerability","state":"published","title":"Python-Multipart: Semicolon treated as querystring field separator enables parameter smuggling","summary":"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.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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.","source":"cvelist"},{"lang":"en","text":"### Summary\n\n`QuerystringParser` treated `;` as a field separator in `application/x-www-form-urlencoded` bodies, in addition to `&`. The [WHATWG URL standard](https://url.spec.whatwg.org/#urlencoded-parsing), 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.\n\n### Details\n\nIn `python_multipart/multipart.py`, the `FIELD_NAME` and `FIELD_DATA` states located the next separator by scanning for `&` and, failing that, for `;`:\n\n```python\nsep_pos = data.find(b\"&\", i)\nif sep_pos == -1:\n    sep_pos = data.find(b\";\", i)\n```\n\nAs 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`.\n\nFor example, a body inspecting WAF or gateway that follows the WHATWG rule (only `&` separates fields) receives:\n\n```\nrole=user&x=;role=admin\n```\n\nThe 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.\n\nThe 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.\n\n### Impact\n\nInterpretation 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.\n\n### Mitigation\n\nUpgrade 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). `;` is parsed as ordinary field data, matching `urllib.parse`, browsers, and other compliant parsers.","format":"markdown","source":"ghsa"},{"lang":"es","text":"Python-Multipart es un analizador multipart de streaming para Python. Antes de la versión 0.0.30, QuerystringParser trataba el ; como un separador de campos en cuerpos application/x-www-form-urlencoded, además del &. El estándar de URL de WHATWG, los navegadores modernos y urllib.parse de Python (desde la corrección de CVE-2021-23336) tratan solo el & como un separador. Esto crea un diferencial de analizador: los mismos bytes son tokenizados en campos diferentes de los que produciría un intermediario compatible con WHATWG, permitiendo a un atacante introducir de contrabando campos de formulario adicionales más allá de un componente de inspección de cuerpo ascendente. Esta vulnerabilidad está corregida en la versión 0.0.30.","source":"nvd"}],"published":"2026-06-15T20:22:25.000Z","modified":"2026-10-25T23:10:00.167Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:L/A:N","score":3.7,"rating":"LOW"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:L/A:N","score":3.7,"rating":"LOW"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:L/A:N","score":3.7,"rating":"LOW"},{"scorer":"PyPA Advisory Database","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:L/A:N","score":3.7,"rating":"LOW"}],"cwes":["CWE-436","CWE-444"],"affected":[{"ranges":[{"version":"< 0.0.30","status":"affected"}],"vendor":"Kludex","product":"python-multipart","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"0.0.30"}],"ecosystem":"PyPI","package":"python-multipart","purl":"pkg:pypi/python-multipart","source":"ghsa"},{"ranges":[{"status":"affected","fixed":"0.0.30"}],"vendor":"fastapiexpert","product":"python-multipart","cpe":"cpe:2.3:a:fastapiexpert:python-multipart:*:*:*:*:*:python:*:*","source":"nvd"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"0.0.30"}],"ecosystem":"PyPI","package":"python-multipart","purl":"pkg:pypi/python-multipart","source":"pysec"}],"references":[{"url":"https://github.com/Kludex/python-multipart/security/advisories/GHSA-6jv3-5f52-599m","tags":["vendor-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://github.com/Kludex/python-multipart","tags":["package"],"sources":["ghsa","pysec"]},{"url":"https://pypi.org/project/python-multipart","tags":["package"],"sources":["pysec"]},{"url":"https://github.com/advisories/GHSA-6jv3-5f52-599m","tags":["advisory"],"sources":["pysec"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-53538","tags":["advisory"],"sources":["pysec"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"partial","date":"2026-06-23T14:49:11.715Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-53538","url":"https://www.cve.org/CVERecord?id=CVE-2026-53538","licence":"CVE Terms of Use","modified":"2026-06-23T16:08:22.050Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-6jv3-5f52-599m","url":"https://github.com/advisories/GHSA-6jv3-5f52-599m","licence":"CC-BY-4.0","modified":"2026-09-10T03:51:07.925Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-53538","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-53538","licence":"Public domain","modified":"2026-10-25T23:10:00.167Z"},{"source":"pysec","name":"PyPA Advisory Database","id":"PYSEC-2026-3037","url":"https://osv.dev/vulnerability/PYSEC-2026-3037","licence":"CC-BY-4.0","modified":"2026-07-13T16:33:29.021Z"}],"updatedAt":"2026-11-25T22:59:25.389Z","epss":{"score":0.00186,"percentile":0.08576,"date":"2026-12-01T12:00:22.000Z"}}