{"id":"CVE-2026-15307","published":"2026-08-04T15:48:18Z","modified":"2026-08-05T03:57:15Z","title":"Server-side file-write and request forgery via spatial lookups","vendor":"djangoproject","product":"Django","tier":"tail","description":{"text":"An issue was discovered in Django 5.2 before 5.2.17 and 6.0 before 6.0.8.\nGeoDjango 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.\nEarlier, unsupported Django series (such as 5.1.x, 5.0.x, and 4.2.x) were not evaluated and may also be affected.\nDjango would like to thank Bence Nagy, localhost-detect, and kimchunbok_ for reporting this issue.","provenance":"source","from":"CVE.org"},"cvss":{"score":8.8,"severity":"HIGH","version":"3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.01134,"percentile":0.67266,"provenance":"source"},"cwes":[{"id":"CWE-73","name":"External Control of File Name or Path"},{"id":"CWE-918","name":"Server-Side Request Forgery"}],"references":[{"url":"https://docs.djangoproject.com/en/dev/releases/security/","tags":["vendor-advisory"]},{"url":"https://groups.google.com/g/django-announce","tags":["mailing-list"]},{"url":"https://github.com/django/django/commit/f1949c1f9758947ade984c895ff16bef46f56520","tags":["patch"]},{"url":"https://github.com/django/django/commit/39b3e2d0c743a338def6c473086ebc06865e86b6","tags":["patch"]},{"url":"https://github.com/django/django/commit/208f80cb682868b584ed0a78f23e4ba6304212aa","tags":["patch"]},{"url":"https://github.com/django/django/commit/115ffd0463a765ab1cc93de18e94b5459b8a300e","tags":["patch"]},{"url":"https://www.djangoproject.com/weblog/2026/aug/04/security-releases/","tags":["vendor-advisory"]}],"priority":{"score":19.6,"factors":[{"name":"EPSS percentile","points":13.45},{"name":"CVSS severity","points":6.16}]},"vendorSlug":"djangoproject","affectedVersions":[{"vendor":"djangoproject","product":"Django","versions":[">= 6.0, < 6.0.8",">= 5.2, < 5.2.17"]}],"fixedVersions":[{"vendor":"djangoproject","product":"Django","versions":["6.0.8","5.2.17"]}],"capec":[{"id":"CAPEC-664","name":"Server Side Request Forgery"}],"ssvc":{"exploitation":"none","automatable":"no","technicalImpact":"total","timestamp":"2026-08-04T00:00:00+00:00","from":"CISA ADP","provenance":"source"},"affected":[{"ecosystem":"PyPI","package":"Django","vulnerableRanges":["<5.2.17",">=6.0a1, <6.0.8"],"patched":["5.2.17","6.0.8"],"from":["GHSA-wvqv-fj8w-qmhm","PYSEC-2026-4035"],"provenance":"source"}],"euvd":{"id":"EUVD-2026-52747","exploited":false,"provenance":"source"},"lineage":{"familyId":"fam-djangoproject-django-cve-2026-15307","children":[{"from":"CVE-2026-15307","to":"CVE-2026-87890","relation":"incomplete-fix","confidence":"high","kind":"lineage","evidence":[{"kind":"text","provenance":"source","relation":"incomplete-fix","quote":"An incomplete fix for CVE-2026-15307 in Django spatial lookups allows an attacker who can supply `bytes` values to cause the Django process to make network requests via a crafted VRT document referencing an external raster source.","from":"CVE.org","in":"CVE-2026-87890"},{"kind":"same-code","provenance":"machine","files":["django/contrib/gis/db/models/fields.py","django/contrib/gis/gdal/raster/source.py"],"commits":["https://github.com/django/django/commit/f1949c1f9758947ade984c895ff16bef46f56520","https://github.com/django/django/commit/39b3e2d0c743a338def6c473086ebc06865e86b6","https://github.com/django/django/commit/ebcb13b327301f28cbc6cd5e4988a719f00575aa","https://github.com/django/django/commit/4e77ef1e69c94780006b82795aa7db101996c3af"],"basis":"shared function","functions":["get_prep_value"]}]}],"packageHistory":[{"cve":"CVE-2026-35192","published":"2026-05-05","fixed":"6.0.5","kev":false},{"cve":"CVE-2026-5766","published":"2026-05-05","fixed":"6.0.5","kev":false},{"cve":"CVE-2026-6907","published":"2026-05-05","fixed":"6.0.5","kev":false,"link":{"from":"CVE-2026-6907","to":"CVE-2026-15307","relation":"successor","confidence":"low","kind":"sequence","evidence":[{"kind":"version-step","provenance":"source","package":"PyPI:Django","fromFixed":"6.0.5","toFixed":"6.0.8","daysApart":91},{"kind":"version-step","provenance":"source","package":"PyPI:Django","fromFixed":"5.2.14","toFixed":"5.2.17","daysApart":91}]}},{"cve":"CVE-2026-15307","published":"2026-08-04","fixed":"6.0.8","kev":false}],"package":"PyPI:Django"}}