---
schema_version: '1.0'
id: security-20260812-c67931
title: 'CVE-2026-40347: python-multipart affected by Denial of Service via large multipart
  preamble or epilogue data'
url: https://osv.dev/vulnerability/GHSA-mj87-hwqh-73pj
url_hash: c6793101ee847e89d836d7611d7857493a50702d13dab036b702791b180bd064
canonical_url: https://osv.dev/vulnerability/GHSA-mj87-hwqh-73pj
source: osv:ghsa
category: security/library
category_raw: cve/library
region: null
tags:
- cve
- CVE-2026-40347
- GHSA-mj87-hwqh-73pj
- severity:CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L
- python-multipart
- PyPI
lang: en
published_at: '2026-04-15T19:45:44Z'
fetched_at: '2026-08-12T16:00:04.787104Z'
updated_at: '2026-08-22T14:49:09Z'
status: published
content_hash: b94edab9cc3c05382d974d13d2aa582baae92925aee61847e4eefee945094519
content_changed_at: '2026-08-22T13:15:21.947648Z'
license_note: full
summary: python-multipart affected by Denial of Service via large multipart preamble
  or epilogue data
summary_source: rss
summary_en: python-multipart affected by Denial of Service via large multipart preamble
  or epilogue data
summary_omitted_reason: null
redistribution: true
keywords_en:
- affected
- CVE
- CVE-2026-40347
- data
- Denial
- epilogue
- GHSA-mj87-hwqh-73pj
- IRIAM SERVICE
- large
- library vulnerability
- multipart
- preamble
- PyPI
- python-multipart
- Service
- severity:CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L
- software security
- via
- Viant
entities_en:
- name: CVE
  type: data
- 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: 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: LIVER
  type: person
  weight: 1.0
computed_at: '2026-08-22T14:49:08Z'
---

# CVE-2026-40347: python-multipart affected by Denial of Service via large multipart preamble or epilogue data

## TL;DR
python-multipart affected by Denial of Service via large multipart preamble or epilogue data

## Key Points
- cve / CVE-2026-40347 / GHSA-mj87-hwqh-73pj / severity:CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L / python-multipart / PyPI

## Details
**Severity:** CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L
**Advisory:** GHSA-mj87-hwqh-73pj (CVE-2026-40347)

**Details:**
### Summary

A denial of service vulnerability exists when parsing crafted `multipart/form-data` requests with large preamble or epilogue sections.

### Details

Two inefficient multipart parsing paths could be abused with attacker-controlled input.

Before the first multipart boundary, the parser handled leading CR and LF bytes inefficiently while searching for the start of the first part. After the closing boundary, the parser continued processing trailing epilogue data instead of discarding it immediately. As a result, parsing time could grow with the size of crafted data placed before the first boundary or after the closing boundary.

### Impact

An attacker can send oversized malformed multipart bodies that consume excessive CPU time during request parsing, reducing request-handling capacity and delaying legitimate requests. This issue degrades availability but does not typically result in a complete denial of service for the entire application.

### Mitigation

Upgrade to version `0.0.26` or later, which skips ahead to the next boundary candidate when processing leading CR/LF data and immediately discards epilogue data after the closing boundary.

**References:**
- https://github.com/Kludex/python-multipart/security/advisories/GHSA-mj87-hwqh-73pj
- https://nvd.nist.gov/vuln/detail/CVE-2026-40347
- https://github.com/Kludex/python-multipart
- https://github.com/Kludex/python-multipart/releases/tag/0.0.26

_Data: OSV.dev (upstream: ghsa) — https://osv.dev/vulnerability/GHSA-mj87-hwqh-73pj_

## Source
元記事: [CVE-2026-40347: python-multipart affected by Denial of Service via large multipart preamble or epilogue data](https://osv.dev/vulnerability/GHSA-mj87-hwqh-73pj) — published 2026-04-15T19:45:44Z
