CVE-2026-15307: Django Server-side File-write and Request Forgery via Spatial Lookups
Summary
CVE-2026-15307: Server-side file-write and request forgery via spatial lookups. Affects django across 2 version ranges.
< 5.2.17
>= 6.0.0, < 6.0.8
Fixed in 5.2.17 or 6.0.8, depending on the release line you run. How to fix ↓
Also tracked for
The same CVE-2026-15307 is tracked separately for each ecosystem and vendor. Its fix information is the same; the package and affected versions differ.
Check if this vulnerability affects your application
Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.
No signup required · Results in about 60 seconds
Background
Django is a high-level Python web framework that encourages rapid development and clean, pragmatic design. It provides a robust set of features for building web applications, including an ORM, an admin interface, and support for geographic data through GeoDjango. The framework is widely used for its scalability and flexibility. However, certain versions of Django are vulnerable to a critical issue that allows attackers to exploit spatial lookups, leading to potential file writes and remote code execution.
Vulnerability Detail
An issue was discovered in Django versions 5.2 before 5.2.17 and 6.0 before 6.0.8, where GeoDjango spatial lookups improperly handle untrusted input. Specifically, the right-hand-side value of a spatial lookup can be parsed as a raster, allowing attackers to write files with arbitrary names and contents through a file-backed GDAL driver. This vulnerability can lead to remote code execution if a malicious file is written to a location that the application later imports. Unsupported earlier versions of Django may also be affected.
How To Fix
Fixed versions by release line
The minimum fixed version depends on the release line you run.
-
< 5.2.175.2.17 -
>= 6.0.0, < 6.0.86.0.8
Tip — Not sure which release line you're on? Vulert can find the fix for the version you are using. Scan free →
Workaround
As a temporary workaround, you can restrict access to the Django admin interface to trusted users only, minimizing the risk of untrusted input being processed. Additionally, consider implementing input validation to sanitize any user-provided data before it reaches the spatial lookup functionality.
Conclusion
The vulnerability identified as CVE-2026-15307 poses a significant risk to applications using affected versions of Django. It is crucial to update to the patched versions to safeguard against potential exploitation. Implementing workarounds can provide temporary relief while preparing for the update.
See every vulnerability recorded for django →
FAQ
Django versions 5.2 before 5.2.17 and 6.0 before 6.0.8 are affected. Earlier unsupported versions may also be vulnerable.
Exploitation of this vulnerability can lead to unauthorized file writes and potentially remote code execution, compromising the security of the application.
You can use Vulert to monitor and alert for open-source vulnerabilities in your software. Visit Vulert Scanner to check if your application is affected without requiring any signup.
If an immediate update is not possible, implement access controls and input validation as a temporary workaround to mitigate the risk.
More details can be found in the official Django security advisory and the CVE database entry for CVE-2026-15307.
Related vulnerabilities
Recent vulnerabilities recorded for django.