Django4Shell CVE-2026-124827: Third GDAL Fix in 4 Months

By 12 min read
Django4Shell CVE-2026-124827, a GeoDjango RasterField file-write flaw fixed in Django 6.1.4

A Django admin form with one geographic field could let a staff account write a file anywhere the web server can reach, including a web shell. That is Django4Shell, CVE-2026-124827, which the Django project fixed on 2 December 2026 in Django 6.1.4, 6.0.11 and 5.2.20, and it is the third time since August that untrusted raster data reaching GDAL has needed a patch.

In short: Django4Shell is a high-severity server-side file-write flaw in GeoDjango’s RasterField, found and named by Mohamed K. Fathy, head of cybersecurity at Robusta Technology Group. It only matters for projects that use django.contrib.gis with a raster model, but where it applies it can end in remote code execution. No exploitation had been reported as of 2 December.

What is Django4Shell (CVE-2026-124827)?

Django4Shell is the nickname for CVE-2026-124827, which the Django advisory titles “server-side file-write via RasterField assignment”. Django is the Python web framework behind a large share of Python web applications; its GitHub repository django/django had 91,898 stars and 35,015 forks on 2 December 2026, under the BSD-3-Clause licence.

GeoDjango is Django’s built-in geographic module, shipped as django.contrib.gis. It stores maps, shapes and coordinates in a spatial database. A RasterField is a GeoDjango model field that stores raster data, which is gridded image-like data such as elevation maps or satellite tiles. Django only implements RasterField on PostGIS, the spatial extension for PostgreSQL.

GDAL (the Geospatial Data Abstraction Library) is the open-source library GeoDjango uses to read and write raster files. GDAL supports many file formats through components it calls drivers. The bug lives where Django hands user input to GDAL.

The Django advisory credits the report to “Mohammed Fathy”; The Hacker News spells the name “Mohamed K. Fathy”. Both refer to the same researcher, who coined the Django4Shell name.

Four headline figures for the Django 2 December release: 7 flaws, 2 high, 3 GDAL fixes, 0 attacks
One release, seven fixes, and the third GDAL-related GeoDjango patch since August. Data: Django Software Foundation, The Hacker News.

When was Django4Shell disclosed?

Django4Shell first became public on 2 December 2026, in the Django security release post posted by Jacob Walls. The same day, The Hacker News (Ravie Lakshmanan), SecurityOnline and Cyber Security News reported on it, and the researcher’s Django4Shell site went live. The searches for this article found no earlier coverage of the name or the CVE.

The Django post fixes seven issues and urges all users to upgrade as soon as possible. Two are rated high by the Django team, one moderate and four low.

How does the Django RasterField vulnerability work?

According to the Django advisory, assigning a raster data definition to a RasterField could make GDAL write a file to an attacker-chosen location when two things are user-controlled: the name of the raster and a non-default driver. Depending on the driver, Django says, the result could be remote code execution.

A raster data definition is a description of a raster passed as a Python dictionary or a JSON string. It includes fields such as size, bands and, crucially, a name and a driver. For an in-memory raster the name does not matter. For a raster backed by a file-writing driver, the name becomes a file path.

Why a normal admin form reaches it

The key detail is how forms handle the field. Per the advisory, RasterField falls back to Django’s plain text form field (CharField). That made the flaw reachable by default on any model with a RasterField that is registered in the Django admin, used in a ModelForm, or exposed through a writable serializer.

In other words, a developer did not have to write unusual code. Registering a raster model in the admin was enough to expose a text box that accepted a full raster definition.

What the researcher says an attacker controls

Fathy, quoted by The Hacker News, says an attacker controls the target path, the file content and the file name through a crafted JSON raster body. SecurityOnline adds that the file write happens during form validation, before any database row is saved, and names GDAL’s standard EHdr driver as the one involved. EHdr is a simple GDAL format that writes a raw data file plus a small header file.

Fathy lists the possible outcomes as overwriting application source, dropping web shells into static directories and corrupting configuration files. A web shell is a script placed on a web server that runs commands on request.

