CVE-2013-1664: Django XML Entity Expansion (XEE) Vulnerability

MODERATE
Advisory Identifier: GHSA-qrh7-x6fp-c2mp
CWE-611
Published
Advisory Summary

CVE-2013-1664 is a MODERATE xml entity expansion (xee) vulnerability (CWE-611: Improper Restriction of XML External Entity Reference) affecting Django libraries in the PyPI ecosystem. The issue involves xml entity expansion (xee) in django. Remediation is available by upgrading affected packages to version 1.3.6, 1.4.4.

CVE-2013-1664 at a Glance

CVE Identifier CVE-2013-1664
GHSA Identifier GHSA-qrh7-x6fp-c2mp
Severity MODERATE
CVSS v3.1 Base Score N/A
CWE Classification CWE-611: Improper Restriction of XML External Entity Reference
Affected Product Django
Package Ecosystem PyPI
Published Date
Last Updated

How to Fix CVE-2013-1664

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.3.6
pip install Django>=1.3.6
Django fixed: 1.4.4
pip install Django>=1.4.4
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-2013-1664, 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.6), 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-611: Improper Restriction of XML External Entity Reference, where the product processes an xml document that can contain xml entities with uris that resolve to documents outside of the intended sphere of control, causing the product to embed incorrect documents into its output. 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 XML libraries for Python, as used in OpenStack Keystone Essex, Folsom, and Grizzly; Compute (Nova) Essex and Folsom; Cinder Folsom; Django; and possibly other products allow remote attackers to cause a denial of service (resource consumption and crash) via an XML Entity Expansion (XEE) attack.

CVE-2013-1664 Affected Django Versions

2 component(s)
Fixed Versions:
1.3.61.4.4
Product / Package Ecosystem Affected Versions Fixed Version
Django
PyPI
≥ 1.3.0
< 1.3.6
1.3.6
Django
PyPI
≥ 1.4.0
< 1.4.4
1.4.4

References

Frequently Asked Questions

What is CVE-2013-1664?
CVE-2013-1664 is a security vulnerability in Django involving XML Entity Expansion (XEE) in Django under CWE-611: Improper Restriction of XML External Entity Reference.
Which Django versions are affected?
Affected versions include releases prior to 1.3.6, 1.4.4 across affected packages: Django.
What version fixes CVE-2013-1664?
Upgrading to 1.3.6, 1.4.4 (or the latest patched release for your respective branch) resolves the vulnerability.
Is Django affected?
Yes, Django is affected in releases prior to 1.3.6, 1.4.4. Upgrade your dependency to 1.3.6, 1.4.4 or later.
What CWE is associated with CVE-2013-1664?
CVE-2013-1664 is classified under CWE-611: Improper Restriction of XML External Entity Reference (The product processes an XML document that can contain XML entities with URIs that resolve to documents outside of the intended sphere of control, causing the product to embed incorrect documents into its output.).
How can I check PyPI dependencies for CVE-2013-1664?
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-qrh7-x6fp-c2mp",
  "modified" : "2024-05-21T20:12:01Z",
  "published" : "2022-05-17T05:09:40Z",
  "aliases" : [ "CVE-2013-1664" ],
  "summary" : "XML Entity Expansion (XEE) in Django",
  "details" : "The XML libraries for Python, as used in OpenStack Keystone Essex, Folsom, and Grizzly; Compute (Nova) Essex and Folsom; Cinder Folsom; Django; and possibly other products allow remote attackers to cause a denial of service (resource consumption and crash) via an XML Entity Expansion (XEE) attack.",
  "severity" : [ ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "Django"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.3.0"
      }, {
        "fixed" : "1.3.6"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "Django"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.4.0"
      }, {
        "fixed" : "1.4.4"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2013-1664"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/django/django/commit/1c60d07ba23e0350351c278ad28d0bd5aa410b40"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/django/django/commit/d19a27066b2247102e65412aa66917aff0091112"
  }, {
    "type" : "WEB",
    "url" : "https://bugs.launchpad.net/nova/+bug/1100282"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/django/django"
  }, {
    "type" : "WEB",
    "url" : "http://blog.python.org/2013/02/announcing-defusedxml-fixes-for-xml.html"
  }, {
    "type" : "WEB",
    "url" : "http://bugs.python.org/issue17239"
  }, {
    "type" : "WEB",
    "url" : "http://lists.openstack.org/pipermail/openstack-announce/2013-February/000078.html"
  }, {
    "type" : "WEB",
    "url" : "http://rhn.redhat.com/errata/RHSA-2013-0657.html"
  }, {
    "type" : "WEB",
    "url" : "http://rhn.redhat.com/errata/RHSA-2013-0658.html"
  }, {
    "type" : "WEB",
    "url" : "http://rhn.redhat.com/errata/RHSA-2013-0670.html"
  }, {
    "type" : "WEB",
    "url" : "http://ubuntu.com/usn/usn-1757-1"
  }, {
    "type" : "WEB",
    "url" : "http://www.openwall.com/lists/oss-security/2013/02/19/2"
  }, {
    "type" : "WEB",
    "url" : "http://www.openwall.com/lists/oss-security/2013/02/19/4"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-611" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-05-21T20:12:01Z",
    "nvd_published_at" : "2013-04-03T00:55:00Z"
  }
}