The Django project published security releases — versions 6.1.4, 6.0.11, and 5.2.20 — to remediate seven vulnerabilities, including a critical remote-code-execution (RCE) defect tracked as CVE-2026-124827 and codenamed "Django4shell." The weakness carries a CVSS score of 9.0 and is described by Mohamed K. Fathy, head of cybersecurity at Robusta Technology Group, as an incomplete fix that traces back through two earlier, related patches.
CVE-2026-124827 (Django4shell): the core problem
CVE-2026-124827 arises because protections added to mitigate earlier GeoDjango raster-parsing bugs did not extend to the RasterField assignment path. According to the Django maintainers, that omission "enables an attacker to obtain arbitrary file write and remote code execution primitives." The maintainers and Fathy explain that an attacker can control the target path, file content, and filename via a crafted JSON raster body, enabling overwriting of application source code, dropping web shells into static directories, or corrupting configuration files.
How an exploit would work: GDAL, RasterField, and sitecustomize.py
At the technical heart of Django4shell is GeoDjango's interaction with the Geospatial Data Abstraction Library (GDAL). The maintainers note that "Assigning a raster data definition to django.contrib.gis.db.models.RasterField with a user-controlled name parameter and a non-default driver could cause GDAL to write a file to an attacker-controlled location." Depending on the raster driver, that write could enable remote code execution.
Fathy described a specific, high-impact technique: writing a file named sitecustomize.py into the worker's current working directory (typically on sys.path). "By writing sitecustomize.py into the worker's current working directory (typically on sys.path), the attacker plants a file that Python automatically imports at interpreter startup — before any application code runs," he told The Hacker News. On the next server reload, worker fork, cron job, or subprocess execution, that payload would run with the web-server OS user's privileges. Attackers can also drop .pth files into site-packages, read secrets and environment variables, exfiltrate or modify data, and pivot within a host or network — all without any database interaction or a model.save() call.

This site is the portfolio.
OSINTSights runs on Cloudflare Workers, D1, R2, and Vectorize, with an AI pipeline on Hetzner ARM. Nubivance designed, built, and operates it. We do the same for clients.
See what we buildWhy many GeoDjango deployments are exposed by default
Successful exploitation requires four pre-conditions; three are commonly met in standard deployments, according to Fathy. They are:
- django.contrib.gis with a RasterField model (moderate prevalence),
- RasterField exposed via ModelForm or default admin (very high) — Django auto-generates admin forms for every registered model unless explicitly excluded,
- GDAL with the EHdr driver (near-universal) — EHdr ships in every standard GDAL build across common packaging systems, and
- a writable target path (very high) — the worker's current working directory is writable by definition and typically on sys.path.
Fathy emphasized that "the primary requirement is staff-level authentication" but added that "If an application uses RasterField, the remaining conditions are almost certainly met by default." The Django maintainers warn that because RasterField falls back to the CharField form field, the flaw was "reachable by default on models with RasterField registered in the admin or using ModelForms or writable model serializers." Their advisory bluntly states: "Organizations running GeoDjango with raster data, standard admin access, and a default GDAL build should consider themselves exposed until patched."
Mitigations, the release changes, and related fixes
To mitigate the SSRF and file-write issues that preceded Django4shell, the project required that "raster values provided as bytes must now be wrapped in GDALRaster before being used in spatial lookups." The maintainers added that "Byte values representing valid hexadecimal geometries remain accepted" and noted that this is a backward-incompatible change. They also reminded developers that "all untrusted user input should be validated before use."
Beyond CVE-2026-124827, the security updates address additional flaws in the framework: an SQL injection in range and in lookups (CVE-2026-132092), a potential cross-site scripting issue in the truncatechars_html template filter (CVE-2026-115868), and a cache poisoning vulnerability via dot segments in request paths (CVE-2026-125673).
What this means for technologists, government mapping platforms, and attackers
Technologists and security teams should prioritize upgrading to Django 6.1.4, 6.0.11, or 5.2.20 where possible and audit any use of django.contrib.gis.RasterField exposed through ModelForms, the admin, or writable serializers. The new requirement to wrap byte-valued rasters in GDALRaster represents a backward-incompatible change that will need code updates and validation of inputs.
Government, mapping, GIS, agricultural, and environmental platforms that rely on raster data should treat exposure as material given the prevalence of RasterField in such applications and the ubiquity of the EHdr driver in standard GDAL builds. Systems with default admin access or staff-level credentials available to many users are particularly at risk until patched.
Adversaries gain a powerful primitive if they can reach vulnerable endpoints with appropriate authentication: the ability to write to application files, plant Python import hooks like sitecustomize.py, and execute code as the web-server OS user can enable rapid escalation and lateral movement without touching a database.
For operators running GeoDjango, the concrete step is clear: apply the supplied updates and validate raster inputs per the maintainers' guidance. As the advisory notes, the chain of incomplete fixes that produced Django4shell — from CVE-2026-15307 to CVE-2026-87890 to CVE-2026-124827 — demonstrates how a narrow parsing weakness can morph into full remote code execution when combined with defaults and writable working directories.
Source: The Hacker News — New Django4Shell Vulnerability Enables Django RCE via GeoDjango Form Validation




