8.7high
Server-side file-write and request forgery via spatial lookups
- Severity
- 8.7high CVSS:4.0 by DSF
- Exploit likelihood
- 1.17% (higher than 67% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- DSF
- Also known as
- GHSA-wvqv-fj8w-qmhmBIT-DJANGO-2026-15307PYSEC-2026-4035
Description
An issue was discovered in Django 5.2 before 5.2.17 and 6.0 before 6.0.8. GeoDjango spatial lookups optimistically parse the right-hand-side value as a raster by passing it to the `django.contrib.gis.gdal.GDALRaster` constructor. Any value used in a spatial lookup against a `GeometryField` or `RasterField` reaches this constructor, including untrusted input, for example a spatial-field filter submitted through the Django admin changelist query string by a staff user with view permission. A `dict`, or a `str` holding its JSON representation, is opened in write mode regardless of the constructor's `write=False` default, allowing a file with an attacker-chosen name and contents to be written through a file-backed GDAL driver. Any other `str` is treated as a datasource, allowing an outbound network request through a GDAL virtual filesystem handler. Writing a file to a location later imported by the application can result in remote code execution. Earlier, unsupported Django series (such as 5.1.x, 5.0.x, and 4.2.x) were not evaluated and may also be affected. Django would like to thank Bence Nagy, localhost-detect, and kimchunbok_ for reporting this issue.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| django | from 6.0 before 6.0.8, from 5.2 before 5.2.17 Not affected: 6.0.8, 5.2.17 | CVE List |
| django (PyPI) | before 5.2.17, from 6.0a1 before 6.0.8 | GitHub Advisory Database, PyPA Advisory Database |
| djangoproject django | before 5.2.17, from 6.0 before 6.0.8 | NVD |
| django (Bitnami) | before 5.2.17, from 6.0.0 before 6.0.8 | Bitnami Vulnerability Database |
All scores
| DSF | 8.8high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H |
| DSF | 8.7high CVSS:4.0 | CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N |
| GitHub | 8.8high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H |
| GitHub | high CVSS:4.0 | CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N |
| PyPA Advisory Database | 8.8high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H |
| PyPA Advisory Database | Not scored CVSS:4.0 | CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N |
| Bitnami Vulnerability Database | high rating |
Classification
What each source says
CVE List
An issue was discovered in Django 5.2 before 5.2.17 and 6.0 before 6.0.8. GeoDjango spatial lookups optimistically parse the right-hand-side value as a raster by passing it to the `django.contrib.gis.gdal.GDALRaster` constructor. Any value used in a spatial lookup against a `GeometryField` or `RasterField` reaches this constructor, including untrusted input, for example a spatial-field filter submitted through the Django admin changelist query string by a staff user with view permission. A `dict`, or a `str` holding its JSON representation, is opened in write mode regardless of the constructor's `write=False` default, allowing a file with an attacker-chosen name and contents to be written through a file-backed GDAL driver. Any other `str` is treated as a datasource, allowing an outbound network request through a GDAL virtual filesystem handler. Writing a file to a location later imported by the application can result in remote code execution. Earlier, unsupported Django series (such as 5.1.x, 5.0.x, and 4.2.x) were not evaluated and may also be affected. Django would like to thank Bence Nagy, localhost-detect, and kimchunbok_ for reporting this issue.
NVD (es)
Se descubrió un problema en Django 5.2 anterior a 5.2.17 y 6.0 anterior a 6.0.8. Las búsquedas espaciales de GeoDjango analizan de forma optimista el valor del lado derecho como un ráster pasándolo al constructor “django.contrib.gis.gdal.GDALRaster”. Cualquier valor utilizado en una búsqueda espacial contra un “GeometryField” o “RasterField” llega a este constructor, incluyendo entrada no confiable, por ejemplo, un filtro de campo espacial enviado a través de la cadena de consulta de la lista de cambios del administrador de Django por un usuario del personal con permiso de vista. Un “dict”, o una “str” que contenga su representación JSON, se abre en modo de escritura independientemente del valor predeterminado “write=False” del constructor, permitiendo que se escriba un archivo con un nombre y contenido elegidos por el atacante a través de un controlador GDAL respaldado por archivos. Cualquier otra “str” se trata como una fuente de datos, permitiendo una solicitud de red saliente a través de un gestor de sistema de archivos virtual GDAL. Escribir un archivo en una ubicación importada posteriormente por la aplicación puede resultar en ejecución remota de código. Series de Django anteriores y no compatibles (como 5.1.x, 5.0.x y 4.2.x) no fueron evaluadas y también pueden verse afectadas. Django desea agradecer a Bence Nagy, localhost-detect y kimchunbok_ por informar sobre este problema.
References
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2026-15307 changed 2026-08-05 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-wvqv-fj8w-qmhm changed 2026-10-01 | CC-BY-4.0 |
| NVD | CVE-2026-15307 changed 2026-10-24 | Public domain |
| PyPA Advisory Database | PYSEC-2026-4035 changed 2026-10-01 | CC-BY-4.0 |
| Bitnami Vulnerability Database | BIT-DJANGO-2026-15307 changed 2026-10-01 | Apache-2.0 |