CVE-2017-12794 Django vulnerable to XSS on 500 pages

Medium 6.1 Published Updated

Cross-site scripting in Django's debug page allows attackers to execute scripts if DEBUG mode is enabled in production.

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-2017-12794?

CVE-2017-12794 is a medium-severity cross-site scripting vulnerability in Djangoproject Django, published on 7 Sep 2017. 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

In Django 1.10.x before 1.10.8 and 1.11.x before 1.11.5, HTML autoescaping was disabled in a portion of the template for the technical 500 debug page. Given the right circumstances, this allowed a cross-site scripting attack. This vulnerability shouldn't affect most production sites since you shouldn't run with "DEBUG = True" (which makes this page accessible) in your production settings.

Weakness: CWE-79

Which versions are affected by CVE-2017-12794?

5 open source packages ship an affected version, including django and Django. It affects 1 product.

PackageAffectedFixed in
django PyPIFrom 1.101.10.8, 1.11.5
django PyPIFrom 1.10a11.10.8
django PyPIFrom 1.11a11.11.5
Django PyPIFrom 1.10a11.10.8
Django PyPIFrom 1.11a11.11.5

Products include Djangoproject Django.

How do I fix CVE-2017-12794?

Upgrade django to a fixed version for your release line: 1.10.8 or 1.11.5.

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-2017-12794 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2017-12794 exists.

Public exploit code: 1 Nuclei template.

All Djangoproject Django vulnerabilities

Sources

Also known as ALPINE-CVE-2017-12794, DEBIAN-CVE-2017-12794, GHSA-9r8w-6x8c-6jr9, PYSEC-2017-44.

Is CVE-2017-12794 in your software?

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

Check your SBOMs for free