Логотип exploitDog
Консоль
Логотип exploitDog

exploitDog

github логотип

GHSA-wp53-j4wj-2cfg

Опубликовано: 26 янв. 2026
Источник: github
Github: Прошло ревью
CVSS3: 8.6

Описание

Python-Multipart has Arbitrary File Write via Non-Default Configuration

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:

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.

Пакеты

Наименование

python-multipart

pip
Затронутые версииВерсия исправления

< 0.0.22

0.0.22

EPSS

Процентиль: 5%
0.0002
Низкий

8.6 High

CVSS3

Дефекты

CWE-22

Связанные уязвимости

CVSS3: 8.6
ubuntu
11 дней назад

Python-Multipart is a streaming multipart parser for Python. Prior to version 0.0.22, 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. Users should upgrade to version 0.0.22 to receive a patch or, as a workaround, avoid using `UPLOAD_KEEP_FILENAME=True` in project configurations.

CVSS3: 8.6
nvd
11 дней назад

Python-Multipart is a streaming multipart parser for Python. Prior to version 0.0.22, 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. Users should upgrade to version 0.0.22 to receive a patch or, as a workaround, avoid using `UPLOAD_KEEP_FILENAME=True` in project configurations.

CVSS3: 8.6
debian
11 дней назад

Python-Multipart is a streaming multipart parser for Python. Prior to ...

suse-cvrf
11 дней назад

Security update for python-python-multipart

CVSS3: 8.6
fstec
13 дней назад

Уязвимость конфигурации UPLOAD_DIR и UPLOAD_KEEP_FILENAME=True потокового многокомпонентного парсера python-multipart, позволяющая нарушителю записывать произвольные файлы

EPSS

Процентиль: 5%
0.0002
Низкий

8.6 High

CVSS3

Дефекты

CWE-22