Django4Shell (CVE-2026-124827) is a flaw in GeoDjango’s RasterField that lets a user who can submit a raster value write a file to a path they choose on the server, which, depending on the GDAL driver, can lead to remote code execution. Mohammed Fathy reported it, and Django fixed it on December 2, 2026 in 6.1.4, 6.0.11 and 5.2.20 (Django security releases). The same releases fix CVE-2026-132092, a SQL injection in the range and in lookups.
Key highlights
- What it is: a raster value with a user-controlled
nameand a non-default GDALdrivermakes GDAL write a file to an attacker-chosen path. - Severity: high (Django); CVSS 3.1 8.8 and CVSS 4.0 8.7 (Django Software Foundation).
- Affected: Django 5.2 before 5.2.20, 6.0 before 6.0.11 and 6.1 before 6.1.4. Django did not evaluate the unsupported 5.1, 5.0 and 4.2 series, which may also be affected.
- Trigger: a model with a
RasterFieldon PostGIS that takes user input, by default through the admin, a ModelForm or a writable serializer. - Fix: Django 5.2.20, 6.0.11 or 6.1.4.
- Stopgap: none from Django. Until you update, set
editable=Falseon eachRasterField(the fix does the same) and do not assign user input to it without validation. - Exploitation: Django does not report exploitation. The CVE is not in the CISA KEV catalog (version 2026.11.30).


Who is exposed
An application is exposed when it runs an affected Django version and has a model that declares django.contrib.gis.db.models.RasterField. RasterField exists only on PostGIS. Geometry fields are not affected. Before the fix, RasterField used the CharField form field, so the admin, ModelForms and writable model serializers accepted a raster definition as text by default. Django’s CVSS score rates the privileges required as low, which usually means a logged-in user.
The fix makes RasterField non-editable by default and rejects a dict or JSON string that names a non-default driver. Django notes that server-side request forgery is still possible when untrusted input is assigned to RasterField, so validate that input after the update.
Fix status
| Source | Status | Builds |
|---|---|---|
| Django 6.1 | Fixed | 6.1.4 |
| Django 6.0 | Fixed | 6.0.11 |
| Django 5.2 LTS | Fixed | 5.2.20 |
| Django 5.1, 5.0 and 4.2 | No fix planned | end of life; not evaluated by Django and may also be affected |
| Debian | No advisory yet | |
| Ubuntu | No advisory yet | |
| Red Hat | No advisory yet | |
| Alpine | No advisory yet |


How to check
- Find the Django version:
python -m django --versionin the application’s environment, orpip show django. For a container image:docker run --rm --entrypoint python3 <image> -m django --version(usepythonif the image has nopython3). - Search the code for the field:
grep -rn "RasterField" --include=*.py . - For each model with a
RasterField, check whether the admin, a ModelForm or a serializer writes to it.
How Cycode helps
Two items on the Threat Intelligence dashboard query the Context Intelligence Graph:
- Repositories: Python projects whose manifest or lock file resolves Django to an affected version. The count is the number of project and Django version pairs.
- Container images: scanned images with an affected Django installed as a Python package. A distribution package can also appear under its upstream version; check it against the vendor advisory. The count is the number of images.
Both items list Django 5.2 to 5.2.19, 6.0 to 6.0.10 and 6.1 to 6.1.3, whether or not the code uses RasterField. They do not list 5.1 and older, which Django did not evaluate. Use the grep in step 2 above to find the projects that declare RasterField.


What to do
- Update Django to
5.2.20,6.0.11or6.1.4. Upgrade 5.1 and older to5.2.20or later and test the upgrade, since it can include breaking changes. - Check raster code after the update:
RasterFieldnow defaults toeditable=False, and a dict or JSON string with a non-default driver raisesGDALException. Admin pages and ModelForms no longer show the field, so check pages that edit raster data before deploying. Add it back only to forms that trusted users use, and wrap trusted raster definitions that need another driver inGDALRaster. - Rebuild container images that install Django with pip and redeploy them. For Django from a distribution package, apply the vendor’s update once it is published.
- In projects that use
RasterField, validate raster input before assigning it, as Django advises, since request forgery is still possible after the fix.
Sources
- Django security releases issued: 6.1.4, 6.0.11 and 5.2.20
- CVE-2026-124827
- CVE-2026-132092
- Django security archive
- Django supported versions
- CISA Known Exploited Vulnerabilities catalog