CVE-2011-0698: Directory Traversal Vulnerability in Django
Summary
CVE-2011-0698: Directory traversal in Django. Affects django across 2 version ranges.
>= 1.1, < 1.1.4
>= 1.2, < 1.2.5
Fixed in 1.1.4 or 1.2.5, depending on the release line you run. How to fix ↓
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 used for building web applications. It provides a high-level, efficient, and secure way to handle web development tasks. This vulnerability affects Django versions 1.1.x before 1.1.4 and 1.2.x before 1.2.5 on Windows. Django on Windows is susceptible to a directory traversal vulnerability, which can be exploited by remote attackers. The vulnerability arises from a session cookie that contains a key with a / (slash) character. This vulnerability can lead to unauthorized access to sensitive files or even remote code execution.
Vulnerability Detail
The directory traversal vulnerability in Django allows remote attackers to read or execute files by exploiting a / (slash) character in a key within a session cookie. This vulnerability can be abused to replay sessions and gain unauthorized access to sensitive files on the server. The impact of this vulnerability can be severe, as it can lead to unauthorized disclosure of sensitive information or even remote code execution.
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 versions below are the minimum fixed release for this vulnerability.
If you can't move to the latest
The minimum fixed version depends on the release line you run.
-
>= 1.1, < 1.1.41.1.4pip install --upgrade "django==1.1.4" -
>= 1.2, < 1.2.51.2.5pip install --upgrade "django==1.2.5"
Tip — Not sure which release line you're on? Vulert can find the fix for the version you are using. Scan free →
Workaround
If upgrading Django is not immediately feasible, a temporary workaround is to manually sanitize the session cookies by removing any / (slash) characters from the keys. This can be done by modifying the session middleware or implementing a custom session backend. Here is an example of how to sanitize the session cookies in Django:
from django.http import HttpRequest
def sanitize_session_cookie(request: HttpRequest):
session_key = request.COOKIES.get('sessionid', '')
sanitized_key = session_key.replace('/', '')
request.COOKIES['sessionid'] = sanitized_key
By implementing this workaround, the vulnerability can be mitigated until a proper upgrade to a patched version of Django can be performed.
Conclusion
The directory traversal vulnerability in Django can have severe consequences, including unauthorized access to sensitive files and potential remote code execution. It is crucial to upgrade to the patched versions of Django (1.1.4 or later for Django 1.1.x, and 1.2.5 or later for Django 1.2.x) to mitigate this vulnerability. If immediate upgrade is not possible, implementing the provided workaround can help temporarily safeguard the application. For further assistance and support in vulnerability remediation, please contact DevNack.com.
See every vulnerability recorded for django →
FAQ
The vulnerability allows remote attackers to read or execute files on the server, potentially leading to unauthorized access to sensitive information or remote code execution.
Django versions 1.1.x before 1.1.4 and 1.2.x before 1.2.5 on Windows are affected by this vulnerability.
You can use the Vulert Playground (https://vulert.com/scanner) to check if your application is affected by this vulnerability. Simply provide your Pipfile.lock and the playground will analyze it for any open-source vulnerabilities, including this one.
Yes, Django has released patches for this vulnerability. It is recommended to upgrade to Django version 1.1.4 or later if using Django 1.1.x, or to version 1.2.5 or later if using Django 1.2.x.
While specific exploits for this vulnerability may exist, they have not been disclosed publicly. However, it is crucial to patch the vulnerability as soon as possible to prevent any potential exploitation.
References
Related vulnerabilities
Recent vulnerabilities recorded for django.