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.
Published: 2026-08-04
Score: 8.7 High
EPSS: < 1% Very Low
KEV: No
Impact: n/a
Action: n/a
AI Analysis

Impact

The vulnerability arises from GeoDjango’s spatial lookup mechanism that parses user‑supplied values using the GDALRaster constructor. Because this constructor is called with write mode enabled for dictionary inputs or stringified dictionaries, an attacker can create or overwrite files in locations determined by the attacker. For other string inputs, the constructor treats them as datasources, potentially triggering outbound network requests through the GDAL virtual filesystem. An attacker with a staff view permission can craft query strings targeting these lookups, leading to the creation of files that, if later imported by the application, can execute code on the server.

Affected Systems

This flaw is present in all Django 5.2 releases prior to 5.2.17 and in Django 6.0 releases before 6.0.8. Earlier Django series such as 5.1.x, 5.0.x, and 4.2.x may also be affected because the code paths were not evaluated in those releases. Any deployment using GeoDjango’s spatial lookups—particularly in the admin changelist query strings accessed by staff users—needs assessment.

Risk and Exploitability

The CVSS score of 8.7 indicates a high severity, and although the EPSS score is currently unavailable, the lack of listing in the CISA KEV catalog suggests no publicly confirmed exploits yet. The vulnerability requires that an authenticated staff member craft a special request to the server, and successful exploitation would allow an attacker to write arbitrary files or make outbound requests via GDAL, providing a pathway to remote code execution. The attack vector is therefore a server‑side request forged through a legitimate view‑only account and is not trivial but under the control of a privileged user within the organization.

Generated by OpenCVE AI on August 5, 2026 at 13:23 UTC.

Remediation

No vendor fix or workaround currently provided.

OpenCVE Recommended Actions

  • Upgrade to Django 5.2.17 or Django 6.0.8 or later.
  • Restrict staff users to legitimate spatial lookups and remove or limit untrusted query string usage in GeoDjango admin views.
  • Configure GDAL to disallow write mode for GDALRaster or disable risky GDAL drivers to prevent file creation and outbound requests.

Generated by OpenCVE AI on August 5, 2026 at 13:23 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories yet.

History

Tue, 18 Aug 2026 16:45:00 +0000

Type Values Removed Values Added
CPEs cpe:2.3:a:djangoproject:django:*:*:*:*:*:*:*:*

Wed, 05 Aug 2026 12:15:00 +0000

Type Values Removed Values Added
Weaknesses CWE-434
References
Metrics threat_severity

None

threat_severity

Important


Tue, 04 Aug 2026 18:30:00 +0000

Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'none', 'Technical Impact': 'total'}, 'version': '2.0.3'}


Tue, 04 Aug 2026 17:45:00 +0000

Type Values Removed Values Added
First Time appeared Djangoproject
Djangoproject django
Vendors & Products Djangoproject
Djangoproject django

Tue, 04 Aug 2026 16:30:00 +0000

Type Values Removed Values Added
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.
Title Server-side file-write and request forgery via spatial lookups
Weaknesses CWE-73
CWE-918
References
Metrics cvssV3_1

{'score': 8.8, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H'}

cvssV4_0

{'score': 8.7, 'vector': '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'}


Subscriptions

Djangoproject Django
cve-icon MITRE

Status: PUBLISHED

Assigner: DSF

Published:

Updated: 2026-08-05T03:57:15.862Z

Reserved: 2026-07-09T16:50:57.960Z

Link: CVE-2026-15307

cve-icon Vulnrichment

Updated: 2026-08-04T17:21:52.775Z

cve-icon NVD

Status : Analyzed

Published: 2026-08-04T17:16:46.127

Modified: 2026-08-18T16:29:03.070

Link: CVE-2026-15307

cve-icon Redhat

Severity : Important

Publid Date: 2026-08-04T15:48:18Z

Links: CVE-2026-15307 - Bugzilla

cve-icon OpenCVE Enrichment

Updated: 2026-08-05T13:30:05Z

Weaknesses
  • CWE-434

    Unrestricted Upload of File with Dangerous Type

  • CWE-73

    External Control of File Name or Path

  • CWE-918

    Server-Side Request Forgery (SSRF)