CVE-2025-59682 Django vulnerable to partial directory traversal via archives
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.
| Package | Affected | Fixed in |
|---|---|---|
django Bitnami | From 4.2.0 | 4.2.25, 5.1.13, 5.2.7 |
django PyPI | From 4.2 | 4.2.25, 5.1.13, 5.2.7 |
django PyPI | From 4.2 | 4.2.25 |
django PyPI | From 4.2 | 4.2.25 |
django PyPI | From 5.1 | 5.1.13 |
django PyPI | From 5.1 | 5.1.13 |
2 more packages
django PyPI | From 5.2 | 5.2.7 |
django PyPI | From 5.2 | 5.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.
Other vulnerabilities in Djangoproject Django
- CVE-2026-4277 Privilege abuse in GenericInlineModelAdmin
- CVE-2024-53908 Django SQL injection in HasKey(lhs, rhs) on Oracle
- CVE-2024-42005 Django SQL injection vulnerability
- CVE-2023-31047 Django bypasses validation when using one form field to upload multiple files
- CVE-2022-34265 Django `Trunc()` and `Extract()` database functions vulnerable to SQL Injection
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.