CVE-2012-3442: Django Django Allows Redirect Vulnerability
CRITICALCVE-2012-3442 is a CRITICAL (CVSS 6.1) django allows redirect 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 allows redirect via data url. Remediation is available by upgrading affected packages to version 1.3.2, 1.4.1.
CVE-2012-3442 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.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N).
How to Fix CVE-2012-3442
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.3.2
pip install Django>=1.4.1
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-2012-3442, 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.3.2), 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-2012-3442 Affected Django Versions
2 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
Django
|
PyPI |
< 1.3.2
|
1.3.2
|
|
Django
|
PyPI |
≥ 1.4
< 1.4.1
|
1.4.1
|
References
Frequently Asked Questions
What is CVE-2012-3442?
Which Django versions are affected?
What version fixes CVE-2012-3442?
Is Django affected?
What is the CVSS score of CVE-2012-3442?
What CWE is associated with CVE-2012-3442?
How can I check PyPI dependencies for CVE-2012-3442?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-78vx-ggch-wghm",
"modified" : "2024-11-18T16:26:24Z",
"published" : "2022-05-17T05:12:01Z",
"aliases" : [ "CVE-2012-3442" ],
"summary" : "Django Allows Redirect via Data URL",
"details" : "The (1) `django.http.HttpResponseRedirect` and (2) `django.http.HttpResponsePermanentRedirect` classes in Django before 1.3.2 and 1.4.x before 1.4.1 do not validate the scheme of a redirect target, which might allow remote attackers to conduct cross-site scripting (XSS) attacks via a `data:` URL.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/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:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "PyPI",
"name" : "Django"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "1.3.2"
} ]
} ]
}, {
"package" : {
"ecosystem" : "PyPI",
"name" : "Django"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "1.4"
}, {
"fixed" : "1.4.1"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2012-3442"
}, {
"type" : "WEB",
"url" : "https://github.com/django/django/commit/4dea4883e6c50d75f215a6b9bcbd95273f57c72d"
}, {
"type" : "WEB",
"url" : "https://github.com/django/django/commit/e34685034b60be1112160e76091e5aee60149fa1"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/django/django"
}, {
"type" : "WEB",
"url" : "https://github.com/pypa/advisory-database/tree/main/vulns/django/PYSEC-2012-2.yaml"
}, {
"type" : "WEB",
"url" : "https://www.djangoproject.com/weblog/2012/jul/30/security-releases-issued"
}, {
"type" : "WEB",
"url" : "http://www.debian.org/security/2012/dsa-2529"
}, {
"type" : "WEB",
"url" : "http://www.mandriva.com/security/advisories?name=MDVSA-2012:143"
}, {
"type" : "WEB",
"url" : "http://www.openwall.com/lists/oss-security/2012/07/31/1"
}, {
"type" : "WEB",
"url" : "http://www.openwall.com/lists/oss-security/2012/07/31/2"
}, {
"type" : "WEB",
"url" : "http://www.ubuntu.com/usn/USN-1560-1"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-79" ],
"severity" : "CRITICAL",
"github_reviewed" : true,
"github_reviewed_at" : "2023-08-29T21:47:28Z",
"nvd_published_at" : "2012-07-31T17:55:00Z"
}
}