CVE-2024-39330: n/a
An issue was discovered in Django 5.0 before 5.0.7 and 4.2 before 4.2.14. Derived classes of the django.core.files.storage.Storage base class, when they override generate_filename() without replicating the file-path validations from the parent class, potentially allow directory traversal via certain inputs during a save() call. (Built-in Storage sub-classes are unaffected.)
AI Analysis
Technical Summary
CVE-2024-39330 is a directory traversal vulnerability identified in Django versions prior to 5.0.7 and 4.2.14. The root cause lies in how derived classes of django.core.files.storage.Storage override the generate_filename() method. The base Storage class includes file-path validation to prevent directory traversal attacks during file save operations. However, if a subclass overrides generate_filename() without replicating these validations, it may inadvertently allow crafted inputs to manipulate file paths, enabling directory traversal. This can lead to unauthorized access or overwriting of files outside the intended storage directory. The vulnerability does not affect built-in Storage subclasses provided by Django, only custom implementations that fail to enforce proper path validation. Exploitation requires the attacker to have authenticated access (PR:L) but no user interaction is needed. The CVSS v3.1 score is 4.3 (medium severity), reflecting the limited scope and impact primarily on confidentiality. No public exploits or widespread attacks have been reported to date. The vulnerability is tracked under CWE-22 (Improper Limitation of a Pathname to a Restricted Directory).
Potential Impact
For European organizations, this vulnerability poses a risk primarily to confidentiality, as attackers with authenticated access could exploit improperly implemented custom Storage subclasses to access or overwrite files outside designated directories. This could lead to exposure of sensitive data or unauthorized modification of files, potentially impacting data integrity indirectly. Organizations using Django-based web applications with custom file storage solutions are at risk, especially those handling sensitive or regulated data such as personal information under GDPR. The vulnerability does not directly impact availability or integrity but could facilitate further attacks if leveraged in a chained exploit. Since exploitation requires authenticated access, the threat is mitigated somewhat by existing access controls, but insider threats or compromised accounts could still exploit this flaw. The absence of known exploits reduces immediate risk but patching is critical to prevent future abuse.
Mitigation Recommendations
European organizations should audit all Django applications to identify any custom subclasses of django.core.files.storage.Storage that override generate_filename(). Developers must ensure that these overrides replicate the parent class's file-path validation logic to prevent directory traversal. Upgrading Django to versions 5.0.7 or 4.2.14 and later is strongly recommended, as these versions include fixes for this vulnerability. Additionally, implement strict input validation and sanitization for any user-supplied file paths or names. Employ robust authentication and authorization controls to limit access to file upload and save functionalities. Regular code reviews and security testing focusing on file handling logic can help detect similar issues. Monitoring logs for unusual file access patterns may also aid in early detection of exploitation attempts.
Affected Countries
Germany, France, United Kingdom, Netherlands, Sweden, Italy, Spain, Poland
CVE-2024-39330: n/a
Description
An issue was discovered in Django 5.0 before 5.0.7 and 4.2 before 4.2.14. Derived classes of the django.core.files.storage.Storage base class, when they override generate_filename() without replicating the file-path validations from the parent class, potentially allow directory traversal via certain inputs during a save() call. (Built-in Storage sub-classes are unaffected.)
AI-Powered Analysis
Technical Analysis
CVE-2024-39330 is a directory traversal vulnerability identified in Django versions prior to 5.0.7 and 4.2.14. The root cause lies in how derived classes of django.core.files.storage.Storage override the generate_filename() method. The base Storage class includes file-path validation to prevent directory traversal attacks during file save operations. However, if a subclass overrides generate_filename() without replicating these validations, it may inadvertently allow crafted inputs to manipulate file paths, enabling directory traversal. This can lead to unauthorized access or overwriting of files outside the intended storage directory. The vulnerability does not affect built-in Storage subclasses provided by Django, only custom implementations that fail to enforce proper path validation. Exploitation requires the attacker to have authenticated access (PR:L) but no user interaction is needed. The CVSS v3.1 score is 4.3 (medium severity), reflecting the limited scope and impact primarily on confidentiality. No public exploits or widespread attacks have been reported to date. The vulnerability is tracked under CWE-22 (Improper Limitation of a Pathname to a Restricted Directory).
Potential Impact
For European organizations, this vulnerability poses a risk primarily to confidentiality, as attackers with authenticated access could exploit improperly implemented custom Storage subclasses to access or overwrite files outside designated directories. This could lead to exposure of sensitive data or unauthorized modification of files, potentially impacting data integrity indirectly. Organizations using Django-based web applications with custom file storage solutions are at risk, especially those handling sensitive or regulated data such as personal information under GDPR. The vulnerability does not directly impact availability or integrity but could facilitate further attacks if leveraged in a chained exploit. Since exploitation requires authenticated access, the threat is mitigated somewhat by existing access controls, but insider threats or compromised accounts could still exploit this flaw. The absence of known exploits reduces immediate risk but patching is critical to prevent future abuse.
Mitigation Recommendations
European organizations should audit all Django applications to identify any custom subclasses of django.core.files.storage.Storage that override generate_filename(). Developers must ensure that these overrides replicate the parent class's file-path validation logic to prevent directory traversal. Upgrading Django to versions 5.0.7 or 4.2.14 and later is strongly recommended, as these versions include fixes for this vulnerability. Additionally, implement strict input validation and sanitization for any user-supplied file paths or names. Employ robust authentication and authorization controls to limit access to file upload and save functionalities. Regular code reviews and security testing focusing on file handling logic can help detect similar issues. Monitoring logs for unusual file access patterns may also aid in early detection of exploitation attempts.
Affected Countries
For access to advanced analysis and higher rate limits, contact root@offseq.com
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- mitre
- Date Reserved
- 2024-06-23T00:00:00.000Z
- Cvss Version
- 3.1
- State
- PUBLISHED
Threat ID: 690a2decf0ba78a0505371b2
Added to database: 11/4/2025, 4:46:36 PM
Last enriched: 11/4/2025, 5:14:08 PM
Last updated: 12/20/2025, 5:17:50 PM
Views: 11
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Related Threats
CVE-2025-7782: CWE-862 Missing Authorization in WP JobHunt
HighCVE-2025-7733: CWE-639 Authorization Bypass Through User-Controlled Key in WP JobHunt
MediumCVE-2025-14298: CWE-79 Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') in damian-gora FiboSearch – Ajax Search for WooCommerce
MediumCVE-2025-12492: CWE-200 Exposure of Sensitive Information to an Unauthorized Actor in ultimatemember Ultimate Member – User Profile, Registration, Login, Member Directory, Content Restriction & Membership Plugin
MediumCVE-2025-13619: CWE-269 Improper Privilege Management in CMSSuperHeroes Flex Store Users
CriticalActions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need enhanced features?
Contact root@offseq.com for Pro access with improved analysis and higher rate limits.