// 1 ZERO-DAY · 2 CVE · 1 EXPLOIT IN THE LAST 24H→
Django patched CVE-2026-124827, an authenticated RCE exploiting RasterField to write arbitrary files during form validation, requiring three patches over four months to fully resolve.

Django released versions 6.1.4, 6.0.11, and 5.2.20 on December 2, 2026 to fix CVE-2026-124827, a remote code execution vulnerability affecting applications using GeoDjango and RasterField. The bug allows authenticated users with staff privileges to write arbitrary files during simple form validation, without any database interaction. The severity lies in the incomplete patch chain: August, October, and December 2026 saw three attempts to fix the same component, each leaving a different gap open.

Key Takeaways
  • CVE-2026-124827 has CVSS 8.8 (v3.1) and 8.7 (v4.0) per the official Django Software Foundation record; classified as CWE-73
  • The attack vector exploits RasterField which, exposed via ModelForm or admin by default, converts JSON input into GDALRaster objects writing files during pre-save validation
  • Three of four technical preconditions are satisfied by default in standard GeoDjango deployments, per the discovering researcher
  • The fix changes RasterField default behavior, setting editable=False and requiring explicit developer action to retain previous functionality

The Mechanism: Validation as Write Point

The vulnerability core resides in a flow Django executes automatically and most developers consider safe: form validation before save. RasterField, django.contrib.gis field for geographic raster data, does not override formfield() and falls back to Field's generic implementation, which returns forms.CharField: a simple text field in the admin interface.

When a staff user enters a JSON payload in the form, the call chain triggers in Model.full_clean(), which invokes clean_fields() and then getattr() on the field attribute. This touches SpatialProxy.__get__, which constructs GDALRaster passing the dictionary extracted from the JSON string. In GDALRaster.__init__'s dict branch, the code sets self._write = 1 and calls capi.create_ds with force_bytes(ds_input.get('name', '')), creating a file at the attacker-controlled path.

With drivers like EHdr, compiled in standard GDAL builds, band data writes directly to the filesystem. The operation occurs entirely during form validation, before any model.save() or database access. This architectural detail is crucial: traditional access controls, designed to filter persistence operations, do not intervene.

The Three-Patch Chain: August, October, December

The history of this vulnerability is a chronicle of partial defensive patches. CVE-2026-15307, fixed in August 2026, restricted a lookup path. CVE-2026-87890, in October, blocked a byte-based bypass. CVE-2026-124827, in December, closes the remaining gap in dict assignment. Each fix guarded a single entry point assuming others were already protected.

The operational consequences are concrete: organizations that applied the August or October patches without updating to December remain exposed despite having invested security resources. Researcher Mohamed K. Fathy, head of cybersecurity at Robusta Technology Group, documented post-exploitation techniques including dropping sitecustomize.py into the worker's working directory — automatically imported at Python interpreter startup — or .pth files in site-packages for persistent execution with web server user privileges.

"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"
— Django maintainers, advisory of December 2, 2026

Who Is Actually at Risk

The vulnerable population is not the entire Django ecosystem. Per The CyberSec Guru analysis, this is a "serious flaw with a narrow reachable population, not a fire drill for every Django deployment." Actually exposed platforms combine four elements: django.contrib.gis installation, RasterField presence in the model, exposure via ModelForm or default admin, and authentication with staff privileges.

Typically involved sectors are government platforms, mapping systems, GIS applications, agricultural and environmental monitoring environments. Three of four technical preconditions — ModelForm/admin exposure, EHdr driver in GDAL, writable path on sys.path — are satisfied almost universally in standard installations, per Fathy. The only significant variable is staff authentication, which reduces attack surface but does not eliminate it in environments with broad internal users.

What to Do Now

  • Update immediately to Django 6.1.4, 6.0.11, or 5.2.20; patches prior to August and October are insufficient
  • Verify RasterField presence in models and assess whether the field is actually needed with editable=True, given the fix now sets editable=False by default
  • Restart application server workers (runserver, gunicorn, cron) after updating to eliminate any compromised sitecustomize.py or .pth files in memory
  • Check Django admin access logs for POST requests on models with RasterField by staff users in the weeks before December 2, 2026

The Price of Backward Compatibility

The December fix introduces a behavior break: RasterField becomes non-editable by default. Developers needing previous functionality must now explicitly set editable=True and manually handle input security. This architectural choice, while necessary, shifts part of the security burden from framework to application.

No infrastructure overlaps linking CVE-2026-124827 activity to known campaigns have emerged at present. No in-the-wild exploitation was confirmed by December 2-3, 2026, though a third-party repository with Docker environment appeared hours after disclosure per dev.to, without primary sources verifying its effectiveness. Unsupported Django series — 5.1.x, 5.0.x, and 4.2.x — were not assessed by the vendor and may be equally affected.

Why the Patch Chain Fails

The Django4Shell case illustrates a recurring pattern in mature framework security: layered defense applied without a holistic view of data flow produces correlated holes. Each patch guarded the immediate symptom — a specific entry point — without redesigning the trust boundary between RasterField and GDAL. The result: attackers with systemic understanding of the flow could move laterally between vectors while defenders chased.

For organizations, the lesson is in patching governance: applying a security update is not neutral if the patch is partial. Correlated issue traceability over time and explicit "incomplete fix" evaluation in changelogs are needed — Django documented these but many teams' automated processes do not capture them.

FAQ

My Django application uses GeometryField but not RasterField: is it at risk?
No. The vulnerability is specific to RasterField in django.contrib.gis. GeometryField is not involved and does not present the CharField fallback mechanism that triggers the chain.
I updated to Django 5.2.19 in October: am I protected?
No. The October patch fixed CVE-2026-87890, but CVE-2026-124827 explicitly requires version 5.2.20 or later released December 2, 2026.
Why is the official CVSS 8.8 and not 9.0 as initially reported?
The 9.0 score appearing in early hours on The Hacker News was an early coverage error. The official Django Software Foundation CVE record assigns CVSS 3.1 8.8 and CVSS 4.0 8.7, corrected by Snyk and The CyberSec Guru.

Sources


Sources and references
  1. thehackernews.com
  2. thecybersecguru.com
  3. dev.to
  4. intel.threadlinqs.com
  5. blog.ostorlab.co
  6. snyk.io
  7. cve.org
  8. security.snyk.io