The Django project has patched a flaw in its GeoDjango mapping module that can let a logged-in staff user write files to a web server and, depending on the setup, run code on it. Researchers are calling it Django4Shell. The bug is tracked as CVE-2026-124827, and the fix shipped on December 2, 2026 in Django 6.1.4, 6.0.11 and 5.2.20. Django rates the issue “high” under its own severity policy. The researcher who reported it rates it critical.
The release fixes seven security issues in total, and Django urges all users to upgrade as soon as possible. The Django advisory does not mention any exploitation in the wild, and BreachNews has not seen reports of attacks at time of publication.
What the Django advisory says about CVE-2026-124827
According to the Django security release announcement, 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, the open source geospatial library GeoDjango uses, to write a file to an attacker-controlled location. Depending on the raster driver, that could enable remote code execution.
The reachable surface is what makes it serious. Because RasterField falls back to a plain CharField form field, the flaw was reachable by default on models with RasterField registered in the Django admin, used in ModelForm classes, or exposed through writable model serializers. Geometry fields were not affected, and RasterField is only implemented on PostGIS.
The National Vulnerability Database entry, which mirrors the record published by the Django Software Foundation, lists a CVSS 3.1 score of 8.8 (High) with the vector AV:N/AC:L/PR:L/UI:N, and a CVSS 4.0 score of 8.7. The weakness is classed as CWE-73, external control of a file name or path. The low privileges required reflect that an attacker needs an account that can reach the affected form.
Affected and fixed versions
- Django
6.1before6.1.4: fixed in6.1.4 - Django
6.0before6.0.11: fixed in6.0.11 - Django
5.2before5.2.20: fixed in5.2.20
The main development branch was also patched. Django says earlier, unsupported series such as 5.1.x, 5.0.x and 4.2.x were not evaluated and may also be affected, and they no longer receive security fixes. Patches for each branch are linked from the advisory, including commits for 6.1, 6.0 and 5.2. We did not find a separate GitHub security advisory for this CVE at time of publication.
A third try at the same GeoDjango problem
Django4Shell is the latest in a chain of GeoDjango fixes. In August 2026, CVE-2026-15307 covered spatial lookups that passed str and dict values into GDALRaster, which could write files or make network requests. Django’s note at the time said assignments to model fields were unaffected and still accepted those input types. In October, CVE-2026-87890 closed a related request forgery route through raw bytes in spatial lookups, and the project said it had been overlooked in the first fix. Both fixes guarded the query path. The December flaw sits on the assignment path that was left open.
The researcher behind the discovery, Mohammed Fathy of Robusta Technology Group, describes the new bug as a bypass of the October hardening. The write-up on django4shell.com says it was tested against Django 6.1.2. Django’s CVE record credits Fathy as the reporter and gives this timeline:
- Oct 22, 2026: initial report received
- Nov 9, 2026: vulnerability confirmed
- Dec 2, 2026: security release issued
How the attack works, in outline
BreachNews is not publishing exploit details. Based on the researcher’s description, the chain has four steps:
- An attacker with staff-level access submits a specially crafted raster definition, formatted as JSON, in a text field that belongs to a
RasterFieldin the admin or in any form built on the model. - Django accepts the value as plain text, so the usual spatial validation never runs.
- When the form is validated, Django loads the value into
GDALRaster. The researcher says this happens duringform.is_valid(), before anything is saved and without any database interaction. GDAL then creates a file at the path the attacker chose, with attacker-chosen contents. - If that file is something Python loads on its own, such as a startup customization file or a
.pthpath file, the attacker’s code runs with the privileges of the web server user the next time a worker restarts, reloads or forks.
The researcher lists four conditions for full exploitation: a model using RasterField, that field exposed through a form or the default admin, a GDAL build that includes the EHdr driver, and a writable target directory. The researcher says EHdr ships in standard GDAL builds and that an application’s working directory is writable by default, so in practice the form exposure is the main gate. The remaining requirement is a staff account, which could come from a compromised or malicious insider, or from stolen admin credentials. The researcher says organizations running GeoDjango raster data with the standard admin and a default GDAL build should consider themselves exposed until patched. Rasters are common in mapping, government, agriculture and environmental platforms.
What the fix changes
Django changed RasterField to default to editable=False, which keeps it out of a ModelForm unless a developer explicitly includes it. It also now raises GDALException when a dictionary or JSON string specifies a non-default driver. Code that needs another driver must wrap the definition in GDALRaster to mark it as trusted.
That is a backward incompatible change, so some GeoDjango projects may see new errors after upgrading. Django also warns that the fix only limits file writes. Server-side request forgery is still possible if untrusted input is assigned to RasterField, so the documentation on raster security considerations says to validate input before accepting it.
Six other fixes in the same release
The release also addresses six other issues:
CVE-2026-132092(high): potential SQL injection in therangeandinlookups, in queries involving aliases or key transforms that contain percent signs. Therangelookup now requires exactly two right-hand side values.CVE-2026-115868(moderate): potential cross-site scripting in thetruncatechars_htmltemplate filter andTruncator.chars()withhtml=TrueCVE-2026-125673(low): potential cache poisoning through dot segments in request paths. Django says existing cached responses are not invalidated, so teams should clear potentially affected caches after upgrading.CVE-2026-119642andCVE-2026-127929(both low): information leakage in the admin changelist for staff users with view permissionsCVE-2026-132809(low): heap buffer overflow inOGRGeometry.wkbfor geometries larger than 4GB
What to do now
Upgrade to 6.1.4, 6.0.11 or 5.2.20, or later. Teams on unsupported series should move to a supported one rather than wait for a backport. Because the issue affects the admin and form layer, even sites that do not think of themselves as GIS applications should check whether django.contrib.gis is in INSTALLED_APPS and whether any model defines a RasterField.
If you cannot upgrade right away:
- Remove
RasterFieldfrom admin classes,ModelFormclasses and writable serializers, usingexcludeoreditable=False - Limit staff access, enforce multi-factor authentication on admin accounts and restrict the admin URL to trusted networks
- Run the application as a low-privilege user and make the project directory and
site-packagesread-only to the web process where you can - Disable GDAL raster drivers you do not need, for example with GDAL’s
GDAL_SKIPconfiguration option. Django’s documentation points to GDAL’s own guidance on limiting drivers
Patching does not remove anything an attacker has already planted. Check project directories and site-packages for unexpected .py or .pth files, especially recently created ones, and review admin logs for staff edits to models that contain raster fields. If you find a stray file, treat the host as compromised, rotate secrets and environment variables the application could read, and restart workers only after cleaning up.
Django4Shell joins a run of named bugs in widely deployed developer tooling that we have covered, including Upload2Shell in Ghostscript and Java4Shell in OpenJDK. BreachNews will update this story if exploitation is reported or new details emerge.












