---
schema_version: '1.0'
id: security-20260812-cca6f8
title: 'CVE-2026-40347: python-multipart affected by Denial of Service via large multipart
  preamble or epilogue data'
url: https://osv.dev/vulnerability/PYSEC-2026-3038
url_hash: cca6f8a34856a2d97356c3f533a038144538e9a9210a88b1f3e65174367c70b5
canonical_url: https://osv.dev/vulnerability/PYSEC-2026-3038
source: osv:pypa
category: security/library
category_raw: cve/library
region: null
tags:
- cve
- CVE-2026-40347
- PYSEC-2026-3038
- 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-07-13T15:02:48Z'
fetched_at: '2026-08-12T16:00:04.813144Z'
updated_at: '2026-08-22T14:53:00Z'
status: published
content_hash: 0482a644d78c465fc5e560f9cebe91b433962935ea9efbd33b639dd367c605e3
content_changed_at: '2026-08-22T13:15:21.972266Z'
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
- IRIAM SERVICE
- large
- library vulnerability
- multipart
- preamble
- PyPI
- PYSEC-2026-3038
- 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:52:48Z'
---

# 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 / PYSEC-2026-3038 / 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:** PYSEC-2026-3038 (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
- https://pypi.org/project/python-multipart
- https://github.com/advisories/GHSA-mj87-hwqh-73pj

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

## Source
元記事: [CVE-2026-40347: python-multipart affected by Denial of Service via large multipart preamble or epilogue data](https://osv.dev/vulnerability/PYSEC-2026-3038) — published 2026-07-13T15:02:48Z
