Django4Shell Vulnerability Allows RCE via GeoDjango Form Validation
A critical Django4Shell vulnerability (CVE-2026-124827) with a CVSS score of 9.0 allows remote code execution through GeoDjango form validation, stemming from an incomplete prior fix.

The Django project has released critical security updates, including versions 6.1.4, 6.0.11, and 5.2.20, to address a total of seven security vulnerabilities. Among these is a severe flaw, codenamed Django4shell and tracked as CVE-2026-124827, which carries a CVSS score of 9.0 and poses a significant risk of remote code execution (RCE) within applications utilizing GeoDjango's form validation capabilities.
This newly disclosed vulnerability is an incomplete patch for a previously identified issue, CVE-2026-87890. That vulnerability, in turn, was an incomplete fix for an earlier flaw, CVE-2026-15307, which was addressed in August 2026. The persistent nature of these vulnerabilities highlights a recurring challenge in securing complex software components.
The root cause of CVE-2026-124827 lies within GeoDjango's spatial lookup raster parsing mechanism. While previous fixes aimed to prevent server-side file writes and SSRF attacks, the latest vulnerability exploits an oversight in the RasterField assignment path. This allows an attacker to gain arbitrary file write primitives, ultimately leading to RCE.
Attackers can exploit this flaw by crafting a malicious JSON raster body. This crafted input allows them to control the target path, file content, and filename, enabling them to overwrite application source code, deploy web shells in static directories, or corrupt critical configuration files. A particularly dangerous aspect is the ability to plant a sitecustomize.py file into the worker's current working directory, which Python automatically imports at interpreter startup, executing the payload before any application code runs.
The exploitation vector is further amplified by how RasterField handles assignments. When a raster data definition is assigned to django.contrib.gis.db.models.RasterField with a user-controlled name parameter and a non-default driver, it can trigger GDAL to write a file to an attacker-controlled location. Depending on the raster driver used, this can lead to RCE. The vulnerability is accessible by default on models with RasterField when exposed via ModelForms or the default admin interface.
Successful exploitation of CVE-2026-124827 hinges on several pre-conditions, though many are met by default in standard Django/GeoDjango deployments. These include the presence of django.contrib.gis with a RasterField model (common in GIS-focused applications), the RasterField being exposed via ModelForm or the admin (highly prevalent), GDAL with the EHdr driver (ubiquitous), and a writable target path (typically the project root). The primary requirement for exploitation is staff-level authentication.
Beyond the critical Django4shell vulnerability, the latest Django releases also patch other significant flaws. These include an SQL injection vulnerability in range and lookups (CVE-2026-132092), a potential cross-site scripting (XSS) vulnerability in the truncatechars_html template filter (CVE-2026-115868), and a cache poisoning flaw exploitable via dot segments in request paths (CVE-2026-125673).
Organizations utilizing GeoDjango, especially those with raster data processing and administrative access, are strongly advised to update their Django installations to the patched versions immediately. The ease of exploitation, combined with the potential for widespread impact, makes this a high-priority security update.
The latest advisory from Cyber Security News provides further details on the Django4Shell vulnerability (CVE-2026-124827), specifically highlighting its impact on GeoDjango's RasterField and its dependency on the GDAL library. It clarifies that exploitation may require specific conditions and permissions, and while no in-the-wild exploitation has been confirmed, the vulnerability could be exposed through public forms or APIs that accept unvalidated raster definitions without requiring administrative privileges.