CVE-2019-12308 Django Cross-site Scripting in AdminURLFieldWidget
Attackers can inject malicious JavaScript into the Django Admin URL field widget, potentially executing code in the context of an admin user.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Over the internet
- Victim action needed
- A user has to click or open something
- Fix
- Available
What is CVE-2019-12308?
CVE-2019-12308 is a medium-severity cross-site scripting vulnerability in Djangoproject Django, published on 3 Jun 2019. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.
Official description
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. The clickable Current URL value displayed by the AdminURLFieldWidget displays the provided value without validating it as a safe URL. Thus, an unvalidated value stored in the database, or a value provided as a URL query parameter payload, could result in an clickable JavaScript link.
Weakness: CWE-79
Which versions are affected by CVE-2019-12308?
7 open source packages ship an affected version, including django and Django. It affects 1 product.
| Package | Affected | Fixed in |
|---|---|---|
django PyPI | From 1.11a1 | 1.11.21 |
django PyPI | From 2.1 | 2.1.9, 1.11.21, 2.2.2 |
django PyPI | From 2.1a1 | 2.1.9 |
django PyPI | From 2.2a1 | 2.2.2 |
Django PyPI | From 1.11a1 | 1.11.21 |
Django PyPI | From 2.1a1 | 2.1.9 |
1 more packages
Django PyPI | From 2.2a1 | 2.2.2 |
Linux distribution packages (2)
python-Django1 SUSE:OpenStack Cloud 9 | All versions | 1.11.20-3.6.1 |
python-Django1 SUSE:OpenStack Cloud Crowbar 9 | All versions | 1.11.20-3.6.1 |
Products include Djangoproject Django.
How do I fix CVE-2019-12308?
Upgrade django to a fixed version for your release line: 1.11.21, 2.1.9 or 2.2.2.
Escape output for the context it lands in and set a strict Content Security Policy. Upgrading the affected component is the real fix. More about Cross-site scripting.
Is CVE-2019-12308 being exploited?
There is no known exploitation of CVE-2019-12308 in the wild and no public exploit code.
Other vulnerabilities in Djangoproject Django
- CVE-2026-4277 Privilege abuse in GenericInlineModelAdmin
- CVE-2024-53908 Django SQL injection in HasKey(lhs, rhs) on Oracle
- CVE-2024-42005 Django SQL injection vulnerability
- CVE-2023-31047 Django bypasses validation when using one form field to upload multiple files
- CVE-2022-34265 Django `Trunc()` and `Extract()` database functions vulnerable to SQL Injection
Sources
Also known as ALPINE-CVE-2019-12308, DEBIAN-CVE-2019-12308, DLA-1814-1, GHSA-7rp2-fm2h-wchj, PYSEC-2019-79, SUSE-SU-2019:2034-1 and 1 more.