Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB
CVE-2026-87890 Overview
CVE-2026-87890 is a Server-Side Request Forgery (SSRF) vulnerability in Django's geographic information system (GIS) spatial lookup functionality. The flaw is an incomplete fix for the prior CVE-2026-15307. An attacker who can supply bytes values to Django spatial lookups can cause the Django process to issue outbound network requests. The attacker achieves this by crafting a Virtual Raster (VRT) document that references an external raster source. The Django security team credits sicksec for reporting the issue.
Critical Impact
Attackers can coerce a vulnerable Django server to make attacker-controlled outbound network requests, enabling SSRF against internal services and potential exposure of limited confidentiality and integrity data [CWE-918].
Affected Products
- Django 6.1 before 6.1.2
- Django 6.0 before 6.0.9
- Django 5.2 before 5.2.18
- Unsupported Django series (5.1.x, 5.0.x, 4.2.x) were not evaluated and may also be affected
Discovery Timeline
- 2026-10-06 - Django releases security advisory crediting sicksec for reporting the issue
- 2026-10-06 - CVE-2026-87890 published to NVD
- 2026-10-06 - Last updated in NVD database
Technical Details for CVE-2026-87890
Vulnerability Analysis
The vulnerability is classified as Server-Side Request Forgery [CWE-918]. It affects Django's django.contrib.gis module, specifically spatial lookups that pass user-controlled values into GDAL-backed raster processing. The prior fix for CVE-2026-15307 blocked only str inputs that began with the VSI filesystem prefix or matched a JSON pattern. It did not account for bytes inputs. An attacker who can submit bytes values to a spatial lookup can supply a crafted VRT (GDAL Virtual Raster) document. The VRT document references an external raster source, which causes GDAL to fetch the remote resource and triggers an outbound network request from the Django process.
Root Cause
The root cause is incomplete type checking in the spatial lookup blocklist in django/contrib/gis/db/models/fields.py. The guard clauses that raise DisallowedRasterLookup evaluated only isinstance(obj, str) conditions. bytes payloads bypassed the guard and reached GDALRaster, which parses the VRT and resolves its external references.
Attack Vector
Exploitation is network-based and requires no authentication or user interaction. The attacker submits a crafted bytes payload containing a VRT XML document to an endpoint that forwards values into a Django GIS spatial lookup. GDAL parses the VRT, follows the referenced external raster URL, and emits an outbound network request from the Django host. The impact is limited to request issuance and response surface disclosure as reflected by the sidebar CVSS metrics.
# Patch excerpt - django/contrib/gis/db/models/fields.py
try:
obj = GEOSGeometry(obj, max_geom_collections=max_geom_collections)
except (TypeError, ValueError) as err:
- if isinstance(obj, str) and obj.startswith(VSI_FILESYSTEM_PREFIX):
+ if isinstance(obj, bytes) or (
+ isinstance(obj, str) and obj.startswith(VSI_FILESYSTEM_PREFIX)
+ ):
raise blocked_err
raise err
except (GEOSException, GDALException):
- if isinstance(obj, str) and json_regex.match(obj):
+ if isinstance(obj, bytes) or (
+ isinstance(obj, str) and json_regex.match(obj)
+ ):
raise blocked_err
raise ValueError(
"Couldn't create spatial object from lookup value '%s'." % obj
# Source: [Django Commit 4e77ef1e](https://github.com/django/django/commit/4e77ef1e69c94780006b82795aa7db101996c3af)
The patch also updates the DisallowedRasterLookup docstring in django/contrib/gis/gdal/raster/source.py to broaden the blocked category from "virtual filesystem paths" to any value that "could reference external sources". See Django Commit 4e77ef1e, Django Commit a2347fe, and Django Commit dd0558d for the 6.1.x, 6.0.x, and 5.2.x fixes respectively.
Detection Methods for CVE-2026-87890
Indicators of Compromise
- Unexpected outbound HTTP, HTTPS, or FTP connections from Django application hosts to attacker-controlled or internal-only destinations.
- Application logs containing spatial lookup values that are bytes payloads beginning with <VRTDataset or referencing SourceFilename elements.
- DisallowedRasterLookup or SuspiciousOperation exceptions appearing after patching, indicating blocked exploitation attempts.
Detection Strategies
- Inspect requests to endpoints that invoke django.contrib.gis querysets for binary payloads containing VRT XML markers such as <VRTDataset>, <VRTRasterBand>, or SourceFilename.
- Correlate inbound HTTP requests to GIS endpoints with outbound network connections from the application host within a short time window.
- Alert on new egress destinations initiated by Python or uWSGI/Gunicorn processes hosting Django workloads.
Monitoring Recommendations
- Monitor Django and web server logs for unusual query parameters passed to GIS spatial lookup fields.
- Enforce and log egress firewall decisions for Django workloads, especially traffic to cloud metadata services and RFC1918 ranges.
- Track Django release versions across the fleet and alert when hosts remain on 6.1 < 6.1.2, 6.0 < 6.0.9, or 5.2 < 5.2.18.
How to Mitigate CVE-2026-87890
Immediate Actions Required
- Upgrade Django to 6.1.2, 6.0.9, or 5.2.18 as appropriate for your deployment branch.
- Audit application code for places where request-derived bytes values flow into django.contrib.gis spatial lookups.
- Restrict egress network access from Django hosts to only required destinations to limit SSRF blast radius.
Patch Information
The Django project released fixed versions 6.1.2, 6.0.9, and 5.2.18 on 2026-10-06. The fix extends the DisallowedRasterLookup guard to reject bytes values in addition to the previously blocked str values. Review the Django Weblog Security Releases and the Django Security Release Notes for release details. Backport commits are available for 6.1.x, 6.0.x, 5.2.x, and an additional backport in commit ebcb13b.
Workarounds
- Wrap raster lookup values in an explicit GDALRaster object controlled by the application instead of passing raw user input.
- Reject or sanitize bytes inputs at the view or serializer layer before they reach spatial lookups.
- Block outbound network access from Django processes to arbitrary destinations using host or network firewall rules.
# Upgrade Django to a patched release
pip install --upgrade "Django>=6.1.2,<6.2"
# or for the 6.0 series
pip install --upgrade "Django>=6.0.9,<6.1"
# or for the 5.2 LTS series
pip install --upgrade "Django>=5.2.18,<5.3"
# Verify installed version
python -c "import django; print(django.get_version())"
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB

