Django Package Vulnerability: Arbitrary URL Redirection and Phishing Risk

python-django Updated 02 Oct 2025

Summary

08/04/2016
N/A
Yes i
High
7.4

CVE-2016-2512: The utils.http.is_safe_url function in Django before 1.8.10 and 1.9.x before 1.9.3 allows remote attackers to redirect users to arbitrary web sites and conduct phishing attacks or possibly conduct cross-site scripting (X... Affects python-django across 2 version ranges.

< 1.9.4-1 < c5544d289233f501917e25970c03ed444abbd4f0

Fixed in 1.9.4-1. How to fix ↓

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

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

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 high-level Python web framework that encourages rapid development and clean, pragmatic design. It provides a robust set of features for building web applications, including an ORM, authentication, and URL routing. However, prior to versions 1.8.10 and 1.9.3, Django's utils.http.is_safe_url function was susceptible to a vulnerability that allowed attackers to redirect users to malicious websites, potentially leading to phishing attacks.

Vulnerability Detail

The utils.http.is_safe_url function in Django versions before 1.8.10 and 1.9.x before 1.9.3 is vulnerable to an issue that allows remote attackers to redirect users to arbitrary web sites. This vulnerability can be exploited by crafting a URL that includes basic authentication, which can lead to phishing attacks or cross-site scripting (XSS) attacks. The vulnerability arises from improper validation of URLs, allowing attackers to manipulate the redirection process.

How To Fix

Minimum fixed version

1.9.4-1

This is the first release that contains the fix.

sudo apt-get install --only-upgrade python-django

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

If upgrading is not immediately possible, consider implementing a custom URL validation function that strictly checks the allowed domains and does not permit URLs with embedded credentials. This can help mitigate the risk until an upgrade can be performed.

Conclusion

The CVE-2016-2512 vulnerability in Django poses significant risks, including the potential for phishing attacks through arbitrary URL redirection. It is crucial for developers using affected versions to upgrade to at least version 1.9.4 to ensure the security of their applications.

See every vulnerability recorded for python-django →

Share this vulnerability

FAQ

CVE-2016-2512 is a vulnerability in Django that allows attackers to redirect users to arbitrary web sites, potentially leading to phishing attacks.

Django versions before 1.8.10 and 1.9.x before 1.9.3 are affected by this vulnerability.

You can use Vulert's playground to check if your application is affected by this vulnerability without requiring any signup.

The CVSS score of this vulnerability is 7.4, indicating a high severity level.

If immediate upgrading is not possible, implement a custom URL validation function to restrict allowed domains and mitigate risks.

Related vulnerabilities

Recent vulnerabilities recorded for python-django.

How To Fix

Minimum fixed version

1.9.4-1

This is the first release that contains the fix.

sudo apt-get install --only-upgrade python-django

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