CVE-2013-4315: Django Path Traversal Vulnerability

HIGH
Advisory Identifier: GHSA-vjjp-9r83-22rc
CVSS 8.6
CWE-22
Published
Advisory Summary

CVE-2013-4315 is a HIGH (CVSS 8.6) path traversal vulnerability (CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')) affecting Django libraries in the PyPI ecosystem. The issue involves django directory traversal via ssi template tag. Remediation is available by upgrading affected packages to version 1.4.7, 1.5.3.

CVE-2013-4315 at a Glance

CVE Identifier CVE-2013-4315
GHSA Identifier GHSA-vjjp-9r83-22rc
Severity HIGH
CVSS v3.1 Base Score 8.6
CWE Classification CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')
Affected Product Django
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 8.6

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:N/S:C/C:H/I:N/A:N).

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

How to Fix CVE-2013-4315

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.7
pip install Django>=1.4.7
Django fixed: 1.5.3
pip install Django>=1.5.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-2013-4315, 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.7), 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-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal'), where the product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory. 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

Directory traversal vulnerability in Django 1.4.x before 1.4.7, 1.5.x before 1.5.3, and 1.6.x before 1.6 beta 3 allows remote attackers to read arbitrary files via a file path in the ALLOWED_INCLUDE_ROOTS setting followed by a `..` (dot dot) in a ssi template tag.

CVE-2013-4315 Affected Django Versions

2 component(s)
Fixed Versions:
1.4.71.5.3
Product / Package Ecosystem Affected Versions Fixed Version
Django
PyPI
≥ 1.4
< 1.4.7
1.4.7
Django
PyPI
≥ 1.5
< 1.5.3
1.5.3

References

Frequently Asked Questions

What is CVE-2013-4315?
CVE-2013-4315 is a security vulnerability in Django involving Django Directory Traversal via ssi template tag under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal').
Which Django versions are affected?
Affected versions include releases prior to 1.4.7, 1.5.3 across affected packages: Django.
What version fixes CVE-2013-4315?
Upgrading to 1.4.7, 1.5.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.7, 1.5.3. Upgrade your dependency to 1.4.7, 1.5.3 or later.
What is the CVSS score of CVE-2013-4315?
CVE-2013-4315 has a CVSS v3.1 base score of 8.6 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:N/A:N.
What CWE is associated with CVE-2013-4315?
CVE-2013-4315 is classified under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') (The product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory.).
How can I check PyPI dependencies for CVE-2013-4315?
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-vjjp-9r83-22rc",
  "modified" : "2024-09-18T18:57:02Z",
  "published" : "2022-05-17T04:56:46Z",
  "aliases" : [ "CVE-2013-4315" ],
  "summary" : "Django Directory Traversal via ssi template tag",
  "details" : "Directory traversal vulnerability in Django 1.4.x before 1.4.7, 1.5.x before 1.5.3, and 1.6.x before 1.6 beta 3 allows remote attackers to read arbitrary files via a file path in the ALLOWED_INCLUDE_ROOTS setting followed by a `..` (dot dot) in a ssi template tag.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:N/A:N"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "Django"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.4"
      }, {
        "fixed" : "1.4.7"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "Django"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.5"
      }, {
        "fixed" : "1.5.3"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2013-4315"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/django/django/commit/87d2750b39f6f2d54b7047225521a44dcd37e896"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/django/django/commit/988b61c550d798f9a66d17ee0511fb7a9a7f33ca"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/django/django"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pypa/advisory-database/tree/main/vulns/django/PYSEC-2013-20.yaml"
  }, {
    "type" : "WEB",
    "url" : "https://www.djangoproject.com/weblog/2013/sep/10/security-releases-issued"
  }, {
    "type" : "WEB",
    "url" : "http://lists.opensuse.org/opensuse-updates/2013-10/msg00015.html"
  }, {
    "type" : "WEB",
    "url" : "http://rhn.redhat.com/errata/RHSA-2013-1521.html"
  }, {
    "type" : "WEB",
    "url" : "http://www.debian.org/security/2013/dsa-2755"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-22" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2023-08-28T23:57:36Z",
    "nvd_published_at" : "2013-09-16T19:14:00Z"
  }
}