Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessLure developer to malicious template archive
-
DeliveryVictim runs startproject/startapp --template
-
Exploitarchive.extract() allows common-prefix path traversal
-
ExecutionFiles written outside target directory
-
ImpactLimited integrity impact on developer host
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A06:2021 - Vulnerable and Outdated Components
ASVS 5.0
V14 - Configuration Dependency management, component inventory
|
| Exploitation Conditions | Exploitation requires the victim to invoke Django's 'startapp --template' or 'startproject --template' management command and point it at an attacker-controlled archive; the archive must contain file paths that share a common prefix with the target extraction directory (hence 'partial' traversal, not arbitrary absolute-path write). Limiting factors are significant: this is a developer/CLI-time code path, not a runtime web surface, so it requires user action (running the scaffolding command) and the choice to extract an untrusted template; the traversal is constrained to a common-prefix sibling of the target directory rather than arbitrary filesystem locations; and affected deployments must run Django 4.2<4.2.25, 5.1<5.1.13, or 5.2<5.2.7. |
| Impact | This is a high-CVSS-but-low-real-risk issue in practice. The signals pull in different directions: the NVD CVSS 3.1 vector (AV:N/AC:L/PR:L/UI:N, base 6.5) implies a network-reachable, low-complexity flaw with high confidentiality impact, yet the description makes clear this is only reachable through the developer-facing 'startapp --template' and 'startproject --template' management commands - i.e., someone must deliberately run a project/app scaffolding command against an attacker-supplied archive. The CVSS vector therefore appears mislabeled relative to the description: AV:N and UI:N are hard to justify for a command-line template-extraction flaw, and the impact is a partial directory traversal (file placement/overwrite), which is an integrity concern, not the C:H/I:N confidentiality impact the vector asserts - verify with vendor. Exploitation-probability signals are uniformly low and consistent: EPSS is 0.02% (5th percentile), the vulnerability is NOT in CISA KEV, and no public exploit was identified in the provided data, so exploitation status is 'no public exploit identified at time of analysis.' CWE-23 (relative path traversal) and the 'partial' qualifier (paths must share a common prefix with the target directory) further constrain real-world impact. Net: patch as part of normal maintenance, but this is not an emergency - the attack requires a developer to run a scaffolding command against a malicious template, which is a narrow, opt-in code path rather than an exposed production surface. |
| Exploit ScenarioDerived | A developer runs 'django-admin startproject --template <archive>' (or 'startapp --template') pointing at an attacker-supplied archive - for example a template shared in a tutorial, repo, or URL. Because django.utils.archive.extract() permits paths that share a common prefix with the target directory, the archive can write files to a partially-traversed location just outside the intended project directory. No public proof-of-concept was identified in the provided data, and exploitation depends entirely on the victim choosing to extract an untrusted template. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv2 – Oct 12, 2026
Partial directory traversal in Django's django.utils.archive.extract() helper can write files outside the intended scaffolding directory, and it is reachable through the 'startapp --template' and 'startproject --template' management commands. It affects Django 4.2 before 4.2.25, 5.1 before 5.1.13, and 5.2 before 5.2.7, and exploitation requires the developer to deliberately run one of those commands against an attacker-supplied template archive whose entry paths share a common prefix with the extraction target - the traversal is confined to a common-prefix sibling directory rather than arbitrary filesystem locations, and because this is a local CLI/developer-time code path the practical risk is lower than the headline severity suggests. No public exploit code and no confirmed active exploitation were identified at time of analysis, and EPSS scores the issue at roughly 0.02% (5th percentile); NVD assigns a 6.5 base score while the independent assessment rates it AV:L/AC:H/PR:N/UI:R with only low integrity impact, so the real-world exposure is primarily to developers habitually scaffolding projects from untrusted third-party templates.
Earlier versions of this analysis (1)
RemediationAI
Vendor-released patches are available: upgrade to Django 4.2.25, 5.1.13, or 5.2.7 as appropriate for your release line (the fixes are carried in upstream commits 9504bbaa392c9fe37eee9291f5b4c29eb6037619 for 4.2, 74fa85c688a87224637155902bcd738bb9e65e11 for 5.1, ed8fc39d77465eddbde1191a054ae965f6a8a584 for 5.2, and af067f56c1dd467df4abd0ddd409a700da1f03ba for 6.0), and apply your distribution's build rather than a pip upgrade alone - Ubuntu USN-7794-1 (https://ubuntu.com/security/notices/USN-7794-1) and Debian DLA-4324-1, DSA-6117-1, and DSA-6136-1 cover the packaged versions. Where upgrading is not immediately possible, the effective compensating control is procedural rather than technical: never run 'startapp --template' or 'startproject --template' against an archive you have not inspected, since the flaw only triggers when a developer deliberately points the command at an untrusted template, and a manual pre-flight inspection or re-packing of the archive with normalized, traversal-free paths in a controlled directory removes the exposure entirely - the trade-off is that this relies on developer discipline and does not scale in automated scaffolding pipelines. Note that disabling the archive.extract() helper or the template options outright would break legitimate template-based project generation, and no network-level mitigation exists because the vulnerable code path is local to the CLI and never reachable from a web request.
Affected VersionsENISA
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 1 package in pypi
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
The root cause is CWE-23, relative path traversal, inside django.utils.archive.extract(), the helper Django uses to unpack ZIP/TAR template archives supplied via --template on the startapp and startproject commands. Because the function validates extracted paths against the destination directory using a prefix comparison rather than a proper normalized-path containment check, an archive entry such as '../<target-dir-name>-evil/payload.py' can resolve to a sibling directory whose absolute path merely shares a text prefix with the intended target - hence the advisory's careful wording 'partial' directory traversal. This is a library/protocol-level archiving flaw (Python zipfile/tarfile member names are not sanitized with a canonicalized commonpath check) rather than a web request-handling flaw: the affected code executes only when a developer invokes the management command, so it is not reachable over HTTP. The CPE data enumerates the django project as the single affected product across three version lines; upstream fixed each branch separately (the announcement commit 43d84aef04a9e71164c21a74885996981857e66e documents the security release alongside a sibling SQL-injection CVE, CVE-2025-59681, with per-branch code patches 9504bbaa392c9fe37eee9291f5b4c29eb6037619 for 4.2, 74fa85c688a87224637155902bcd738bb9e65e11 for 5.1, ed8fc39d77465eddbde1191a054ae965f6a8a584 for 5.2, and af067f56c1dd467df4abd0ddd409a700da1f03ba for 6.0).
Know when Django gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N
A developer must locally run a template command against an attacker's archive (AV:L, UI:R), the common-prefix constraint raises AC:H, and impact is limited file placement outside the target dir (I:L, no C/A).
Primary rating from NVD.
CVSS VectorNVD
Lifecycle Timeline
5DescriptionNVD
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.
Blast Radius
ecosystem impact- 41 pypi packages depend on django (39 direct, 2 indirect)
Ecosystem-wide dependent count for version 4.2.
Executive ViewAI
CVE-2025-59682 is a low-severity vulnerability in Django 4.2 (CVSS 3.1). The limited severity suggests constrained impact, typically requiring specific conditions or local access for exploitation. Apply vendor updates when available as part of routine maintenance.
Apply vendor patch during routine maintenance. Standard security controls provide adequate interim protection.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
Path traversal exploits occur when applications use user-controlled input to construct file system paths without proper validation.
The package python/cpython from 0 and before 3.6.13, from 3.7.0 and before 3.7.10, from 3.8.0 and before 3.8.8, from 3.9
In Django 1.10.x before 1.10.8 and 1.11.x before 1.11.5, HTML autoescaping was disabled in a portion of the template for
An issue was discovered in Django 3.2 before 3.2.14 and 4.0 before 4.0.6. Rated critical severity (CVSS 9.8), this vulne
Django 3.1.x before 3.1.13 and 3.2.x before 3.2.5 allows QuerySet.order_by SQL injection if order_by is untrusted input
Django before 1.11.27, 2.x before 2.2.9, and 3.x before 3.0.1 allows account takeover. Rated critical severity (CVSS 9.8
An authentication/authorization bypass in the djust Python live-view framework (versions prior to 1.0.7) lets unauthenti
Unauthenticated arbitrary Python module import in djust before 1.0.7 lets any client that can reach the WebSocket or SSE
Django 1.11 before 1.11.29, 2.2 before 2.2.11, and 3.0 before 3.0.4 allows SQL Injection if untrusted data is used as a
Cross-site scripting (XSS) vulnerability in the dismissChangeRelatedObjectPopup function in contrib/admin/static/admin/j
Forged content modification in django-page-cms through 2.0.13 lets unauthenticated remote attackers exploit five CSRF-ex
Cross-site request forgery in djust's Server-Sent-Events transport affects all versions prior to 1.0.7 and allows a cros
Unauthenticated remote attackers can read live Django view and session state and invoke server-side handlers through dju
Same weakness CWE-23 – Relative Path Traversal
View allSame technique Path Traversal
View allVendor StatusVendor
Ubuntu
Priority: Medium| Release | Status | Version |
|---|---|---|
| upstream | released | 4.2.25,5.1.13,5.2.7 |
| bionic | released | 1:1.11.11-1ubuntu1.21+esm12 |
| focal | released | 2:2.2.12-1ubuntu0.29+esm4 |
| jammy | released | 2:3.2.12-2ubuntu1.22 |
| noble | released | 3:4.2.11-1ubuntu1.11 |
| plucky | released | 3:4.2.18-1ubuntu1.5 |
| trusty | released | 1.6.11-0ubuntu1.3+esm8 |
| xenial | released | 1.8.7-1ubuntu5.15+esm9 |
| questing | released | 3:5.2.4-1ubuntu2 |
Debian
Bug #1116979| Release | Status | Fixed Version | Urgency |
|---|---|---|---|
| bullseye | fixed | 2:2.2.28-1~deb11u9 | - |
| bullseye (security) | fixed | 2:2.2.28-1~deb11u12 | - |
| bookworm | fixed | 3:3.2.25-0+deb12u1 | - |
| bookworm (security) | fixed | 3:3.2.25-0+deb12u2 | - |
| trixie | fixed | 3:4.2.27-0+deb13u1 | - |
| trixie (security) | fixed | 3:4.2.28-0+deb13u1 | - |
| forky, sid | fixed | 3:4.2.29-1 | - |
| (unstable) | fixed | 3:4.2.25-1 | - |
EUVD-2025-32692
GHSA-q95w-c7qg-hrff
NVD
CVE.org
EPSS
Exploit-DB