Advisory

PYSEC-2026-2670

Also known as: CVE-2026-28356, GHSA-p2m9-wcp5-6qw3

Summary

multipart vulnerable to ReDoS in parse_options_header()

Details

Summary

The parse_options_header() function in multipart.py uses a regular expression with an *ambiguous alternation*, which can cause *exponential backtracking (ReDoS)* when parsing maliciously crafted HTTP or multipart segment headers. This can be abused for denial of service (DoS) attacks against web applications using this library to parse request headers or multipart/form-data streams.

Impact

Any WSGI or ASGI application using multipart.parse_form_data() directly or indirectly (e.g. while parsing multipart/form-data streams) is vulnerable. The slow-down is significant enough to block request handling threads for multiple seconds per request.

Affected versions

All versions up to and including 1.3.0 are affected. The issue is fixed in 1.2.2, 1.3.1 and 1.4.0-dev.

Severity

High Basis: CVSS v3 score 7.5, vector CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

Dates

Published
2026-07-13 14:36 UTC
Modified
2026-07-13 16:32 UTC

Affected packages and fixes

multipart

PyPI · All systems

Affected

  • introduced 0, fixed 1.2.2, introduced 1.3.0, fixed 1.3.1 (ecosystem)

Fixed versions

1.2.2, 1.3.1

Fix

  • Fixed version 1.2.2
    pip install --upgrade multipart==1.2.2
  • Fixed version 1.3.1
    pip install --upgrade multipart==1.3.1

Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.

Check your own computer: guard packages check

View this record on OSV.dev

Source

Source: PyPA Advisory Database · CC BY 4.0

Sources & licences