CVE-2026-15307: CWE-73: External Control of File Name or Path in djangoproject Django
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.
AI Analysis
Technical Summary
The vulnerability arises from GeoDjango spatial lookups parsing the right-hand-side value as a raster by passing it to the django.contrib.gis.gdal.GDALRaster constructor. Untrusted input, such as spatial-field filters submitted via the Django admin changelist query string, can cause a dict or JSON string to be opened in write mode, allowing file creation with attacker-controlled names and contents via a file-backed GDAL driver. Other string inputs are treated as datasources, enabling outbound network requests through a GDAL virtual filesystem handler. Writing files to locations later imported by the application can result in remote code execution. Affected versions include Django 5.2 prior to 5.2.17 and 6.0 prior to 6.0.8. Earlier unsupported versions may also be vulnerable. The CVSS v3.1 score is 8.8 (high severity) with network attack vector, low attack complexity, requiring low privileges but no user interaction, and impacts confidentiality, integrity, and availability.
Potential Impact
Successful exploitation allows an attacker with staff view permissions to write files with arbitrary names and contents on the server or trigger outbound network requests, potentially leading to remote code execution. This compromises confidentiality, integrity, and availability of the affected system. The vulnerability affects the GeoDjango component when processing spatial lookups against GeometryField or RasterField, exposing a critical risk in applications using these features.
Mitigation Recommendations
Patch status is not yet confirmed — check the vendor advisory for current remediation guidance. Until an official fix is released, restrict staff user permissions to limit access to spatial-field filters and avoid using untrusted input in spatial lookups. Monitor vendor channels for updates and apply patches promptly once available.
CVE-2026-15307: CWE-73: External Control of File Name or Path in djangoproject Django
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.
CVSS v3.1
Score 8.8high
Affected software
djangoproject
Django
Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
Weaknesses
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
The vulnerability arises from GeoDjango spatial lookups parsing the right-hand-side value as a raster by passing it to the django.contrib.gis.gdal.GDALRaster constructor. Untrusted input, such as spatial-field filters submitted via the Django admin changelist query string, can cause a dict or JSON string to be opened in write mode, allowing file creation with attacker-controlled names and contents via a file-backed GDAL driver. Other string inputs are treated as datasources, enabling outbound network requests through a GDAL virtual filesystem handler. Writing files to locations later imported by the application can result in remote code execution. Affected versions include Django 5.2 prior to 5.2.17 and 6.0 prior to 6.0.8. Earlier unsupported versions may also be vulnerable. The CVSS v3.1 score is 8.8 (high severity) with network attack vector, low attack complexity, requiring low privileges but no user interaction, and impacts confidentiality, integrity, and availability.
Potential Impact
Successful exploitation allows an attacker with staff view permissions to write files with arbitrary names and contents on the server or trigger outbound network requests, potentially leading to remote code execution. This compromises confidentiality, integrity, and availability of the affected system. The vulnerability affects the GeoDjango component when processing spatial lookups against GeometryField or RasterField, exposing a critical risk in applications using these features.
Mitigation Recommendations
Patch status is not yet confirmed — check the vendor advisory for current remediation guidance. Until an official fix is released, restrict staff user permissions to limit access to spatial-field filters and avoid using untrusted input in spatial lookups. Monitor vendor channels for updates and apply patches promptly once available.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- DSF
- Date Reserved
- 2026-07-09T16:50:57.960Z
- Cvss Version
- 3.1
- State
- PUBLISHED
Threat ID: 6a72133ebf8831d5391ad448
Added to database: 08/04/2026, 16:28:46 UTC
Last enriched: 08/11/2026, 18:00:34 UTC
Last updated: 09/17/2026, 22:01:33 UTC
Views: 44
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.