HighGHSA-pp6c-gr5w-3c5gCVE-2026-42561PYSEC-2026-3039

python-multipart has Denial of Service via unbounded multipart part headers

Published 6 May 2026 · Updated 10 Sept 2026

Is your project on an affected python-multipart?

Private repo? Upload its lockfile instead, or connect GitHub to check every repo.

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.27
Fixed in
0.0.27
Update to the fixed version for your release line, for example:pip install 'python-multipart>=0.0.27'

Details

Summary

python-multipart has a denial of service vulnerability in multipart part header parsing. When parsing multipart/form-data, MultipartParser previously had no limit on the number of part headers or the size of an individual part header. An attacker could send a request with either many repeated headers without terminating the header block or a single very large header value, causing excessive CPU work before request rejection or completion.

Impact

Applications that parse attacker-controlled multipart/form-data with affected versions of python-multipart can experience CPU exhaustion. ASGI applications using Starlette, FastAPI, or other frameworks that invoke python-multipart may have worker or event-loop delays while processing malicious upload requests.

Details

The affected parser states are HEADER_FIELD_START, HEADER_FIELD, HEADER_VALUE_START, HEADER_VALUE, and HEADER_VALUE_ALMOST_DONE. The issue can be triggered by:

  • A multipart part with an oversized individual header value.
  • A multipart part with many repeated header lines or an unterminated header block.

Both variants are addressed by enforcing default parser limits for maximum header count and maximum header size.

Mitigation

Upgrade to python-multipart 0.0.27 or later.

If upgrading is not immediately possible, reduce exposure by enforcing request body size limits at the server, proxy, or framework layer. This is only a mitigation; affected versions of python-multipart still parse multipart part headers without the default header count and header size limits.

Is GHSA-pp6c-gr5w-3c5g 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-53538python-multipart: Semicolon treated as querystring field separator enables parameter smuggling · 15 Jun 2026
  • LowCVE-2026-53537python-multipart: Content-Disposition parameter smuggling via RFC 2231/5987 extended parameters · 15 Jun 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
All 9 advisories for python-multipart

References

Advisory data from OSV.dev (opens OSV.dev in a new tab), refreshed daily.