Arbitrary File Write Vulnerability in Python-Multipart Package

python-multipart Updated 27 Jan 2026

Summary

26/01/2026
HIGH
Yes i
High
8.6

GHSA-wp53-j4wj-2cfg: Python-Multipart has Arbitrary File Write via Non-Default Configuration. Affects python-multipart versions < 0.0.22. Fixed in 0.0.22. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Penetration testing for web, API and mobile Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

Python-Multipart is a library used for handling multipart file uploads in Python applications. It simplifies the process of receiving files from users, allowing developers to easily manage file uploads in web applications. However, due to specific configuration settings, it is susceptible to a serious vulnerability that can lead to arbitrary file writes on the server's filesystem.

Vulnerability Detail

The vulnerability arises from a Path Traversal issue when the configuration options UPLOAD_DIR and UPLOAD_KEEP_FILENAME are set to specific values. If an attacker uploads a file with a crafted filename that begins with a '/', the library uses os.path.join() to construct the file path, leading to the potential for the file to be written to an arbitrary location on the filesystem. This can result in unauthorized access to sensitive files or system compromise, as attackers can manipulate the file paths to write files outside the intended upload directory.

How To Fix

Latest published version: 0.0.32 as of 23 Oct 2026

pip install --upgrade "python-multipart==0.0.32"

Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.

If you need the minimum change

0.0.22

This is the first release that contains the fix.

pip install --upgrade "python-multipart==0.0.22"

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

As a temporary workaround, avoid using the configuration option UPLOAD_KEEP_FILENAME=True in your project settings. This will prevent the library from using the original filename provided by the user, thus mitigating the risk of the vulnerability. Instead, you can generate a unique filename for each upload, ensuring it does not contain any path traversal characters.

Conclusion

The Python-Multipart package has a critical vulnerability that allows arbitrary file writes due to improper handling of file paths under specific configurations. It is essential to upgrade to the latest version to mitigate this risk and ensure the security of your application.

See every vulnerability recorded for python-multipart →

Share this vulnerability

FAQ

The CVSS score of this vulnerability is 8.6, indicating a high severity level.

Projects are affected if UPLOAD_DIR is set, UPLOAD_KEEP_FILENAME is True, and the uploaded file exceeds MAX_MEMORY_FILE_SIZE.

You can use Vulert's playground at Vulert Scanner to check if your application is affected by this vulnerability without needing to sign up.

Vulert is a tool that monitors and alerts in real-time for open-source vulnerabilities in your software, using just the Pipfile.lock.

If you cannot upgrade the package, ensure that you do not use UPLOAD_KEEP_FILENAME=True and consider implementing additional input validation to sanitize filenames.

Related vulnerabilities

Recent vulnerabilities recorded for python-multipart.

How To Fix

Latest published version: 0.0.32 as of 23 Oct 2026

pip install --upgrade "python-multipart==0.0.32"

Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.

If you need the minimum change

0.0.22

This is the first release that contains the fix.

pip install --upgrade "python-multipart==0.0.22"

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback