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 by staff users with view permission, can reach this constructor. A dict or JSON string is opened in write mode regardless of the default write=False setting, enabling file creation with attacker-controlled names and contents via a file-backed GDAL driver. Other strings are treated as data sources, potentially causing outbound network requests through a GDAL virtual filesystem handler. Writing a file to a location later imported by the application can result in remote code execution. Affected versions include Django 5.2 before 5.2.17 and 6.0 before 6.0.8. Earlier unsupported versions may also be vulnerable. The CVSS 3.1 score is 8.8 (high severity) with network attack vector, low attack complexity, requiring privileges (PR:L), no user interaction, and high impact on confidentiality, integrity, and availability.
Potential Impact
An attacker with staff user view permissions can exploit this vulnerability to write files with attacker-controlled names and contents on the server or cause outbound network requests. If the application imports the maliciously written files, this can lead to remote code execution, compromising confidentiality, integrity, and availability of the affected system.
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 minimize exposure, and avoid using untrusted input in spatial lookups. Monitor vendor channels for updates and apply official patches 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
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 by staff users with view permission, can reach this constructor. A dict or JSON string is opened in write mode regardless of the default write=False setting, enabling file creation with attacker-controlled names and contents via a file-backed GDAL driver. Other strings are treated as data sources, potentially causing outbound network requests through a GDAL virtual filesystem handler. Writing a file to a location later imported by the application can result in remote code execution. Affected versions include Django 5.2 before 5.2.17 and 6.0 before 6.0.8. Earlier unsupported versions may also be vulnerable. The CVSS 3.1 score is 8.8 (high severity) with network attack vector, low attack complexity, requiring privileges (PR:L), no user interaction, and high impact on confidentiality, integrity, and availability.
Potential Impact
An attacker with staff user view permissions can exploit this vulnerability to write files with attacker-controlled names and contents on the server or cause outbound network requests. If the application imports the maliciously written files, this can lead to remote code execution, compromising confidentiality, integrity, and availability of the affected system.
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 minimize exposure, and avoid using untrusted input in spatial lookups. Monitor vendor channels for updates and apply official patches 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
- Remediation Level
- null
Threat ID: 6a72133ebf8831d5391ad448
Added to database: 08/04/2026, 16:28:46 UTC
Last enriched: 08/04/2026, 16:47:31 UTC
Last updated: 08/04/2026, 18:48:38 UTC
Views: 5
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.