CVE-2025-59682: Django Path Traversal Vulnerability
LOWCVE-2025-59682 is a LOW (CVSS 3.1) path traversal vulnerability (CWE-23: Relative Path Traversal) affecting Django libraries in the PyPI ecosystem. The issue involves django vulnerable to partial directory traversal via archives. Remediation is available by upgrading affected packages to version 4.2.25, 5.1.13, 5.2.7.
CVE-2025-59682 at a Glance
Security Impact
CVSS: 3.1
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:N/I:L/A:N).
How to Fix CVE-2025-59682
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>=4.2.25
pip install django>=5.1.13
pip install django>=5.2.7
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-2025-59682, 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 4.2.25), 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-23: Relative Path Traversal, where the product uses external input to construct a pathname that should be within a restricted directory, but it does not properly neutralize sequences such as ".." that can resolve to a location that is outside of that 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
CVE-2025-59682 Affected Django Versions
3 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
django
|
PyPI |
≥ 4.2
< 4.2.25
|
4.2.25
|
|
django
|
PyPI |
≥ 5.1
< 5.1.13
|
5.1.13
|
|
django
|
PyPI |
≥ 5.2
< 5.2.7
|
5.2.7
|
References
Frequently Asked Questions
What is CVE-2025-59682?
Which Django versions are affected?
What version fixes CVE-2025-59682?
Is django affected?
What is the CVSS score of CVE-2025-59682?
What CWE is associated with CVE-2025-59682?
How can I check PyPI dependencies for CVE-2025-59682?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-q95w-c7qg-hrff",
"modified" : "2025-11-05T20:47:25Z",
"published" : "2025-10-01T21:31:22Z",
"aliases" : [ "CVE-2025-59682" ],
"summary" : "Django vulnerable to partial directory traversal via archives",
"details" : "An issue was discovered in Django 4.2 before 4.2.25, 5.1 before 5.1.13, and 5.2 before 5.2.7. The django.utils.archive.extract() function, used by the \"startapp --template\" and \"startproject --template\" commands, allows partial directory traversal via an archive with file paths sharing a common prefix with the target directory.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:N/I:L/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "PyPI",
"name" : "django"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "4.2"
}, {
"fixed" : "4.2.25"
} ]
} ]
}, {
"package" : {
"ecosystem" : "PyPI",
"name" : "django"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "5.1"
}, {
"fixed" : "5.1.13"
} ]
} ]
}, {
"package" : {
"ecosystem" : "PyPI",
"name" : "django"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "5.2"
}, {
"fixed" : "5.2.7"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2025-59682"
}, {
"type" : "WEB",
"url" : "https://github.com/django/django/commit/43d84aef04a9e71164c21a74885996981857e66e"
}, {
"type" : "WEB",
"url" : "https://github.com/django/django/commit/924a0c092e65fa2d0953fd1855d2dc8786d94de2"
}, {
"type" : "WEB",
"url" : "https://docs.djangoproject.com/en/dev/releases/security"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/django/django"
}, {
"type" : "WEB",
"url" : "https://groups.google.com/g/django-announce"
}, {
"type" : "WEB",
"url" : "https://www.djangoproject.com/weblog/2025/oct/01/security-releases"
}, {
"type" : "WEB",
"url" : "http://www.openwall.com/lists/oss-security/2025/10/01/3"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-23" ],
"severity" : "LOW",
"github_reviewed" : true,
"github_reviewed_at" : "2025-10-01T21:57:54Z",
"nvd_published_at" : "2025-10-01T19:15:37Z"
}
}