Five-stage flow from a staff login through a raster form to a GDAL file write and code execution
The path from an admin text box to a file on disk is short once a raster model is registered. Data: Django advisory, Mohamed K. Fathy via The Hacker News.

Who is affected by Django4Shell?

You are exposed to Django4Shell only if all of these apply, according to the advisory and the researcher:

  1. The project uses django.contrib.gis with at least one RasterField model on PostGIS.
  2. That field is writable through the admin, a ModelForm or a writable serializer.
  3. GDAL on the server has the needed driver. Fathy calls EHdr availability near-universal.
  4. The web process can write to a useful path. Fathy rates this very high in typical deployments.

Fathy says three of those four conditions are true by default; the first is the one that limits exposure. Geometry fields (points, lines, polygons) are not affected, the advisory says. Plain Django projects without GeoDjango are not exposed to this CVE at all.

Does an attacker need to log in?

In a standard setup, yes. Fathy says the primary requirement is staff-level authentication, and Cyber Security News says an attacker would need a staff account with permission to add or change records, but not a superuser. A public form or API that accepts raster definitions would remove that barrier, so the login requirement depends on your code, not on Django.

Which versions are affected?

The Django security archive lists the 6.1, 6.0 and 5.2 series and the main branch as affected. Fixed releases are Django 6.1.4, 6.0.11 and 5.2.20. Django’s practice is not to evaluate unsupported series, and SecurityOnline notes that 4.2 and earlier are end of life and will not be fixed.

How severe is CVE-2026-124827?

Django rates it high under its own security policy and does not publish CVSS scores. The Hacker News reports a CVSS score of 9.0. SecurityOnline gives 9.0 in its summary and 8.8 in its table for the same CVE. We could not find who assigned either number, so treat the score as unsettled and rely on Django’s rating plus your own exposure.

The staff-account requirement is the main reason this is not an internet-wide emergency. The counter-argument is that staff accounts are common in Django sites, are often shared with editors and contractors, and are a frequent target of credential stuffing.

Is Django4Shell exploited in the wild?

No exploitation had been reported as of 2 December 2026. SecurityOnline says Django confirmed no live attacks and that no public weaponised exploit code was available. Cyber Security News likewise reports no confirmed exploitation and no independent demonstration of an unauthenticated attack.

That is a snapshot on disclosure day. The fix commits are public, and the researcher’s description of the preconditions is detailed, so the gap between patch and working exploit may be short.

Third time: how Django4Shell follows two earlier GDAL fixes

The Hacker News describes CVE-2026-124827 as an incomplete fix for CVE-2026-87890, which was itself an incomplete fix for CVE-2026-15307. Reading the three Django advisories side by side shows the pattern: each patch closed one doorway through which untrusted raster data reached GDAL, and the next report found another.

Timeline of three GeoDjango GDAL security fixes on 4 August, 6 October and 2 December 2026
Each fix closed one entry point for untrusted raster data; Django4Shell is the third in four months. Data: Django security archive.
CVE Date fixed Django rating Entry point Impact named by Django
CVE-2026-15307 4 Aug 2026 High Spatial lookups given str or dict values File write (sometimes RCE) or request forgery
CVE-2026-87890 6 Oct 2026 Moderate Spatial lookups given raw bytes, such as a VRT document Request forgery from the server
CVE-2026-124827 2 Dec 2026 High Values assigned to a RasterField model field File write, possibly RCE

CVE-2026-15307 (August)

Fixed in Django 6.0.8 and 5.2.17, this flaw let spatial lookups pass string and dictionary values to GDAL. Because the admin’s changelist filters allow lookups, staff with only view permission could reach it. Django’s fix stopped spatial lookups accepting dictionaries and strings that are not valid geometry.

CVE-2026-87890 (October)

Fixed in Django 6.1.2, 6.0.9 and 5.2.18, this one used raw bytes instead of strings. GDAL opened the bytes through its in-memory file system, so they could hold a VRT document, an XML format that points GDAL at another raster source, including a remote one. Django’s post says this was overlooked in the August fix. Bytes must now be wrapped in a GDALRaster object.

