GHSA-WP53-J4WJ-2CFG
Vulnerability from github – Published: 2026-01-26 23:28 – Updated: 2026-01-26 23:28Summary
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:
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.
{
"affected": [
{
"package": {
"ecosystem": "PyPI",
"name": "python-multipart"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "0.0.22"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2026-24486"
],
"database_specific": {
"cwe_ids": [
"CWE-22"
],
"github_reviewed": true,
"github_reviewed_at": "2026-01-26T23:28:05Z",
"nvd_published_at": null,
"severity": "HIGH"
},
"details": "### Summary\n\nA 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.\n\n### Details\n\nWhen `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:\n\n```py\nos.path.join(\"/upload/dir\", \"/etc/malicious\") == \"/etc/malicious\"\n```\n \nThis allows an attacker to bypass the intended upload directory and write files to arbitrary paths. \n \n#### Affected Configuration \n \nProjects are only affected if all of the following are true: \n- `UPLOAD_DIR` is set\n- `UPLOAD_KEEP_FILENAME` is set to True\n- The uploaded file exceeds `MAX_MEMORY_FILE_SIZE` (triggering a flush to disk)\n\nThe default configuration is not vulnerable. \n \n#### Impact \n \nArbitrary file write to attacker-controlled paths on the filesystem. \n \n#### Mitigation \n \nUpgrade to version 0.0.22, or avoid using `UPLOAD_KEEP_FILENAME=True` in project configurations.",
"id": "GHSA-wp53-j4wj-2cfg",
"modified": "2026-01-26T23:28:05Z",
"published": "2026-01-26T23:28:05Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/Kludex/python-multipart/security/advisories/GHSA-wp53-j4wj-2cfg"
},
{
"type": "WEB",
"url": "https://github.com/Kludex/python-multipart/commit/9433f4bbc9652bdde82bbe380984e32f8cfc89c4"
},
{
"type": "PACKAGE",
"url": "https://github.com/Kludex/python-multipart"
},
{
"type": "WEB",
"url": "https://github.com/Kludex/python-multipart/releases/tag/0.0.22"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:H/A:L",
"type": "CVSS_V3"
}
],
"summary": "Python-Multipart has Arbitrary File Write via Non-Default Configuration"
}
Sightings
| Author | Source | Type | Date |
|---|
Nomenclature
- Seen: The vulnerability was mentioned, discussed, or observed by the user.
- Confirmed: The vulnerability has been validated from an analyst's perspective.
- Published Proof of Concept: A public proof of concept is available for this vulnerability.
- Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
- Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
- Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
- Not confirmed: The user expressed doubt about the validity of the vulnerability.
- Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.