CVE-2019-12308 Django Cross-site Scripting in AdminURLFieldWidget

Medium 6.1 Published Updated

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.

PackageAffectedFixed in
django PyPIFrom 1.11a11.11.21
django PyPIFrom 2.12.1.9, 1.11.21, 2.2.2
django PyPIFrom 2.1a12.1.9
django PyPIFrom 2.2a12.2.2
Django PyPIFrom 1.11a11.11.21
Django PyPIFrom 2.1a12.1.9
1 more packages
Django PyPIFrom 2.2a12.2.2
Linux distribution packages (2)
python-Django1 SUSE:OpenStack Cloud 9All versions1.11.20-3.6.1
python-Django1 SUSE:OpenStack Cloud Crowbar 9All versions1.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.

All Djangoproject Django vulnerabilities

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.

Is CVE-2019-12308 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free