A critical vulnerability (CVE-2026-124827, CVSS 9.0) was disclosed affecting Django’s GeoDjango module, allowing attackers to write arbitrary files to the server and potentially achieve remote code execution via crafted raster data assigned to RasterField. Due to the potential for full server compromise, immediate patching is strongly recommended.

Django4Shell at a glance

  • CVE: CVE-2026-124827 (“Django4Shell”)
  • Severity: Critical, CVSS 9.0
  • Affected component: GeoDjango contrib module, RasterField (PostGIS backend)
  • Vulnerable versions: Django main, 6.1.x before 6.1.4, 6.0.x before 6.0.11, 5.2.x before 5.2.20
  • Fixed versions: Django 6.1.4, 6.0.11, 5.2.20
  • Impact: Arbitrary file write, potential remote code execution
  • Authentication required: Staff-level
  • Proof of concept: Publicly available through the researcher’s disclosure
  • Released: December 2, 2026 Django security release

What is the Django4Shell vulnerability?

The issue originates from Django’s GeoDjango RasterField component, where insufficient validation of user-controlled raster data leads to arbitrary file writes on the server. By assigning crafted JSON raster input with a user-controlled “name” parameter and a non-default GDAL driver, attackers can write files to any writable path on the system, potentially achieving remote code execution through multiple vectors. Staff-level authentication is required to exploit this issue.

At the time of writing, proof-of-concept details are publicly available through the researcher’s disclosure, and the vulnerability has been dubbed “Django4Shell” due to its severity and similarity to past shell-class vulnerabilities.

Why this is the third fix for the same attack surface

Notably, CVE-2026-124827 is an incomplete fix for CVE-2026-87890 (patched October 2026), which was itself an incomplete fix for CVE-2026-15307 (patched August 2026). The protections from earlier patches do not extend to the RasterField assignment path, making this a persistent and recurring attack surface that the Django team has now addressed more thoroughly.

Which Django versions are affected?

The following components are affected: Django’s GeoDjango contrib module with RasterField (PostGIS backend), across:

  • Django main
  • Django 6.1.x before 6.1.4
  • Django 6.0.x before 6.0.11
  • Django 5.2.x before 5.2.20

These components are used by any Django application that leverages geographic data capabilities, particularly when RasterField is exposed via the Django admin, ModelForms, or writable model serializers. The flaw is reachable in common configurations because RasterField falls back to the CharField form field, and GDAL with the EHdr driver is near-universal in GeoDjango deployments.

How can attackers exploit CVE-2026-124827?

Exploitation scenarios are severe and varied. The attacker controls the target path, file content, and filename through the crafted JSON raster body, and exploitation does not require database interaction or a call to model.save(). Attackers can:

  • Drop a sitecustomize.py file into the working directory, which executes at interpreter startup on the next reload or fork
  • Write .pth files into site-packages
  • Overwrite application source code
  • Deploy web shells to static directories
  • Corrupt configuration files

What is the impact of a successful Django4Shell attack?

Successful exploitation could allow attackers to execute arbitrary code on the server, overwrite critical application files, and potentially pivot to deeper infrastructure compromise, leading to service disruption or data exposure.

The severity and ease of exploitation makes this vulnerability high risk, especially in internet-facing Django deployments.

How to patch and mitigate CVE-2026-124827

Users should upgrade immediately to Django 6.1.4, 6.0.11, or 5.2.20 depending on their release branch. The fix changes RasterField behavior in two ways:

  • RasterField now defaults editable to False, excluding it from ModelForms unless explicitly included.
  • Assigning a dict or JSON string with a non-default GDAL driver now raises a GDALException.

Beyond upgrading, organizations should:

  • Restrict admin access.
  • Validate all raster input.
  • Clear caches after upgrading (for the cache poisoning fix).
  • Monitor for anomalous file writes, web shells, or unexpected .pth or sitecustomize.py files.

Other vulnerabilities fixed in the December 2, 2026 Django security release

The same December 2, 2026 security release also addressed six additional vulnerabilities:

  • CVE-2026-132092: SQL injection in range/in lookups (High)
  • CVE-2026-115868: XSS in truncatechars_html (Moderate)
  • CVE-2026-125673: Cache poisoning via dot segments (Low)
  • CVE-2026-119642 and CVE-2026-127929: Admin information leaks (Low)
  • CVE-2026-132809: Heap buffer overflow in OGRGeometry.wkb (Low)

How can Orca help?

Orca enables customers to quickly identify assets running vulnerable Django versions, understand their exposure in context, including internet accessibility, runtime reachability, and asset criticality, and prioritize the vulnerabilities that pose real risk rather than relying on CVSS alone. Orca’s platform highlights affected assets directly in the vulnerability view, helping security teams focus on the few risks that actually matter and work the most critical remediation paths first.

Because Orca can scan cloud workloads without installing agents, teams can find every GeoDjango deployment, including ones they didn’t know about, and use Orca to detect threats in real time, such as unexpected file writes on affected hosts.