Skip to main content
Press slash or control plus K to focus the search. Use the arrow keys to navigate results and press enter to open a threat.
Reconnecting to live updates…

Python-Multipart 0.0.22 - Path Traversal

0
Medium
Published: Thu Apr 30 2026 (04/30/2026, 00:00:00 UTC)
Source: Exploit-DB RSS Feed

Description

Python-Multipart versions prior to 0. 0. 22 contain a path traversal vulnerability (CVE-2026-24486) that allows arbitrary file write when the UPLOAD_KEEP_FILENAME option is enabled and UPLOAD_DIR is configured. This occurs because malicious filenames can traverse directories and overwrite files outside the intended upload directory. Exploit code in Python demonstrates uploading files with crafted filenames to write to arbitrary paths on the target system. The vulnerability is medium severity and can be mitigated by upgrading to python-multipart version 0. 0. 22 or later, avoiding the use of UPLOAD_KEEP_FILENAME=True, and sanitizing filenames by extracting only the basename.

AI-Powered Analysis

Machine-generated threat intelligence

AILast updated: 05/01/2026, 20:59:01 UTC

Technical Analysis

The Python-Multipart library before version 0.0.22 is vulnerable to a path traversal issue (CVE-2026-24486) when the configuration uses UPLOAD_KEEP_FILENAME=True along with UPLOAD_DIR. This vulnerability allows an attacker to write files to arbitrary locations on the server by submitting malicious filenames containing directory traversal sequences. The provided exploit code in Python demonstrates how an attacker can upload files with crafted filenames to overwrite sensitive files or place malicious scripts. The vulnerability is confirmed with proof-of-concept code and affects environments using python-multipart for file uploads without proper filename sanitization.

Potential Impact

An attacker can exploit this vulnerability to write arbitrary files to locations outside the designated upload directory. This can lead to overwriting critical system or application files, potentially resulting in code execution, privilege escalation, or denial of service depending on the target environment and file locations overwritten.

Mitigation Recommendations

A fix is available by upgrading python-multipart to version 0.0.22 or later. Additionally, avoid enabling UPLOAD_KEEP_FILENAME=True and ensure filenames are sanitized by using only the basename (e.g., filename = os.path.basename(file.filename)) before saving uploaded files. These steps prevent directory traversal in filenames and mitigate the vulnerability.

Pro Console: star threats, build custom feeds, automate alerts via Slack, email & webhooks.Upgrade to Pro

Technical Details

Edb Id
52543
Has Exploit Code
true
Code Language
python

Indicators of Compromise

Exploit Source Code

Exploit Code

Exploit code for Python-Multipart 0.0.22 - Path Traversal

# Exploit Title: Python-Multipart 0.0.22 - Path Traversal 
# Date: 2026-02-23
# Exploit Author: cardosource
# Vendor Homepage: https://github.com/Kludex/python-multipart
# Software Link: https://pypi.org/project/python-multipart/
# Version: < 0.0.22 (REQUIRED)
# Tested on: Ubuntu / Python 3.13.5 / Docker (as root for demo)
# CVE : CVE-2026-24486

"""
PoC for CVE-2026-24486: Path Traversal in python-multipart when UPLOAD_KEEP_FILENAME=True + UPLOAD_DIR is configured.
Allows arbitrary file write v
... (1698 more characters)
Code Length: 2,198 characters

Threat ID: 69f5140dcbff5d86105a401a

Added to database: 5/1/2026, 8:58:53 PM

Last enriched: 5/1/2026, 8:59:01 PM

Last updated: 5/2/2026, 5:49:30 AM

Views: 5

Community Reviews

0 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Actions

PRO

Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.

Please log in to the Console to use AI analysis features.

Need more coverage?

Upgrade to Pro Console for AI refresh and higher limits.

For incident response and remediation, OffSeq services can help resolve threats faster.

Latest Threats

Breach by OffSeqOFFSEQFRIENDS — 25% OFF

Check if your credentials are on the dark web

Instant breach scanning across billions of leaked records. Free tier available.

Scan now
OffSeq TrainingCredly Certified

Lead Pen Test Professional

Technical5-day eLearningPECB Accredited
View courses