Karen IT Security Response Center (KSRC) Advisory
Advisory ID: KSRC-2026-12051 | Publication Date: 05 December 2026
Django4Shell – Remote Code Execution via GeoDjango RasterField
CVE-2026-124827 (and companion CVE-2026-132092)
Summary
On 2 December 2026 the Django project released security updates addressing seven vulnerabilities. The most significant is CVE-2026-124827, publicly known as Django4Shell. This flaw allows an authenticated user (typically staff-level) to achieve arbitrary file write and potentially remote code execution through GeoDjango’s RasterField.
The same release also patches CVE-2026-132092, a SQL injection vulnerability rated CVSS 9.8.
Technical Details
The vulnerability exists in django.contrib.gis.db.models.RasterField. When a crafted raster data definition (JSON or dict) containing a user-controlled name parameter and a non-default GDAL driver is submitted, GDAL writes a file to an attacker-chosen path on the server. Depending on the driver and writable locations, this can be escalated to remote code execution (e.g., by writing Python startup files such as sitecustomize.py).
This is the third incomplete fix for the same attack surface (previous related issues were addressed in August and October 2026).
Affected Versions
- Django 5.2.x before 5.2.20
- Django 6.0.x before 6.0.11
- Django 6.1.x before 6.1.4
Older unsupported branches (5.1, 5.0, 4.2, etc.) were not evaluated and may also be affected.
Note: Only applications using GeoDjango (django.contrib.gis) with a RasterField on PostGIS are exposed to the RCE path. Standard Django applications without GeoDjango are not affected by Django4Shell, but should still apply the update because of the accompanying SQL injection.
Impact
- Arbitrary file write on the server
- Potential remote code execution
- Requires authenticated access (staff or equivalent) that can submit data to a form/serializer exposing the RasterField
Recommendations
- Upgrade immediately to one of the fixed versions:
- Django 5.2.20
- Django 6.0.11
- Django 6.1.4
- If immediate upgrade is not possible, set
editable=Falseon allRasterFieldinstances as a temporary mitigation. - Review all ModelForms, admin configurations, and writable serializers that expose RasterField.
- Rebuild container images / restart application workers after upgrading.
- Monitor for suspicious form submissions containing raster definitions.
Support from KSRC
KSRC (Karen IT Security Response Center) is fully prepared to assist organizations with any questions, impact assessment, or incident response related to these vulnerabilities.
Karen IT
We make the Internet harder to abuse.