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)?
- When was Django4Shell disclosed?
- How does the Django RasterField vulnerability work?
- Who is affected by Django4Shell?
- How severe is CVE-2026-124827?
- Is Django4Shell exploited in the wild?
- Third time: how Django4Shell follows two earlier GDAL fixes
- What else did Django fix on 2 December?
- How to detect Django4Shell exploitation
- How to fix Django4Shell: prioritised steps
- What the sources do not say
- How does it compare to other recent framework bugs?
- The bottom line
- Sources
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.
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.
Who is affected by Django4Shell?
You are exposed to Django4Shell only if all of these apply, according to the advisory and the researcher:
- The project uses
django.contrib.giswith at least one RasterField model on PostGIS. - That field is writable through the admin, a ModelForm or a writable serializer.
- GDAL on the server has the needed driver. Fathy calls EHdr availability near-universal.
- 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.
| 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.
| 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
RasterFieldand fordjango.contrib.gisinINSTALLED_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
driverkey. - 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
- 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.
- 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.
- Review who can edit raster models. Remove staff permissions that are not needed and enforce multi-factor authentication for the admin.
- Validate raster input. After the fix, RasterField defaults to
editable=Falseand rejects dictionaries or JSON naming a non-default driver unless wrapped inGDALRaster. Django notes that request forgery is still possible if untrusted input is assigned, so validate before wrapping. - Limit what the web process can write. Keep application code and templates read-only to the web worker, as SecurityOnline also recommends.
- 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
- Django security releases issued: 6.1.4, 6.0.11, and 5.2.20 (Django, 2 December 2026)
- Django security releases issued: 6.1.2, 6.0.9, and 5.2.18 (Django, 6 October 2026)
- Django security releases issued: 6.0.8 and 5.2.17 (Django, 4 August 2026)
- Django security issues archive
- New Django4Shell Vulnerability Enables Django RCE via GeoDjango Form Validation (The Hacker News)
- Django4Shell (CVE-2026-124827): Django RCE Explained (SecurityOnline)
- Django4Shell high-severity flaw (Cyber Security News, via Cryptika)
- CVE-2026-132092 (Brandefense)
- CVE-2026-132092 (ZeroHour)
- django/django repository data (GitHub API)
This article is written for defenders and authorised security testers. Only test systems you own or have written permission to assess.