CVE-2009-2659: Django Admin Media Handler Directory Traversal

django Updated 02 Oct 2025

Summary

04/08/2009
Yes i
High
7.5

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

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.

Free scan

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.

Check my app free

No signup required · Results in about 60 seconds

Sponsored Devnack Penetration testing for web, API and mobile Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

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 →

Share this vulnerability

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.

Related vulnerabilities

Recent vulnerabilities recorded for django.

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 →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback