CVE-2011-0698: Directory Traversal Vulnerability in Django
Summary
CVE-2011-0698: Directory traversal vulnerability in Django 1.1.x before 1.1.4 and 1.2.x before 1.2.5 on Windows might allow remote attackers to read or execute files via a / (slash) character in a key in a session cookie, related to se... 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 developing web applications. It provides a high-level, Pythonic interface for handling web requests and managing database operations. Django is widely adopted and has a large community of developers contributing to its development and security. However, versions 1.1.x before 1.1.4 and 1.2.x before 1.2.5 on Windows are vulnerable to a directory traversal vulnerability.
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 exploited to perform unauthorized access to sensitive files on the server, potentially leading to information disclosure or remote code execution. The vulnerability is specific to Windows systems running Django versions 1.1.x and 1.2.x.
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 cookie data to prevent directory traversal attacks. This can be done by validating and sanitizing user input before using it as a key in the session cookie. Here is an example of how to sanitize the session cookie data 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
This code snippet replaces any slash characters in the session cookie key with underscores, effectively mitigating the directory traversal vulnerability.
Conclusion
The directory traversal vulnerability in Django versions 1.1.x and 1.2.x on Windows can be exploited to read or execute files on the server. To mitigate this vulnerability, it is crucial to upgrade Django to the recommended versions or apply the provided workaround. For further assistance or 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.
The vulnerability affects Django versions 1.1.x before 1.1.4 and 1.2.x before 1.2.5 on Windows.
No, the vulnerability is specific to Windows systems running Django.
While specific exploits for this vulnerability may exist, they have not been disclosed publicly at the time of this report.
It is strongly recommended to upgrade Django to the latest stable release that includes the fix for this vulnerability. Alternatively, apply the provided workaround to sanitize the session cookie data.
Related vulnerabilities
Recent vulnerabilities recorded for django.