Cross-Site Scripting (XSS) Vulnerability in Django

python-django Updated 02 Oct 2025

Summary

23/05/2008
N/A
Yes i
Unrated
Not published

CVE-2008-2302: Cross-site scripting (XSS) vulnerability in the login form in the administration application in Django 0.91 before 0.91.2, 0.95 before 0.95.3, and 0.96 before 0.96.2 allows remote attackers to inject arbitrary web script... Affects python-django versions < 0.96.2-1. Fixed in 0.96.2-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 MarkAI Find prospects already talking about the problem you solve AI watches the communities your customers use to find qualified prospects, then alerts you when a conversation is worth joining. See MarkAI

Background

Django is a high-level Python web framework that enables rapid development and clean design. It follows the model-view-controller architectural pattern and emphasizes reusability and pluggability. The vulnerability affects Django versions 0.91 to 0.96.1, allowing remote attackers to inject arbitrary web script or HTML through the URI of a specific previous request.

Vulnerability Detail

The vulnerability arises from a cross-site scripting (XSS) flaw in the login form of the Django administration application. By manipulating the URI of a previous request, an attacker can inject malicious web script or HTML code into the login form. This can lead to various consequences, such as session hijacking, data theft, or the execution of arbitrary actions on behalf of the targeted user.

How To Fix

Minimum fixed version

0.96.2-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 Django is not immediately feasible, a temporary workaround can be implemented by implementing input validation and output encoding in the affected login form. This can help prevent the execution of injected scripts or the rendering of malicious HTML. However, it is crucial to note that workarounds may not provide complete protection and upgrading to the patched version is still the recommended solution.

Conclusion

The cross-site scripting vulnerability in Django versions 0.91 to 0.96.1 can have severe consequences, including session hijacking and data theft. It is crucial to upgrade to version 0.96.2-1 or later to mitigate this vulnerability. If immediate upgrading is not possible, implementing input validation and output encoding in the affected login form can serve as a temporary workaround. However, upgrading to the patched version remains the recommended solution. For further support, contact DevNack.com.

See every vulnerability recorded for python-django →

Share this vulnerability

FAQ

The vulnerability allows attackers to inject malicious web script or HTML, potentially leading to session hijacking, data theft, or unauthorized actions on behalf of users.

The vulnerability affects Django versions 0.91 to 0.96.1.

You can use Vulert's playground at Vulert Scanner to check if your application is affected by this vulnerability. Vulert analyzes package-lock.json files to monitor and alert in real-time for open-source vulnerabilities.

While specific exploits for this vulnerability may exist, they have not been disclosed in the provided information. However, it is crucial to address the vulnerability promptly to mitigate potential risks.

For further support on vulnerability remediation, you can reach out to info@devnack.com. They can provide guidance and assistance in addressing the vulnerability in your Django application.

Related vulnerabilities

Recent vulnerabilities recorded for python-django.

How To Fix

Minimum fixed version

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