PT-2024-6226 · Django+6 · Django+6

Josh Schneier

·

Published

2024-06-23

·

Updated

2026-01-30

·

CVE-2024-39330

CVSS v4.0

8.7

High

VectorAV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N
Name of the Vulnerable Software and Affected Versions Django versions 4.2 through 4.2.13 Django versions 5.0 through 5.0.6
Description The issue is related to derived classes of the django.core.files.storage.Storage base class that override the generate filename() function without replicating the file-path validations from the parent class. This potentially allows directory traversal via certain inputs during a save() call. The built-in Storage sub-classes are unaffected. The vulnerability is associated with incorrect restriction of the file path name, which may allow a remote attacker to write arbitrary files.
Recommendations For Django versions 4.2 through 4.2.13, update to version 4.2.14 or later. For Django versions 5.0 through 5.0.6, update to version 5.0.7 or later. As a temporary workaround, consider disabling the generate filename() function in derived classes of django.core.files.storage.Storage until a patch is available. Restrict access to the save() method to minimize the risk of exploitation. Avoid using the generate filename() function without proper file-path validations until the issue is resolved.

Fix

Path traversal

Weakness Enumeration

Related Identifiers

ALT-PU-2024-10534
ALT-PU-2025-10176
BDU:2024-07170
BIT-DJANGO-2024-39330
CVE-2024-39330
GHSA-9JMF-237G-QF46
MGASA-2025-0039
OESA-2024-2002
OESA-2024-2003
OESA-2024-2004
OESA-2024-2036
OESA-2024-2280
OPENSUSE-SU-2024:0251-1
OPENSUSE-SU-2024:14203-1
OPENSUSE-SU-2024:14208-1
OPENSUSE-SU-2024_2545-1
OPENSUSE-SU-2026:10005-1
OPENSUSE-SU-2026:10125-1
PYSEC-2024-58
RHSA-2024:6428
RHSA-2024:8906
RHSA-2024:9481
SUSE-SU-2024:2545-1
SUSE-SU-2024:2577-1
USN-6888-1
USN-6888-2

Affected Products

Alt Linux
Astra Linux
Debian
Django
Linuxmint
Suse
Ubuntu