CVE-2025-59682 is a low-severity (CVSS 3.1) CWE-23 vulnerability in django. A fix is available for django — see the affected versions and patch details below.
Django vulnerable to partial directory traversal via archives
Exploitation Status
No confirmed exploitation observed yet
- CISA’s own triage has not observed active exploitation or public proof-of-concept code for this CVE as of its last assessment.
Exploitation and automatability from CISA’s SSVC triage for CVE-2025-59682.
EPSS Exploitation Probability
Probability of exploitation in the next 30 days, from FIRST.org EPSS.
How urgent is this, really
Where this sits among everything scored
Real-World Exposure
django🐍django🐍djangoReal-time download stats are indexed for npm and PyPI packages. This vulnerability affects PyPI packages — download data is not available via public APIs for these ecosystems.
Description
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.
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 🐍PyPI | django | ≥ 4.2&&< 4.2.25 | 4.2.25pip install --upgrade 'django==4.2.25' |
| 🐍PyPI | django | ≥ 5.1&&< 5.1.13 | 5.1.13pip install --upgrade 'django==5.1.13' |
| 🐍PyPI | django | ≥ 5.2&&< 5.2.7 | 5.2.7pip install --upgrade 'django==5.2.7' |
Affected Products
djangodjangoprojectDetection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for django, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update django to 4.2.25 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms CVE-2025-59682 is resolved across your whole dependency graph.
Workarounds
Resolve every user-supplied path to its canonical form and reject anything that escapes the intended directory, and run the component under an account that has no read or write access outside the directory it legitimately serves.
Fixing This On Your OS
If you run this on a Linux distribution, patch through your package manager against the distro's own security advisory below — it tracks the exact backported fix for your release, which can ship on a different timeline (and sometimes a different severity) than the upstream project.
Mitigation for this issue is either not available or the currently available options do not meet the Red Hat Product Security criteria comprising ease of use and deployment, applicability to widespread installation base or stability.Source: Red Hat security advisory for CVE-2025-59682 (CC BY 4.0)
| Product | Fixed in | Advisory |
|---|---|---|
| Red Hat Ansible Automation Platform 2.5 for RHEL 8 | python3.11-django-0:4.2.25-1.el8ap | RHSA-2025:18979 |
| Red Hat Ansible Automation Platform 2.5 for RHEL 8 | ansible-automation-platform-25/lightspeed-rhel8:2.5.250924-2 | RHSA-2025:18984 |
| Red Hat Ansible Automation Platform 2.6 for RHEL 9 | python3.11-django-0:4.2.25-1.el9ap | RHSA-2025:19201 |
| Red Hat Ansible Automation Platform 2.6 | ansible-automation-platform-26/lightspeed-rhel9:2.6 | RHSA-2025:19221 |
| Red Hat Ansible Automation Platform 2.6 | ansible-automation-platform-tech-preview/ansible-devspaces-rhel9:2.6-1765600296 | RHSA-2025:23196 |
| Red Hat Discovery 2 | discovery/discovery-server-rhel9:1767888970 | RHSA-2026:0414 |
Frequently Asked Questions
Is CVE-2025-59682 in your dependencies?
Find it across PyPI, including transitive dependencies.