---
schema_version: '1.0'
id: security-20260812-e7675b
title: 'CVE-2026-42561: python-multipart has Denial of Service via unbounded multipart
  part headers'
url: https://osv.dev/vulnerability/PYSEC-2026-3039
url_hash: e7675b769ed7a4d972b799a45b51ca4dab76c82ea770d3a41dc8dc8ca9a7451d
canonical_url: https://osv.dev/vulnerability/PYSEC-2026-3039
source: osv:pypa
category: security/library
category_raw: cve/library
region: null
tags:
- cve
- CVE-2026-42561
- PYSEC-2026-3039
- severity:CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
- python-multipart
- PyPI
lang: en
published_at: '2026-07-13T15:15:39Z'
fetched_at: '2026-08-12T16:00:04.815959Z'
updated_at: '2026-08-22T14:53:00Z'
status: published
content_hash: 40f789950110a2200457914ed05e5d1f90c7a3a16eee8ac0624ac561452909fc
content_changed_at: '2026-08-22T13:15:21.974925Z'
license_note: full
summary: python-multipart has Denial of Service via unbounded multipart part headers
summary_source: rss
summary_en: python-multipart has Denial of Service via unbounded multipart part headers
summary_omitted_reason: null
redistribution: true
keywords_en:
- CVE
- CVE-2026-42561
- Denial
- has
- Hashbrown
- headers
- IRIAM SERVICE
- library vulnerability
- multipart
- part
- PyPI
- PYSEC-2026-3039
- python-multipart
- Service
- severity:CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
- software security
- unbounded
- via
- Viant
entities_en:
- name: CVE
  type: data
- name: Hashbrown
  type: creature
- name: IRIAM SERVICE
  type: organization
- name: PyPI
  type: artifact
- name: Viant
  type: organization
topics_en:
- library vulnerability
- software security
numeric_facts: []
entities:
- name: CVE
  type: data
- name: PyPI
  type: artifact
- name: Hashbrown
  type: creature
- name: IRIAM SERVICE
  type: organization
- name: Viant
  type: organization
related_auto:
- name: Portal
  type: organization
  weight: 1.0
- name: Hugging Face
  type: organization
  weight: 1.0
- name: Alexa Munoz
  type: UNKNOWN
  weight: 1.0
- name: Helen Woodward Animal Center
  type: organization
  weight: 1.0
- name: Lee Asher
  type: person
  weight: 1.0
computed_at: '2026-08-22T14:52:49Z'
---

# CVE-2026-42561: python-multipart has Denial of Service via unbounded multipart part headers

## TL;DR
python-multipart has Denial of Service via unbounded multipart part headers

## Key Points
- cve / CVE-2026-42561 / PYSEC-2026-3039 / severity:CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H / python-multipart / PyPI

## Details
**Severity:** CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
**Advisory:** PYSEC-2026-3039 (CVE-2026-42561)

**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.

**References:**
- https://github.com/Kludex/python-multipart/security/advisories/GHSA-pp6c-gr5w-3c5g
- https://nvd.nist.gov/vuln/detail/CVE-2026-42561
- https://github.com/Kludex/python-multipart
- https://pypi.org/project/python-multipart
- https://github.com/advisories/GHSA-pp6c-gr5w-3c5g

_Data: OSV.dev (upstream: pypa) — https://osv.dev/vulnerability/PYSEC-2026-3039_

## Source
元記事: [CVE-2026-42561: python-multipart has Denial of Service via unbounded multipart part headers](https://osv.dev/vulnerability/PYSEC-2026-3039) — published 2026-07-13T15:15:39Z
