CVE-2015-0220: Django Cross-Site Scripting Vulnerability

MODERATE
Advisory Identifier: GHSA-gv98-g628-m9x5
CVSS 6.1
CWE-79
Published
Advisory Summary

CVE-2015-0220 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 cross-site scripting vulnerability. Remediation is available by upgrading affected packages to version 1.4.18, 1.6.10, 1.7.3.

CVE-2015-0220 at a Glance

CVE Identifier CVE-2015-0220
GHSA Identifier GHSA-gv98-g628-m9x5
Severity MODERATE
CVSS v3.1 Base Score 6.1
CWE Classification CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
Affected Product Django
Package Ecosystem PyPI
Published Date
Last Updated

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).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction Required (UI:R)
Scope Changed (S:C)
Confidentiality Low (C:L)
Integrity Low (I:L)
Availability None (A:N)

How to Fix CVE-2015-0220

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.

Django fixed: 1.4.18
pip install Django>=1.4.18
Django fixed: 1.6.10
pip install Django>=1.6.10
Django fixed: 1.7.3
pip install Django>=1.7.3
Verify Direct and Transitive Dependencies

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-2015-0220, 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.4.18), 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

The `django.util.http.is_safe_url` function in Django before 1.4.18, 1.6.x before 1.6.10, and 1.7.x before 1.7.3 does not properly handle leading whitespaces, which allows remote attackers to conduct cross-site scripting (XSS) attacks via a crafted URL, related to redirect URLs, as demonstrated by a `\njavascript:` URL.

CVE-2015-0220 Affected Django Versions

3 component(s)
Fixed Versions:
1.4.181.6.101.7.3
Product / Package Ecosystem Affected Versions Fixed Version
Django
PyPI
< 1.4.18
1.4.18
Django
PyPI
≥ 1.6
< 1.6.10
1.6.10
Django
PyPI
≥ 1.7
< 1.7.3
1.7.3

References

NVD — CVE-2015-0220 NVD
https://nvd.nist.gov/vuln/detail/CVE-2015-0220
Security Fix Commit FIX COMMIT
https://github.com/django/django/commit/4c241f1b710da6419d9dca160e80b23b82db7758
Security Fix Commit FIX COMMIT
https://github.com/django/django/commit/72e0b033662faa11bb7f516f18a132728aa0ae28
Security Fix Commit FIX COMMIT
https://github.com/django/django/commit/de67dedc771ad2edec15c1d00c083a1a084e1e89
Django Source Repository REPOSITORY
https://github.com/django/django
Django Release RELEASE
https://github.com/django/django/blob/4555a823fd57e261e1b19c778429473256c8ea08/docs/releases/1.4.18.txt#L34-L46
Django Source Repository REPOSITORY
https://github.com/pypa/advisory-database/tree/main/vulns/django/PYSEC-2015-5.yaml
web.archive.org/web/20150128111656/... WEB
https://web.archive.org/web/20150128111656/http://secunia.com/advisories/62285
Django Security Information SECURITY
https://web.archive.org/web/20150523054951/http://www.mandriva.com/en/support/security/advisories/advisory/MDVSA-2015:109/?name=MDVSA-2015:109
Django Security Information SECURITY
https://web.archive.org/web/20150523054953/http://www.mandriva.com/en/support/security/advisories/advisory/MDVSA-2015:036/?name=MDVSA-2015:036
web.archive.org/web/20151104201446/... WEB
https://web.archive.org/web/20151104201446/http://secunia.com/advisories/62718
Django Security Information SECURITY
https://www.djangoproject.com/weblog/2015/jan/13/security
lists.fedoraproject.org/pipermail/package-a... WEB
http://lists.fedoraproject.org/pipermail/package-announce/2015-January/148485.html
lists.fedoraproject.org/pipermail/package-a... WEB
http://lists.fedoraproject.org/pipermail/package-announce/2015-January/148608.html
lists.opensuse.org/opensuse-updates/20... WEB
http://lists.opensuse.org/opensuse-updates/2015-04/msg00001.html
lists.opensuse.org/opensuse-updates/20... WEB
http://lists.opensuse.org/opensuse-updates/2015-09/msg00035.html
ubuntu.com/usn/usn-2469-1 WEB
http://ubuntu.com/usn/usn-2469-1

