{"id":"CVE-2026-53537","aliases":["CVE-2026-53537","GHSA-vffw-93wf-4j4q","PYSEC-2026-3041"],"related":[],"kind":"vulnerability","state":"published","title":"Python-Multipart: Content-Disposition parameter smuggling via RFC 2231/5987 extended parameters","summary":"Python-Multipart is a streaming multipart parser for Python. Prior to 0.0.30, parse_options_header parsed Content-Disposition (and Content-Type) headers with email.message.Message, which transparently applies RFC 2231/5987 decoding. The extended parameter syntax (filename*=charset'lang'value, name*=..., and the filename*0/filename*1 continuation form) is decoded and surfaced under the bare filename/name key, and overrides the plain parameter when both are present. RFC 7578 §4.2 explicitly forbids the filename* form in multipart/form-data. Components that follow RFC 7578, or that do not implement RFC 2231/5987 decoding for multipart/form-data (WAFs, proxies, gateways), may interpret such a header differently. An attacker can exploit that difference to smuggle a different field name or filename past an upstream inspector to the backend. 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, parse_options_header parsed Content-Disposition (and Content-Type) headers with email.message.Message, which transparently applies RFC 2231/5987 decoding. The extended parameter syntax (filename*=charset'lang'value, name*=..., and the filename*0/filename*1 continuation form) is decoded and surfaced under the bare filename/name key, and overrides the plain parameter when both are present. RFC 7578 §4.2 explicitly forbids the filename* form in multipart/form-data. Components that follow RFC 7578, or that do not implement RFC 2231/5987 decoding for multipart/form-data (WAFs, proxies, gateways), may interpret such a header differently. An attacker can exploit that difference to smuggle a different field name or filename past an upstream inspector to the backend. This vulnerability is fixed in 0.0.30.","source":"cvelist"},{"lang":"en","text":"### Summary\n\n`parse_options_header` parsed `Content-Disposition` (and `Content-Type`) headers with [`email.message.Message`](https://docs.python.org/3/library/email.compat32-message.html#email.message.Message), which transparently applies [RFC 2231](https://datatracker.ietf.org/doc/html/rfc2231)/[5987](https://datatracker.ietf.org/doc/html/rfc5987) decoding. The extended parameter syntax (`filename*=charset'lang'value`, `name*=...`, and the `filename*0`/`filename*1` continuation form) is decoded and surfaced under the bare `filename`/`name` key, and overrides the plain parameter when both are present. [RFC 7578 §4.2](https://datatracker.ietf.org/doc/html/rfc7578#section-4.2) explicitly forbids the `filename*` form in `multipart/form-data`.\n\nComponents that follow RFC 7578, or that do not implement RFC 2231/5987 decoding for `multipart/form-data` (WAFs, proxies, gateways), may interpret such a header differently. An attacker can exploit that difference to smuggle a different field name or filename past an upstream inspector to the backend.\n\n### Details\n\nGiven both a plain and an extended parameter, the extended value won. For example:\n\n```\nContent-Disposition: form-data; name=\"comment\"; name*=utf-8''role\n```\n\nAn inspector following RFC 7578 sees the field `comment`, while the returned value was `name=role`. The same applies to filenames:\n\n```\nContent-Disposition: form-data; name=\"upload\"; filename=\"safe.txt\"; filename*=utf-8''evil.php\n```\n\nThe inspector sees `safe.txt`, while the returned value was `filename=evil.php`. Continuation parameters (`filename*0`, `filename*1`, and so on) were likewise reassembled into a `filename` invisible to a plain `filename=` match, and percent encoded sequences in the extended value were decoded (so `..%2F`, `%00`, and similar appeared in the returned filename).\n\nThis affects the high level `parse_options_header`, `FormParser`, `create_form_parser`, and `parse_form` APIs, and reaches Starlette/FastAPI through `request.form()`, where the smuggled value is exposed as the form field name or [`UploadFile.filename`](https://www.starlette.io/requests/#request-files).\n\n### Impact\n\nThis is an interpretation conflict ([CWE-436](https://cwe.mitre.org/data/definitions/436.html)) with other `multipart/form-data` parsers. An attacker able to submit `multipart/form-data` can present a different field name or filename to an upstream body inspecting component than the one delivered to the application. Concrete consequences depend on how the application uses these values, and may include bypassing a field name or filename based access/upload control, or, for an application that builds filesystem paths from the parsed filename without sanitization, path traversal via decoded `..%2F` sequences. Decoded control bytes such as `%00` can likewise cause confusion between an upstream validator and the backend. The `File` class applies `os.path.basename`, so file writing through it is not directly affected.\n\n### Mitigation\n\nUpgrade to `python-multipart` `0.0.30` or later, which ignores RFC 2231/5987 extended parameters (`name*`, `filename*`, and their continuations) so the plain `name`/`filename` parameter remains authoritative. RFC 7578 §4.2 forbids `filename*` for `multipart/form-data`; `name*` and the continuation forms are dropped for the same reason, since they are not valid `multipart/form-data` parameters either.","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, parse_options_header analizaba los encabezados Content-Disposition (y Content-Type) con email.message.Message, que aplica de forma transparente la decodificación RFC 2231/5987. La sintaxis de parámetro extendida (filename=charset’lang’value, name=..., y la forma de continuación filename0/filename1) se decodifica y se expone bajo la clave filename/name simple, y anula el parámetro simple cuando ambos están presentes. RFC 7578 §4.2 prohíbe explícitamente la forma filename en multipart/form-data. Los componentes que siguen RFC 7578, o que no implementan la decodificación RFC 2231/5987 para multipart/form-data (WAFs, proxies, gateways), pueden interpretar dicho encabezado de manera diferente. Un atacante puede explotar esa diferencia para introducir un nombre de campo o nombre de archivo diferente más allá de un inspector ascendente hacia el backend. Esta vulnerabilidad está corregida en la versión 0.0.30.","source":"nvd"}],"published":"2026-06-15T20:20:51.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":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N","score":5.3,"rating":"MEDIUM"},{"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-20","CWE-436"],"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-vffw-93wf-4j4q","tags":["vendor-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-53537","tags":["advisory"],"sources":["ghsa","pysec"]},{"url":"https://github.com/Kludex/python-multipart","tags":["package"],"sources":["ghsa","pysec"]},{"url":"https://github.com/advisories/GHSA-vffw-93wf-4j4q","tags":["advisory"],"sources":["ghsa","pysec"]},{"url":"https://github.com/pypa/advisory-database/blob/main/vulns/python-multipart/PYSEC-2026-3041.yaml","tags":["web"],"sources":["ghsa"]},{"url":"https://pypi.org/project/python-multipart","tags":["package","web"],"sources":["ghsa","pysec"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"partial","date":"2026-06-23T16:03:15.384Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-53537","url":"https://www.cve.org/CVERecord?id=CVE-2026-53537","licence":"CVE Terms of Use","modified":"2026-06-23T16:08:07.690Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-vffw-93wf-4j4q","url":"https://github.com/advisories/GHSA-vffw-93wf-4j4q","licence":"CC-BY-4.0","modified":"2026-09-10T03:50:50.585Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-53537","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-53537","licence":"Public domain","modified":"2026-10-25T23:10:00.167Z"},{"source":"pysec","name":"PyPA Advisory Database","id":"PYSEC-2026-3041","url":"https://osv.dev/vulnerability/PYSEC-2026-3041","licence":"CC-BY-4.0","modified":"2026-07-13T16:33:29.205Z"}],"updatedAt":"2026-11-25T22:59:25.389Z","epss":{"score":0.00187,"percentile":0.08695,"date":"2026-12-01T12:00:22.000Z"}}