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

MODERATE
Advisory Identifier: GHSA-7fq8-4pv5-5w5c
CVSS 6.1
CWE-79
Published
Advisory Summary

CVE-2015-2317 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 (xss) attack via user-supplied redirect urls. Remediation is available by upgrading affected packages to version 1.4.20, 1.6.11, 1.7.7, 1.8c1.

CVE-2015-2317 at a Glance

CVE Identifier CVE-2015-2317
GHSA Identifier GHSA-7fq8-4pv5-5w5c
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-2317

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.20
pip install Django>=1.4.20
Django fixed: 1.6.11
pip install Django>=1.6.11
Django fixed: 1.7.7
pip install Django>=1.7.7
Django fixed: 1.8c1
pip install Django>=1.8c1
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-2317, 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.20), 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 utils.http.is_safe_url function in Django before 1.4.20, 1.5.x, 1.6.x before 1.6.11, 1.7.x before 1.7.7, and 1.8.x before 1.8c1 does not properly validate URLs, which allows remote attackers to conduct cross-site scripting (XSS) attacks via a control character in a URL, as demonstrated by a \x08javascript: URL.

CVE-2015-2317 Affected Django Versions

4 component(s)
Fixed Versions:
1.4.201.6.111.7.71.8c1
Product / Package Ecosystem Affected Versions Fixed Version
Django
PyPI
< 1.4.20
1.4.20
Django
PyPI
≥ 1.5
< 1.6.11
1.6.11
Django
PyPI
≥ 1.7
< 1.7.7
1.7.7
Django
PyPI
≥ 1.8a1
< 1.8c1
1.8c1

References

NVD — CVE-2015-2317 NVD
https://nvd.nist.gov/vuln/detail/CVE-2015-2317
Security Fix Commit FIX COMMIT
https://github.com/django/django/commit/2342693b31f740a422abf7267c53b4e7bc487c1b
Security Fix Commit FIX COMMIT
https://github.com/django/django/commit/2a4113dbd532ce952308992633d802dc169a75f1
Security Fix Commit FIX COMMIT
https://github.com/django/django/commit/5510f070711540aaa8d3707776cd77494e688ef9
Security Fix Commit FIX COMMIT
https://github.com/django/django/commit/770427c2896a078925abfca2317486b284d22f04
Django Source Repository REPOSITORY
https://github.com/django/django
Django Source Repository REPOSITORY
https://github.com/pypa/advisory-database/tree/main/vulns/django/PYSEC-2015-9.yaml
Django Security Information SECURITY
https://web.archive.org/web/20200228131706/http://www.securityfocus.com/bid/73319
Django Release RELEASE
https://www.djangoproject.com/weblog/2015/mar/18/security-releases
lists.fedoraproject.org/pipermail/package-a... WEB
http://lists.fedoraproject.org/pipermail/package-announce/2015-April/155421.html
lists.fedoraproject.org/pipermail/package-a... WEB
http://lists.fedoraproject.org/pipermail/package-announce/2015-June/160263.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-2539-1 WEB
http://ubuntu.com/usn/usn-2539-1
Django Security Information SECURITY
http://www.debian.org/security/2015/dsa-3204
Django Security Information SECURITY
http://www.mandriva.com/security/advisories?name=MDVSA-2015:195
Django Security Information SECURITY
http://www.oracle.com/technetwork/topics/security/bulletinapr2015-2511959.html

Frequently Asked Questions

What is CVE-2015-2317?
CVE-2015-2317 is a security vulnerability in Django involving Django cross-site scripting (XSS) attack via user-supplied redirect URLs 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.20, 1.6.11, 1.7.7, 1.8c1 across affected packages: Django.
What version fixes CVE-2015-2317?
Upgrading to 1.4.20, 1.6.11, 1.7.7, 1.8c1 (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.20, 1.6.11, 1.7.7, 1.8c1. Upgrade your dependency to 1.4.20, 1.6.11, 1.7.7, 1.8c1 or later.
What is the CVSS score of CVE-2015-2317?
CVE-2015-2317 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-2317?
CVE-2015-2317 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-2317?
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-7fq8-4pv5-5w5c",
  "modified" : "2024-09-18T16:03:52Z",
  "published" : "2022-05-14T02:06:51Z",
  "aliases" : [ "CVE-2015-2317" ],
  "summary" : "Django cross-site scripting (XSS) attack via user-supplied redirect URLs",
  "details" : "The utils.http.is_safe_url function in Django before 1.4.20, 1.5.x, 1.6.x before 1.6.11, 1.7.x before 1.7.7, and 1.8.x before 1.8c1 does not properly validate URLs, which allows remote attackers to conduct cross-site scripting (XSS) attacks via a control character in a URL, as demonstrated by a \\x08javascript: 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.20"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "Django"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.5"
      }, {
        "fixed" : "1.6.11"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "Django"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.7"
      }, {
        "fixed" : "1.7.7"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "Django"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.8a1"
      }, {
        "fixed" : "1.8c1"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2015-2317"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/django/django/commit/2342693b31f740a422abf7267c53b4e7bc487c1b"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/django/django/commit/2a4113dbd532ce952308992633d802dc169a75f1"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/django/django/commit/5510f070711540aaa8d3707776cd77494e688ef9"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/django/django/commit/770427c2896a078925abfca2317486b284d22f04"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/django/django"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pypa/advisory-database/tree/main/vulns/django/PYSEC-2015-9.yaml"
  }, {
    "type" : "WEB",
    "url" : "https://web.archive.org/web/20200228131706/http://www.securityfocus.com/bid/73319"
  }, {
    "type" : "WEB",
    "url" : "https://www.djangoproject.com/weblog/2015/mar/18/security-releases"
  }, {
    "type" : "WEB",
    "url" : "http://lists.fedoraproject.org/pipermail/package-announce/2015-April/155421.html"
  }, {
    "type" : "WEB",
    "url" : "http://lists.fedoraproject.org/pipermail/package-announce/2015-June/160263.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-2539-1"
  }, {
    "type" : "WEB",
    "url" : "http://www.debian.org/security/2015/dsa-3204"
  }, {
    "type" : "WEB",
    "url" : "http://www.mandriva.com/security/advisories?name=MDVSA-2015:195"
  }, {
    "type" : "WEB",
    "url" : "http://www.oracle.com/technetwork/topics/security/bulletinapr2015-2511959.html"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-79" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-04-29T12:01:27Z",
    "nvd_published_at" : "2015-03-25T14:59:00Z"
  }
}