Django 4.2/5.x Partial Path Traversal in django.utils.archive.extract before 4.2.25/5.1.13/5.2.7
CVE-2025-59682 Published on October 1, 2025

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.

NVD

Weakness Type

Relative Path Traversal

The software 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. This allows attackers to traverse the file system to access files or directories that are outside of the restricted directory.


Products Associated with CVE-2025-59682

stack.watch emails you whenever new vulnerabilities are published in Django Project Django or Canonical Ubuntu Linux. Just hit a watch button to start following.

 
 

Affected Versions

djangoproject Django:

Exploit Probability

EPSS
0.02%
Percentile
4.11%

EPSS (Exploit Prediction Scoring System) scores estimate the probability that a vulnerability will be exploited in the wild within the next 30 days. The percentile shows you how this score compares to all other vulnerabilities.