---
schema_version: '1.0'
id: security-20260812-f8eae2
title: 'CVE-2026-24486: Python-Multipart has Arbitrary File Write via Non-Default
  Configuration'
url: https://osv.dev/vulnerability/GHSA-wp53-j4wj-2cfg
url_hash: f8eae28b1ec026e8e7d449f2a1f536de95283009da25988c30b20f5752004652
canonical_url: https://osv.dev/vulnerability/GHSA-wp53-j4wj-2cfg
source: osv:ghsa
category: security/library
category_raw: cve/library
region: null
tags:
- cve
- CVE-2026-24486
- GHSA-wp53-j4wj-2cfg
- severity:CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:H/A:L
- python-multipart
- PyPI
lang: en
published_at: '2026-01-26T23:28:05Z'
fetched_at: '2026-08-12T16:00:04.798170Z'
updated_at: '2026-08-22T14:49:09Z'
status: published
content_hash: 52ac02cfd526148ad481c5eca714ac5a76c1df0445ab623cbc89b7908035554a
content_changed_at: '2026-08-22T13:15:21.960160Z'
license_note: full
summary: Python-Multipart has Arbitrary File Write via Non-Default Configuration
summary_source: rss
summary_en: Python-Multipart has Arbitrary File Write via Non-Default Configuration
summary_omitted_reason: null
redistribution: true
keywords_en:
- Arbitrary
- Configuration
- CVE
- CVE-2026-24486
- File
- GHSA-wp53-j4wj-2cfg
- has
- Hashbrown
- library vulnerability
- Non-Default
- PyPI
- python-multipart
- severity:CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:H/A:L
- software security
- via
- Work Profile
- Write
entities_en:
- name: CVE
  type: data
- name: Hashbrown
  type: creature
- name: PyPI
  type: artifact
- name: Work Profile
  type: concept
topics_en:
- library vulnerability
- software security
numeric_facts: []
entities:
- name: CVE
  type: data
- name: PyPI
  type: artifact
- name: Hashbrown
  type: creature
- name: Work Profile
  type: concept
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:49:09Z'
---

# CVE-2026-24486: Python-Multipart has Arbitrary File Write via Non-Default Configuration

## TL;DR
Python-Multipart has Arbitrary File Write via Non-Default Configuration

## Key Points
- cve / CVE-2026-24486 / GHSA-wp53-j4wj-2cfg / severity:CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:H/A:L / python-multipart / PyPI

## Details
**Severity:** CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:H/A:L
**Advisory:** GHSA-wp53-j4wj-2cfg (CVE-2026-24486)

**Details:**
### Summary

A Path Traversal vulnerability exists when using non-default configuration options `UPLOAD_DIR` and `UPLOAD_KEEP_FILENAME=True`. An attacker can write uploaded files to arbitrary locations on the filesystem by crafting a malicious filename.

### Details

When `UPLOAD_DIR` is set and `UPLOAD_KEEP_FILENAME` is `True`, the library constructs the file path using `os.path.join(file_dir, fname)`. Due to the behavior of `os.path.join()`, if the filename begins with a `/`, all preceding path components are discarded:

```py
os.path.join("/upload/dir", "/etc/malicious") == "/etc/malicious"
```
                        
This allows an attacker to bypass the intended upload directory and write files to arbitrary paths.                                         
                                                                                                                                              
#### Affected Configuration                                                                                                                      
                                                                                                                                              
Projects are only affected if all of the following are true:                                                                                     
- `UPLOAD_DIR` is set
- `UPLOAD_KEEP_FILENAME` is set to True
- The uploaded file exceeds `MAX_MEMORY_FILE_SIZE` (triggering a flush to disk)

The default configuration is not vulnerable.                                                                                                
                                                                                                                                              
#### Impact                                                                                                                                   
                                                                                                                                              
Arbitrary file write to attacker-controlled paths on the filesystem.                                                                        
                                                                                                                                              
#### Mitigation                                                                                                                                  
                                                                                                                                              
Upgrade to version 0.0.22, or avoid using `UPLOAD_KEEP_FILENAME=True` in project configurations.

**References:**
- https://github.com/Kludex/python-multipart/security/advisories/GHSA-wp53-j4wj-2cfg
- https://nvd.nist.gov/vuln/detail/CVE-2026-24486
- https://github.com/Kludex/python-multipart/commit/9433f4bbc9652bdde82bbe380984e32f8cfc89c4
- https://github.com/Kludex/python-multipart
- https://github.com/Kludex/python-multipart/releases/tag/0.0.22

_Data: OSV.dev (upstream: ghsa) — https://osv.dev/vulnerability/GHSA-wp53-j4wj-2cfg_

## Source
元記事: [CVE-2026-24486: Python-Multipart has Arbitrary File Write via Non-Default Configuration](https://osv.dev/vulnerability/GHSA-wp53-j4wj-2cfg) — published 2026-01-26T23:28:05Z
