VMTech
Discuss a project →

Django Releases Fixes for Critical GeoDjango RasterField RCE

Django Releases Fixes for Critical GeoDjango RasterField RCE

Django has released versions 6.1.4, 6.0.11 and 5.2.20 to resolve seven security issues, including CVE-2026-124827, a critical GeoDjango vulnerability that could lead to remote code execution. The flaw, assigned a CVSS score of 9.0 and dubbed Django4Shell by Mohamed K. Fathy of Robusta Technology Group, concerns the assignment path for RasterField values.

Django’s advisory says a raster data definition assigned to django.contrib.gis.db.models.RasterField, when supplied with a user-controlled name and a non-default driver, could cause GDAL to write a file to an attacker-controlled location. Depending on the raster driver, that file-write capability could enable remote code execution.

Why the RasterField path is significant

The issue is reachable through forms because RasterField falls back to Django’s CharField form field. That means models containing RasterField may be exposed when they are registered in the Django admin, used with ModelForms, or made writable through model serializers. The advisory does not require a database interaction or a call to model.save() for the reported attack path.

Fathy said a crafted JSON raster body can let an attacker control the target path, file content and filename. The reported outcomes include overwriting application code, writing web shells into static directories, or corrupting configuration files. One described technique places sitecustomize.py in the worker’s current working directory; Python imports that file automatically at interpreter startup, before application code runs.

Consequently, a subsequent development-server reload, Gunicorn worker fork, manage.py cron job or subprocess execution could run the payload with the web server operating-system user’s privileges. The researcher also described potential placement of .pth files in site-packages, alongside access to secrets and environment variables and the possibility of modifying or exfiltrating data.

Part of an incomplete-fix sequence

CVE-2026-124827 is described as an incomplete fix for CVE-2026-87890, itself an incomplete patch for CVE-2026-15307, addressed in August 2026. CVE-2026-15307 affected GeoDjango’s spatial-lookup raster parsing and enabled server-side file writes with possible code execution consequences.

The later CVE-2026-87890 concerned server-side request forgery through crafted GDAL Virtual Raster payloads that referenced an external raster source. In October, Django changed spatial lookups so raster values supplied as bytes must be wrapped in GDALRaster, while valid hexadecimal geometry bytes remain accepted. Django warned that the change was backward incompatible and that untrusted input should be validated before use.

Deployment conditions and patching priorities

Fathy identified four conditions for the latest issue: a GeoDjango deployment with a RasterField model, exposure through a ModelForm or default admin, GDAL with the EHdr driver, and a writable target path. He characterized staff-level authentication as the primary requirement, while noting that standard admin forms and common GDAL builds can satisfy other conditions by default.

Organizations using GeoDjango raster data should inventory RasterField models, review staff-facing admin and form routes, validate untrusted raster input, and deploy the relevant fixed Django version. The same releases also address CVE-2026-132092, an SQL injection issue in range and in lookups; CVE-2026-115868, a potential cross-site scripting issue in truncatechars_html; and CVE-2026-125673, cache poisoning via dot segments in request paths. For affected teams, upgrading and reviewing RasterField exposure is the practical priority before assuming earlier GeoDjango mitigations are sufficient.

#django#geodjango#cybersecurity#vulnerability
Open analytics
On the site 2 views
min read 4 02.12.2026
Instagram

Django Releases Fixes for Critical GeoDjango RasterField RCE

Open the post on Instagram ↗