CVE-2018-14574: Open Redirect in Django
Summary
CVE-2018-14574: django.middleware.common.CommonMiddleware in Django 1.11.x before 1.11.15 and 2.0.x before 2.0.8 has an Open Redirect. Affects django across 2 version ranges.
>= 1.11, < 1.11.15
>= 2.0, < 2.0.8
Fixed in 1.11.15 or 2.0.8, depending on the release line you run. How to fix ↓
Also tracked for
- py-django · Alpine:v3.10
The same CVE-2018-14574 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 used for building web applications. It provides a set of tools and libraries for handling common web development tasks. The CommonMiddleware module in Django versions 1.11.x before 1.11.15 and 2.0.x before 2.0.8 is vulnerable to an Open Redirect attack.
Vulnerability Detail
The vulnerability in Django's CommonMiddleware module allows an attacker to redirect users to malicious websites by manipulating the URL. This can lead to phishing attacks or the disclosure of sensitive information. The issue originates from improper validation of user-supplied input in the middleware, allowing an attacker to craft a specially crafted URL that redirects the user to a different domain.
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.11, < 1.11.151.11.15pip install --upgrade "django==1.11.15" -
>= 2.0, < 2.0.82.0.8pip install --upgrade "django==2.0.8"
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 possible, a temporary workaround is to manually validate and sanitize user-supplied input in the affected middleware. This can be done by implementing custom URL validation logic or using a trusted URL validation library.
Conclusion
The Open Redirect vulnerability in Django's CommonMiddleware module can be mitigated by upgrading to the fixed versions or implementing custom URL validation logic. It is important to promptly address this vulnerability to prevent potential attacks. For further support on vulnerability remediation, please contact DevNack.com.
See every vulnerability recorded for django →
FAQ
An Open Redirect vulnerability allows an attacker to redirect users to a different website, potentially leading to phishing attacks or the disclosure of sensitive information.
You can use the Vulert playground at Vulert Scanner to check if your application is affected by this vulnerability. Simply provide your Pipfile.lock file, and Vulert will analyze it for any open-source vulnerabilities, including this one.
There are no known public exploits for this vulnerability at the time of writing. However, it is important to patch your Django installation to prevent potential attacks.
While upgrading Django to the fixed versions is the recommended solution, you can implement custom URL validation logic in the affected middleware as a temporary mitigation. However, upgrading is strongly advised to ensure comprehensive security.
You can find more information about this vulnerability in the Django advisory database at https://github.com/pypa/advisory-database/blob/main/vulns/django/PYSEC-2018-2.yaml
Related vulnerabilities
Recent vulnerabilities recorded for django.