Django4Shell RCE Flaw Hits Every Supported Branch

On December 2, 2026, the Django project shipped emergency security releases to patch a critical remote code execution vulnerability in GeoDjango, its widely used geospatial toolkit. Tracked as CVE-2026-124827 and quickly dubbed Django4Shell by the security community, the flaw carries a CVSS score of 9.0 and affects every supported branch of the framework. With Django underpinning hundreds of thousands of Python-powered web applications worldwide, the patch demands immediate attention.

What Happened

The Django team released versions 6.1.4, 6.0.11, and 5.2.20 LTS on December 2 to address seven security issues. The headline fix targets CVE-2026-124827, a file-write-to-RCE vulnerability in GeoDjango’s RasterField handling. Security researcher Mohammed Fathy is credited with the discovery. No confirmed exploitation has been reported so far, but the severity of the flaw and the size of Django’s install base have prompted urgent advisories from multiple security organizations.

What makes this disclosure especially notable is that Django4Shell is classified as an incomplete fix of two earlier CVEs that addressed the same underlying vulnerability class. The Django maintainers first patched a related flaw in GeoDjango spatial lookups back in August 2026 (CVE-2026-15307), but the December release reveals that the original mitigation did not fully close the attack surface. A second bypass was found, forcing a third round of patches — an unusually persistent vulnerability that echoes the multi-round patching saga seen with Log4Shell in late 2021.

How the Attack Works

The vulnerability resides in how GeoDjango processes raster data inputs. When a Django application uses a RasterField — common in mapping, GIS, and location-based services — the framework passes user-supplied values to the GDAL library’s raster constructor for spatial lookups.

An attacker can craft a malicious raster definition that abuses GDAL’s file-backed drivers. On systems running PostGIS, this crafted input can instruct GDAL to write a file with attacker-controlled contents to an arbitrary path on the server. If that file lands in a location the Python application later imports or executes — such as a directory on the Python path — the result is full remote code execution running as the web server’s user account.

The attack vector is not limited to file writes. The same input path can also be abused for server-side request forgery (SSRF) through GDAL’s virtual filesystem handlers, which allow outbound network requests to attacker-controlled destinations.

The primary attack scenario requires a staff-level user with view permissions who can submit a crafted spatial-field filter through the Django admin interface or a ModelForm. However, researchers at Cyber Security News have noted that applications exposing public-facing forms or APIs that accept unvalidated raster definitions could be vulnerable without any authentication at all — significantly broadening the potential impact.

Who Is Affected

Any Django application using GeoDjango with RasterField is potentially exposed. This includes a wide range of services: mapping platforms, real estate applications, logistics and delivery tools, environmental monitoring dashboards, and any web service that processes geographic or spatial data.

The affected versions span Django’s three supported release branches:

  • Django 6.1 before 6.1.4
  • Django 6.0 before 6.0.11
  • Django 5.2 LTS before 5.2.20

Older, unsupported Django series were not evaluated by the maintainers and may also be affected. Organizations still running legacy Django installations should treat this as a strong incentive to upgrade.

Django is one of the most popular web frameworks in the Python ecosystem, powering everything from small startups to large enterprise applications. While not every Django project uses GeoDjango, the subset that does tends to handle sensitive location and infrastructure data, making a compromise particularly damaging.

The Broader Security Release

CVE-2026-124827 is the most critical of seven vulnerabilities patched in the December 2 release, but administrators should not overlook the remaining fixes:

  • SQL injection in range and “in” lookups — another high-severity issue that could allow database manipulation through specially crafted query parameters
  • Cross-site scripting (XSS) in truncatechars_html — a template filter bypass that could enable injection of malicious scripts
  • Cache poisoning via dot segments — a path traversal technique that could poison cached responses

The combination of these vulnerabilities makes the December release a critical update that addresses multiple attack vectors simultaneously.

Why the Name Matters

The “4Shell” naming convention has become a signal in the security community. It references Log4Shell (CVE-2021-44228), the devastating Apache Log4j vulnerability that rocked the software industry in December 2021. When researchers name a vulnerability using this pattern — Java4Shell, Ruby2Shell, and now Django4Shell — they are signaling that the flaw enables code execution through a commonly trusted component in a way that is both severe and broadly applicable.

The name also highlights a troubling pattern: core framework components that handle data parsing and serialization continue to be a rich source of critical vulnerabilities. GDAL, the geospatial data library at the heart of this flaw, is powerful precisely because it can read and write many file formats — but that flexibility becomes dangerous when exposed to untrusted input without strict validation.

What to Do Now

Upgrade immediately. The fixed versions are Django 6.1.4, 6.0.11, and 5.2.20 LTS. The Django team has also patched the main development branch. Standard package managers (pip) will pull the latest versions.

Audit your applications. If you run GeoDjango with RasterField, check whether any spatial fields are exposed through the admin interface, public forms, or API endpoints. Applications that accept spatial data from unauthenticated users are at highest risk.

Monitor for indicators of compromise. Security teams should watch for unexpected files written to directories writable by the Django process — particularly MEDIA_ROOT, STATIC_ROOT, and locations on the Python path. Unusual outbound network connections from Python worker processes may indicate SSRF exploitation through GDAL’s virtual filesystem handlers.

Review the full advisory. With seven vulnerabilities patched, the SQL injection and XSS fixes also warrant attention. Treat this as a comprehensive security update, not just a single-bug patch.

What to Watch Next

The fact that this is the third attempt to fully patch this vulnerability class raises questions about whether the current fix is complete. The underlying issue — GDAL’s broad file-handling capabilities being reachable through user-controlled input — is architecturally challenging to constrain without breaking legitimate use cases. Security researchers will likely scrutinize the new patch closely.

Meanwhile, the Django4Shell disclosure joins a week of significant web framework vulnerabilities, including active exploitation of a critical WP Rocket flaw (CVE-2026-125812) affecting over 5.5 million WordPress sites and CISA adding exploited Rejetto HFS and TYPO3 flaws to its Known Exploited Vulnerabilities catalog. Organizations managing web infrastructure should be in heightened patch-management mode heading into December.

Sources: The Hacker News, ZeroHour Daily Brief, Cyber Security News, Django Security Advisory, NVD

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.