CVE-2025-59682 Django vulnerable to partial directory traversal via archives

Low 3.1 Published Updated

Attackers can exploit directory traversal in Django's archive extraction to read or modify files outside the intended directory during project initialization.

Exploited in the wild
Not known
Login needed
Any signed-in user
Attackable
Over the internet
Victim action needed
Not needed
Fix
Available

What is CVE-2025-59682?

CVE-2025-59682 is a low-severity path traversal vulnerability in Djangoproject Django, published on 1 Oct 2025. Any signed-in user can exploit it over the network, with no action from the victim.

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

Weakness: CWE-23

Which versions are affected by CVE-2025-59682?

8 open source packages ship an affected version, including django. It affects 1 product.

PackageAffectedFixed in
django BitnamiFrom 4.2.04.2.25, 5.1.13, 5.2.7
django PyPIFrom 4.24.2.25, 5.1.13, 5.2.7
django PyPIFrom 4.24.2.25
django PyPIFrom 4.24.2.25
django PyPIFrom 5.15.1.13
django PyPIFrom 5.15.1.13
2 more packages
django PyPIFrom 5.25.2.7
django PyPIFrom 5.25.2.7

Products include Djangoproject Django.

How do I fix CVE-2025-59682?

Upgrade django to a fixed version for your release line: 4.2.25, 5.1.13 or 5.2.7.

Upgrade, and resolve every user-supplied path against an allowed base folder before opening it. More about Path traversal.

Is CVE-2025-59682 being exploited?

There is no known exploitation of CVE-2025-59682 in the wild and no public exploit code.

All Djangoproject Django vulnerabilities

Sources

Also known as BIT-django-2025-59682, CLSA-2026-1787899840, DEBIAN-CVE-2025-59682, ECHO-3acc-85cc-f3e5, GHSA-q95w-c7qg-hrff, PYSEC-2026-1296 and 1 more.

Is CVE-2025-59682 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free