First published: Fri Jul 05 2024(Updated: )
Derived classes of the django.core.files.storage.Storage base class which override generate_filename() without replicating the file path validations existing in the parent class, allow for potential directory-traversal via certain inputs when calling save(). Built-in Storage sub-classes were not affected by this vulnerability. Affected versions ================= * Django main development branch * Django 5.1 * Django 5.0 * Django 4.2
Affected Software | Affected Version | How to fix |
---|---|---|
Django | <5.0>=4.2<5.1 |
Sign up to SecAlerts for real-time vulnerability data matched to your software, aggregated from hundreds of sources.
The severity of REDHAT-BUG-2295937 is classified as high due to its potential for directory traversal vulnerabilities.
To fix REDHAT-BUG-2295937, ensure that any derived classes of django.core.files.storage.Storage replicate the file path validations from the parent class in their overridden generate_filename() methods.
Django versions prior to 5.0 and those between 4.2 and 5.1 are affected by REDHAT-BUG-2295937.
If REDHAT-BUG-2295937 is exploited, it may lead to unauthorized access to sensitive files on the server due to directory traversal.
Applications that use custom storage backends in Django and override the generate_filename() method without proper validation are at risk for REDHAT-BUG-2295937.