Critical Vulnerability in Python-Django: Unvalidated URL Exposure
Summary
UBUNTU-CVE-2019-12308: An issue was discovered in Django 1.11 before 1.11.21, 2.1 before 2.1.9, and 2.2 before 2.2.2. Affects python-django versions 1.5.4-1ubuntu1 – 1.6.11-0ubuntu1.3+esm7. No fix is published. How to fix ↓
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
Python-Django is a high-level Python web framework that encourages rapid development and clean, pragmatic design. It is widely used for building web applications and provides a robust set of features, including an admin interface, ORM, and security measures. However, certain versions of Django are vulnerable to an issue that allows unvalidated URLs to be displayed, potentially leading to security risks.
Vulnerability Detail
An issue was discovered in Django versions 1.11 before 1.11.21, 2.1 before 2.1.9, and 2.2 before 2.2.2. The AdminURLFieldWidget displays the provided URL value without validating it as a safe URL. This could allow an attacker to store an unvalidated URL in the database or provide a malicious URL as a query parameter, resulting in a clickable JavaScript link that could lead to cross-site scripting (XSS) attacks.
How To Fix
No fixed version is published for this vulnerability.
Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. Scan free →
Workaround
As a temporary workaround, you can sanitize the URLs stored in your database or validate user input before storing it. This can be done by implementing a validation function that checks if the URL is safe before it is saved or displayed.
Conclusion
The vulnerability in Python-Django poses a significant security risk due to the unvalidated URL exposure. It is crucial to update to the patched version to mitigate this risk and ensure the safety of web applications built with Django.
See every vulnerability recorded for python-django →
FAQ
The CVSS score of this vulnerability is 6.1, indicating a medium severity level.
The affected versions include Django 1.11 before 1.11.21, 2.1 before 2.1.9, and 2.2 before 2.2.2.
You can use the Vulert playground at Vulert Scanner to check if your application is affected by this vulnerability without requiring any signup.
If exploited, this vulnerability could lead to cross-site scripting (XSS) attacks, allowing attackers to execute malicious scripts in the context of the user's browser.
No subscription is required to access the fix for this vulnerability; the patched version is available for free.
Related vulnerabilities
Recent vulnerabilities recorded for python-django.