CVE-2017-12794 Django vulnerable to XSS on 500 pages
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.
| Package | Affected | Fixed in |
|---|---|---|
django PyPI | From 1.10 | 1.10.8, 1.11.5 |
django PyPI | From 1.10a1 | 1.10.8 |
django PyPI | From 1.11a1 | 1.11.5 |
Django PyPI | From 1.10a1 | 1.10.8 |
Django PyPI | From 1.11a1 | 1.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.
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-2017-12794, DEBIAN-CVE-2017-12794, GHSA-9r8w-6x8c-6jr9, PYSEC-2017-44.