Frequently Asked Questions

What is CVE-2015-0220?
CVE-2015-0220 is a security vulnerability in Django involving Django Cross-site Scripting Vulnerability under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting').
Which Django versions are affected?
Affected versions include releases prior to 1.4.18, 1.6.10, 1.7.3 across affected packages: Django.
What version fixes CVE-2015-0220?
Upgrading to 1.4.18, 1.6.10, 1.7.3 (or the latest patched release for your respective branch) resolves the vulnerability.
Is Django affected?
Yes, Django is affected in releases prior to 1.4.18, 1.6.10, 1.7.3. Upgrade your dependency to 1.4.18, 1.6.10, 1.7.3 or later.
What is the CVSS score of CVE-2015-0220?
CVE-2015-0220 has a CVSS v3.1 base score of 6.1 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N.
What CWE is associated with CVE-2015-0220?
CVE-2015-0220 is classified under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') (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.).
How can I check PyPI dependencies for CVE-2015-0220?
Run the dependency tree command: 'pip show Django'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-gv98-g628-m9x5",
  "modified" : "2024-09-18T19:55:30Z",
  "published" : "2022-05-17T03:20:49Z",
  "aliases" : [ "CVE-2015-0220" ],
  "summary" : "Django Cross-site Scripting Vulnerability",
  "details" : "The `django.util.http.is_safe_url` function in Django before 1.4.18, 1.6.x before 1.6.10, and 1.7.x before 1.7.3 does not properly handle leading whitespaces, which allows remote attackers to conduct cross-site scripting (XSS) attacks via a crafted URL, related to redirect URLs, as demonstrated by a `\\njavascript:` 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:P/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "Django"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.4.18"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "Django"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.6"
      }, {
        "fixed" : "1.6.10"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "Django"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.7"
      }, {
        "fixed" : "1.7.3"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2015-0220"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/django/django/commit/4c241f1b710da6419d9dca160e80b23b82db7758"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/django/django/commit/72e0b033662faa11bb7f516f18a132728aa0ae28"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/django/django/commit/de67dedc771ad2edec15c1d00c083a1a084e1e89"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/django/django"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/django/django/blob/4555a823fd57e261e1b19c778429473256c8ea08/docs/releases/1.4.18.txt#L34-L46"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pypa/advisory-database/tree/main/vulns/django/PYSEC-2015-5.yaml"
  }, {
    "type" : "WEB",
    "url" : "https://web.archive.org/web/20150128111656/http://secunia.com/advisories/62285"
  }, {
    "type" : "WEB",
    "url" : "https://web.archive.org/web/20150523054951/http://www.mandriva.com/en/support/security/advisories/advisory/MDVSA-2015:109/?name=MDVSA-2015:109"
  }, {
    "type" : "WEB",
    "url" : "https://web.archive.org/web/20150523054953/http://www.mandriva.com/en/support/security/advisories/advisory/MDVSA-2015:036/?name=MDVSA-2015:036"
  }, {
    "type" : "WEB",
    "url" : "https://web.archive.org/web/20151104201446/http://secunia.com/advisories/62718"
  }, {
    "type" : "WEB",
    "url" : "https://www.djangoproject.com/weblog/2015/jan/13/security"
  }, {
    "type" : "WEB",
    "url" : "http://lists.fedoraproject.org/pipermail/package-announce/2015-January/148485.html"
  }, {
    "type" : "WEB",
    "url" : "http://lists.fedoraproject.org/pipermail/package-announce/2015-January/148608.html"
  }, {
    "type" : "WEB",
    "url" : "http://lists.opensuse.org/opensuse-updates/2015-04/msg00001.html"
  }, {
    "type" : "WEB",
    "url" : "http://lists.opensuse.org/opensuse-updates/2015-09/msg00035.html"
  }, {
    "type" : "WEB",
    "url" : "http://ubuntu.com/usn/usn-2469-1"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-79" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2023-08-03T21:14:30Z",
    "nvd_published_at" : "2015-01-16T16:59:00Z"
  }
}