CVE-2026-124827 (December)

The first two fixes guarded lookups, which are used for filtering. Django4Shell goes through the model field itself, the place data is written. The same idea, untrusted text turned into a GDAL raster, simply arrived through a different door.

This pattern is common. We saw the same shape with the Drupal Fail2Install bug, where the first patch was not enough, and with phpAfterShell, the PHP session flaw an earlier fix missed.

What else did Django fix on 2 December?

Django4Shell gets the headlines, but most Django sites do not use GeoDjango. For them, the more important fix may be CVE-2026-132092.

Bar chart of the seven Django fixes by severity: two high, one moderate, four low
Two of the seven fixes are rated high, and only one of those needs GeoDjango. Data: Django Software Foundation.
CVE Issue Django rating Reporter (per Django)
CVE-2026-124827 File write via RasterField (Django4Shell) High Mohammed Fathy
CVE-2026-132092 SQL injection in range and in lookups High Cristian Panaro
CVE-2026-115868 XSS in truncatechars_html Moderate JoeCyberTech
CVE-2026-125673 Cache poisoning via dot segments in paths Low 4drez
CVE-2026-119642 Admin changelist leak via pk alias Low JoeCyberTech
CVE-2026-127929 Admin changelist leak via reverse relations Low OpenAI
CVE-2026-132809 Heap overflow in OGRGeometry.wkb Low Zhixi ‘Jace’ Sun

The SQL injection: CVE-2026-132092

SQL injection is a flaw where user input changes the meaning of a database query. Per Django, the range and in lookups were open to it in queries that use aliases or key transforms containing percent signs. The range case needed more than two right-hand values; the in case needed a bilateral transform. The fix makes range require exactly two values.

The NVD record cited by Brandefense and ZeroHour lists CVSS 4.0 9.3 for this one. The preconditions are narrow, but they live in ordinary query code, so check it even if you never touch maps.

The cache bug needs a manual step

For CVE-2026-125673, Django warns that upgrading does not invalidate responses already cached. If you use UpdateCacheMiddleware or cache_page(), clear those caches after you upgrade.

How to detect Django4Shell exploitation

The sources publish no indicators of compromise and no ATT&CK mapping. The checks below are our suggestions for defenders, based on how the advisory describes the flaw. In MITRE ATT&CK terms, the likely techniques are Exploit Public-Facing Application (T1190) and Server Software Component: Web Shell (T1505.003).

Find out whether you are exposed

  • Search the code base for RasterField and for django.contrib.gis in INSTALLED_APPS.
  • For each raster model, list where it is writable: admin registrations, ModelForms, and serializers in Django REST Framework or similar.
  • List who holds add or change permission on those models.

Look for signs of abuse

  • Web and application logs: POST requests to admin add or change pages for raster models, especially from unusual accounts or IP addresses, and requests whose body contains a driver key.
  • File integrity: new or changed files in static, media, template and source directories owned by the web server user. Pay attention to files with header-style extensions next to unexpected data files, since EHdr writes in pairs.
  • Process activity: shells or interpreters started by the web worker process, and outbound connections from it that do not match normal traffic.
  • Accounts: new staff accounts, password resets and permission changes in the weeks before the patch.

How to fix Django4Shell: prioritised steps

  1. Upgrade. Move to Django 6.1.4, 6.0.11 or 5.2.20 and redeploy. Rebuild container images, since a pinned old version in a base image is a common miss.
  2. If you are on 5.1, 5.0 or 4.2, plan a migration. These series get no fix. Until then, remove raster models from the admin and from any writable form or serializer.
  3. Review who can edit raster models. Remove staff permissions that are not needed and enforce multi-factor authentication for the admin.
  4. Validate raster input. After the fix, RasterField defaults to editable=False and rejects dictionaries or JSON naming a non-default driver unless wrapped in GDALRaster. Django notes that request forgery is still possible if untrusted input is assigned, so validate before wrapping.
  5. Limit what the web process can write. Keep application code and templates read-only to the web worker, as SecurityOnline also recommends.
  6. Clear caches and check for abuse. Clear caches for CVE-2026-125673, then run the detection checks above for the period before the patch.

