CVE-2009-2659: Django Admin Media Handler Directory Traversal
Summary
CVE-2009-2659: The Admin media handler in core/servers/basehttp.py in Django 1.0 and 0.96 does not properly map URL requests to expected "static media files," which allows remote attackers to conduct directory traversal attacks and rea... Affects django versions < 1.1. Fixed in 1.1. How to fix ↓
Also tracked for
- python-django · Debian:11
The same CVE-2009-2659 is tracked separately for each ecosystem and vendor. Its fix information is the same; the package and affected versions differ.
Check if this vulnerability affects your application
Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.
No signup required · Results in about 60 seconds
Background
Django is a popular Python web framework that simplifies the development of web applications. It provides a set of tools and libraries for handling various aspects of web development, including URL routing, database management, and user authentication. The Admin media handler in Django 1.0 and 0.96 is responsible for serving static media files, such as CSS and JavaScript, for the Django admin interface. However, a vulnerability in this component allows remote attackers to perform directory traversal attacks and read arbitrary files by manipulating the URL requests.
Vulnerability Detail
The vulnerability arises from the improper mapping of URL requests to expected static media files by the Admin media handler in Django. By crafting a malicious URL, an attacker can bypass the intended security measures and access sensitive files outside the designated media directory. This can lead to unauthorized disclosure of sensitive information, such as configuration files or user data, potentially compromising the integrity and confidentiality of the application.
How To Fix
Latest published version: 6.1.2 as of 22 Oct 2026
pip install --upgrade "django==6.1.2"
Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.
If you need the minimum change
1.1
This is the first release that contains the fix.
pip install --upgrade "django==1.1"
Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →
Workaround
If upgrading to a newer Django version is not immediately feasible, a temporary workaround can be implemented by modifying the URL configuration. Specifically, the media URL should be restricted to a specific directory using regular expressions or other URL mapping techniques. This ensures that only files within the designated media directory can be accessed via the URL.
Conclusion
The vulnerability in the Django Admin media handler allows remote attackers to perform directory traversal attacks and read arbitrary files. To mitigate this issue, it is crucial to upgrade to Django version 1.1 or later. Alternatively, a temporary workaround can be implemented by restricting the media URL to a specific directory. For further assistance and support in vulnerability remediation, please contact DevNack.com.
See every vulnerability recorded for django →
FAQ
This vulnerability allows remote attackers to read arbitrary files on the server, potentially exposing sensitive information and compromising the application's security.
Django versions 1.0 and 0.96 are affected by this vulnerability. Upgrading to version 1.1 or later is recommended.
There have been no reports of this vulnerability being actively exploited in the wild. However, it is important to apply the necessary security patches to prevent potential attacks.
Yes, the Django development team has addressed this vulnerability in version 1.1 and later. Upgrading to the latest version will fix the issue.
While upgrading to a newer Django version is the recommended solution, a temporary workaround can be implemented by restricting the media URL to a specific directory.
References
Related vulnerabilities
Recent vulnerabilities recorded for django.