XSS Vulnerability in Django Package: python-django Affects Multiple Ubuntu Versions

python-django Updated 03 Oct 2025

Summary

03/06/2020
N/A
Yes i
Medium
6.1

UBUNTU-CVE-2020-13596: An issue was discovered in Django 2.2 before 2.2.13 and 3.0 before 3.0.7. Affects python-django versions < 1.6.11-0ubuntu1.3+esm1. Fixed in 1.6.11-0ubuntu1.3+esm1. 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 Lume, the Habilume companion Habilume Habit tracker with a companion that grows with you Complete habits, earn Lume Points, and watch your Lume grow as you stay consistent. App Store Google Play

Background

The python-django package is a widely used web framework for building web applications in Python. It provides a robust set of tools and features that facilitate rapid development and clean, pragmatic design. However, certain versions of this package have been found to be vulnerable to an XSS (Cross-Site Scripting) attack due to improper URL encoding of query parameters generated by the Django admin ForeignKeyRawIdWidget.

Vulnerability Detail

An issue was discovered in Django versions 2.2 before 2.2.13 and 3.0 before 3.0.7. The vulnerability arises from the failure to properly URL encode query parameters generated by the Django admin ForeignKeyRawIdWidget. This oversight can lead to XSS attacks, where an attacker could inject malicious scripts into web pages viewed by other users, potentially compromising user data and application integrity.

How To Fix

Minimum fixed version

1.6.11-0ubuntu1.3+esm1

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 immediate patching is not feasible, consider implementing input validation and sanitization on user inputs to mitigate the risk of XSS attacks. Additionally, restrict access to the Django admin interface to trusted users only.

Conclusion

The XSS vulnerability in the python-django package poses a significant risk to applications using affected versions. It is crucial to update to the latest patched versions to safeguard against potential attacks. Regular monitoring and vulnerability assessments using tools like Vulert can help maintain application security.

See every vulnerability recorded for python-django →

Share this vulnerability

FAQ

The CVSS score of this vulnerability is 6.1, indicating a medium severity level.

Django versions 2.2 before 2.2.13 and 3.0 before 3.0.7 are affected by this vulnerability.

You can use Vulert's playground at Vulert Scanner to check if your application is affected by this vulnerability without needing to sign up.

If exploited, this vulnerability can lead to XSS attacks, allowing attackers to inject malicious scripts that could compromise user data and application security.

For Ubuntu 14.04 LTS, a subscription to Ubuntu Pro is required for access to the patched version. However, no subscription is needed for the patched versions on Ubuntu 16.04 LTS, 18.04 LTS, and 20.04 LTS.

Related vulnerabilities

Recent vulnerabilities recorded for python-django.

Sponsored Lume, the Habilume companion Habilume Habit tracker with a companion that grows with you Complete habits, earn Lume Points, and watch your Lume grow as you stay consistent. App Store Google Play

How To Fix

Minimum fixed version

1.6.11-0ubuntu1.3+esm1

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