Skip to main content

Django EUVDEUVD-2025-32692

| CVE-2025-59682 MEDIUM
Relative Path Traversal (CWE-23)
2025-10-01 cve@mitre.org GHSA-q95w-c7qg-hrff
6.5
CVSS 3.1 · NVD
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Lure developer to malicious template archive
  2. Delivery
    Victim runs startproject/startapp --template
  3. Exploit
    archive.extract() allows common-prefix path traversal
  4. Execution
    Files written outside target directory
  5. Impact
    Limited 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.

This Month Plan within 30 days. Why: MEDIUM severity (CVSS 4.0-6.9).
Patch available 0.0% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv2 – 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)
v1 Mar 13, 2026 - 18:18 CVSS 3.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

Django 5.1 <5.1.13
Django 5.2 <5.2.7
Django 4.2 <4.2.25

Affected Packages

pypi django fix: 4.2.25, 5.1.13, 5.2.7

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

NVD PRIMARY 6.5 MEDIUM
AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N
vuln.today AI 2.5 LOW

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).

3.1 AV:L/AC:H/PR:N/UI:R/S:U/C:N/I:L/A:N
4.0 AV:L/AC:H/AT:N/PR:N/UI:P/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N
Ubuntu MEDIUM
Red Hat 8.8 HIGH

Primary rating from NVD.

CVSS VectorNVD

Attack Vector
Network
Attack Complexity
Low
Privileges Required
Low
User Interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
None
Availability
None

Lifecycle Timeline

5
Severity Changed
Oct 12, 2026 - 15:22 NVD
LOW MEDIUM
CVSS changed
Oct 12, 2026 - 15:22 NVD
3.1 (LOW) 6.5 (MEDIUM)
Patch released
Mar 31, 2026 - 21:13 nvd
Patch available
CVE Published
Oct 01, 2025 - 19:15 nvd
MEDIUM 6.5
CVE Published
Oct 01, 2025 - 19:15 nvd
LOW 3.1

DescriptionNVD

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
† from your stack dependencies † transitive graph · vuln.today resolves 4-path depth
  • 41 pypi packages depend on django (39 direct, 2 indirect)

Ecosystem-wide dependent count for version 4.2.

Executive ViewAI

Why It Matters

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.

Business Impact: Low
Compensating Controls

Apply vendor patch during routine maintenance. Standard security controls provide adequate interim protection.

Threat Intelligence Overview

EPSS Score
0.0%
Top 95% exploitable
Prevalence
High
Django is one of the most widely deployed Python web frameworks
Data Quality
6 sources
Confidence: High

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.

SignalValue
Severity MEDIUM
CISA KEV No
Public POC No
EPSS 0.0%
Patch available Yes
Active threat No
Deciding rule
MEDIUM severity (CVSS 4.0-6.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Defer
Exploitation· derived
None
System Exposure· derived
Open
Automatable· derived
No
Human Impact
Low

Priority Score

32
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +32
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Path traversal exploits occur when applications use user-controlled input to construct file system paths without proper validation.

More in Django

View all
CVE-2021-23336 MEDIUM POC
5.9 Feb 15

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

CVE-2017-12794 MEDIUM POC
6.1 Sep 07

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

CVE-2022-34265 CRITICAL POC
9.8 Jul 04

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

CVE-2021-35042 CRITICAL POC
9.8 Jul 02

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

CVE-2019-19844 CRITICAL POC
9.8 Dec 18

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

CVE-2026-61594 CRITICAL POC
9.1 Sep 16

An authentication/authorization bypass in the djust Python live-view framework (versions prior to 1.0.7) lets unauthenti

CVE-2026-61599 HIGH POC
8.8 Sep 16

Unauthenticated arbitrary Python module import in djust before 1.0.7 lets any client that can reach the WebSocket or SSE

CVE-2020-9402 HIGH POC
8.8 Mar 05

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

CVE-2016-6186 MEDIUM POC
6.1 Aug 05

Cross-site scripting (XSS) vulnerability in the dismissChangeRelatedObjectPopup function in contrib/admin/static/admin/j

CVE-2026-93456 HIGH POC
8.4 Sep 18

Forged content modification in django-page-cms through 2.0.13 lets unauthenticated remote attackers exploit five CSRF-ex

CVE-2026-61593 HIGH POC
8.1 Sep 16

Cross-site request forgery in djust's Server-Sent-Events transport affects all versions prior to 1.0.7 and allows a cros

CVE-2026-61590 HIGH POC
7.4 Sep 16

Unauthenticated remote attackers can read live Django view and session state and invoke server-side handlers through dju

Vendor StatusVendor

Ubuntu

Priority: Medium
python-django
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
python-django
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 -

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy