CVE-2017-12794: Django Cross-Site Scripting Vulnerability
MODERATECVE-2017-12794 is a MODERATE (CVSS 6.1) cross-site scripting vulnerability (CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')) affecting Django libraries in the PyPI ecosystem. The issue involves django vulnerable to xss on 500 pages. Remediation is available by upgrading affected packages to version 1.10.8, 1.11.5.
CVE-2017-12794 at a Glance
Security Impact
CVSS: 6.1
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N).
How to Fix CVE-2017-12794
To remediate this vulnerability, upgrade all affected Django dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
pip install Django>=1.10.8
pip install Django>=1.11.5
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
pip show Django
How to Check if You Are Affected
To determine whether your Python environment is affected by CVE-2017-12794, inspect your installed packages using pip:
pip show Django
Analyze the terminal output to locate any version of Django in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.10.8), your application is affected.
Note: The pip show Django command checks currently installed packages in your active Python environment.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting'), where the product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. In Django, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2017-12794 Affected Django Versions
2 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
Django
|
PyPI |
≥ 1.10a1
< 1.10.8
|
1.10.8
|
|
Django
|
PyPI |
≥ 1.11a1
< 1.11.5
|
1.11.5
|
References
Frequently Asked Questions
What is CVE-2017-12794?
Which Django versions are affected?
What version fixes CVE-2017-12794?
Is Django affected?
What is the CVSS score of CVE-2017-12794?
What CWE is associated with CVE-2017-12794?
How can I check PyPI dependencies for CVE-2017-12794?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-9r8w-6x8c-6jr9",
"modified" : "2024-09-18T15:51:10Z",
"published" : "2019-01-04T17:50:34Z",
"aliases" : [ "CVE-2017-12794" ],
"summary" : "Django vulnerable to XSS on 500 pages",
"details" : "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.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N"
}, {
"type" : "CVSS_V4",
"score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "PyPI",
"name" : "Django"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "1.10a1"
}, {
"fixed" : "1.10.8"
} ]
} ]
}, {
"package" : {
"ecosystem" : "PyPI",
"name" : "Django"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "1.11a1"
}, {
"fixed" : "1.11.5"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2017-12794"
}, {
"type" : "WEB",
"url" : "https://github.com/django/django/commit/58e08e80e362db79eb0fd775dc81faad90dca47a"
}, {
"type" : "WEB",
"url" : "https://github.com/django/django/commit/e35a0c56086924f331e9422daa266e907a4784cc"
}, {
"type" : "ADVISORY",
"url" : "https://github.com/advisories/GHSA-9r8w-6x8c-6jr9"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/django/django"
}, {
"type" : "WEB",
"url" : "https://github.com/pypa/advisory-database/tree/main/vulns/django/PYSEC-2017-44.yaml"
}, {
"type" : "WEB",
"url" : "https://usn.ubuntu.com/3559-1"
}, {
"type" : "WEB",
"url" : "https://web.archive.org/web/20170927072701/http://www.securitytracker.com/id/1039264"
}, {
"type" : "WEB",
"url" : "https://web.archive.org/web/20200227150819/http://www.securityfocus.com/bid/100643"
}, {
"type" : "WEB",
"url" : "https://www.djangoproject.com/weblog/2017/sep/05/security-releases"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-79" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2020-06-16T21:29:31Z",
"nvd_published_at" : null
}
}