Cross-Site Scripting Vulnerability in Python Django - CVE-2015-2317

python-django Updated 02 Oct 2025

Summary

25/03/2015
N/A
Yes i
Unrated
Not published

CVE-2015-2317: The utils.http.is_safe_url function in Django before 1.4.20, 1.5.x, 1.6.x before 1.6.11, 1.7.x before 1.7.7, and 1.8.x before 1.8c1 does not properly validate URLs, which allows remote attackers to conduct cross-site scr... Affects python-django versions < 1.7.7-1. Fixed in 1.7.7-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

Python Django is a high-level 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 an admin interface. However, certain versions of Django prior to 1.4.20, 1.5.x, 1.6.x before 1.6.11, 1.7.x before 1.7.7, and 1.8.x before 1.8c1 are vulnerable to a cross-site scripting (XSS) attack due to improper URL validation in the utils.http.is_safe_url function.

Vulnerability Detail

The vulnerability arises from the inability of the utils.http.is_safe_url function in Django to properly validate URLs. This flaw allows remote attackers to conduct XSS attacks by injecting control characters into URLs, such as a \x08javascript: URL. If exploited, this could lead to unauthorized actions being performed on behalf of users, potentially compromising sensitive information and application integrity.

How To Fix

Minimum fixed version

1.7.7-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 an immediate upgrade is not feasible, consider implementing input validation to sanitize URLs before processing them. This can help mitigate the risk of XSS attacks while you plan for a proper upgrade.

Conclusion

CVE-2015-2317 represents a significant security risk for applications using vulnerable versions of Django. It is crucial to upgrade to a patched version to protect against potential XSS attacks. Regular monitoring and vulnerability management practices, such as using tools like Vulert, can help maintain application security.

See every vulnerability recorded for python-django →

Share this vulnerability

FAQ

CVE-2015-2317 is a vulnerability in Django that allows for cross-site scripting (XSS) attacks due to improper URL validation.

Django versions before 1.4.20, 1.5.x, 1.6.x before 1.6.11, 1.7.x before 1.7.7, and 1.8.x before 1.8c1 are affected by this vulnerability.

You can use Vulert, which monitors and alerts for open-source vulnerabilities in your software. By using the Vulert playground, you can check if your application is affected without any signup.

Exploitation of this vulnerability could allow attackers to execute malicious scripts in the context of a user's session, leading to data theft, session hijacking, or unauthorized actions.

Yes, implementing input validation to sanitize URLs can help mitigate the risk of XSS attacks until an upgrade can be performed.

Related vulnerabilities

Recent vulnerabilities recorded for python-django.

How To Fix

Minimum fixed version

1.7.7-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