What the sources do not say

  • CVSS: Django gives no score, and the 9.0 and 8.8 figures in news coverage come with no named assigner.
  • Older versions: the researcher’s site title mentions Django 6.1.2, but no source lists the earliest affected release of each series.
  • Exposure numbers: nobody has estimated how many internet-facing Django sites use RasterField. GeoDjango is common in mapping and government work, but raster fields are rarer than geometry fields.
  • Disclosure timeline: none of the sources give the date Fathy reported the issue to Django.

How does it compare to other recent framework bugs?

Django4Shell needs a logged-in staff user and a specific feature, which puts it in a different class from bugs like the Vite CVE-2026-140097 dev server RCE, which needed no login on an exposed server. It is closer to Composer2Shell, where an everyday developer command ran attacker code: a trusted feature quietly passing untrusted input to a powerful backend.

The “4Shell” name invites comparisons with Log4Shell, but the sources make none, and the reach is far smaller. Log4Shell hit almost anything that logged a string. Django4Shell hits only GeoDjango raster models that staff can edit.

The bottom line

Django4Shell is serious for the minority of Django projects that store rasters, and harmless for everyone else. The release it shipped in is not: every Django site should take 6.1.4, 6.0.11 or 5.2.20 for the SQL injection fix alone. Three GDAL fixes in four months also suggest the safest assumption is that untrusted raster data should never reach GDAL at all.

Sources

This article is written for defenders and authorised security testers. Only test systems you own or have written permission to assess.

Frequently asked questions

What is Django4Shell?

Django4Shell is the nickname for CVE-2026-124827, a vulnerability in Django's GeoDjango RasterField. Assigning a raster definition with a user-controlled name and a non-default GDAL driver could make GDAL write a file to a location the attacker chose, which can lead to remote code execution.

Which Django versions fix Django4Shell?

Django 6.1.4, 6.0.11 and 5.2.20, all released on 2 December 2026. The Django project lists the 6.1, 6.0 and 5.2 series and the main branch as affected. Unsupported series such as 5.1 and 4.2 were not evaluated and get no fix.

Is Django4Shell exploitable without logging in?

In a default setup the researcher says staff-level authentication is the main requirement, because the field is usually reached through the Django admin. A public form or API that accepts raster definitions from anonymous users would remove that barrier, so check every place a RasterField is writable.

Am I affected if I do not use GeoDjango?

Not by Django4Shell. The flaw needs django.contrib.gis and a model with a RasterField, which is only implemented on PostGIS. You should still upgrade, because the same release fixes a high-severity SQL injection and other bugs that affect ordinary Django projects.

What is the CVSS score of CVE-2026-124827?

The Django project does not publish CVSS scores; it rates the issue high under its own policy. The Hacker News reports a CVSS score of 9.0, while SecurityOnline shows both 9.0 and 8.8 on the same page, so treat the exact number as unsettled.

Is Django4Shell being exploited in the wild?

As of 2 December 2026, Django's advisory does not mention exploitation, and SecurityOnline reports no confirmed attacks and no public weaponised exploit. The flaw was disclosed the same day the patch shipped, so that can change quickly.

What is CVE-2026-132092 in Django?

CVE-2026-132092 is a high-severity SQL injection in Django's range and in lookups, fixed in the same 2 December release. It needs aliases or key transforms that contain percent signs, plus either more than two values for range or a bilateral transform for in.

How is Django4Shell related to CVE-2026-15307 and CVE-2026-87890?

All three involve GeoDjango passing untrusted raster data to GDAL. CVE-2026-15307 (August) covered spatial lookups, CVE-2026-87890 (October) covered raw bytes in those lookups, and CVE-2026-124827 (December) covers values assigned to a RasterField model field.

Keep reading

DjangoDjango4ShellCVE-2026-124827GeoDjangoGDALPython securityvulnerability management