News
Django4Shell lets a staff GeoDjango form write files through RasterField (CVE-2026-124827).
Django 6.1.4, 6.0.11, and 5.2.20 fix CVE-2026-124827, called Django4Shell, a CVSS 9.0 GeoDjango RasterField flaw that can write a file and, depending on the raster driver, run code from a staff form.
Saasment is an early-access AI security platform. Get early access.

Impact
- What was impacted
- GeoDjango (django.contrib.gis) RasterField on Django releases fixed by 6.1.4, 6.0.11, and 5.2.20. CVE-2026-124827 (CVSS 9.0), named Django4Shell by Mohamed K. Fathy of Robusta Technology Group, is an incomplete fix for CVE-2026-87890, which was itself an incomplete fix for CVE-2026-15307 (August 2026). Assigning a raster definition to RasterField with a user-controlled name and a non-default driver can make GDAL write a file to an attacker-chosen path. Some drivers turn that into code execution. The same releases also fix CVE-2026-132092 (SQL injection in range and in lookups), CVE-2026-115868 (cross-site scripting in the truncatechars_html filter), and CVE-2026-125673 (cache poisoning through dot segments in request paths). The project said the releases address seven issues. Only these four identifiers are named in the report.
- Who was impacted
- Sites that use GeoDjango with a RasterField, especially government, mapping, GIS, agricultural, and environmental apps. Fathy says the main requirement is a staff-level account. Django says the flaw is reachable by default when that field is in the admin, a ModelForm, or a writable model serializer, because RasterField falls back to the CharField form field. Apps that do not use django.contrib.gis are outside this bug. The report does not say the flaw is unauthenticated.
- What you need to do
- Upgrade to Django 6.1.4, 6.0.11, or 5.2.20, matching the release line you already run. Wrapping raster bytes in GDALRaster before a spatial lookup was the mitigation for CVE-2026-87890. It does not cover this RasterField assignment path. Until the upgrade, do not treat a staff account as harmless on a GeoDjango admin that edits raster fields. Afterward, look for unexpected sitecustomize.py in the worker's working directory and unexpected .pth files in site-packages. Do not send a raster payload to test the form.
Django released 6.1.4, 6.0.11, and 5.2.20 to fix seven security issues. The critical one is CVE-2026-124827, scored 9.0, which Mohamed K. Fathy, head of cybersecurity at Robusta Technology Group, named Django4Shell. It is an incomplete fix for CVE-2026-87890, and that bug was an incomplete fix for CVE-2026-15307, patched in August 2026. CVE-2026-15307 is a high-severity flaw in GeoDjango, the django.contrib.gis package. Its spatial-lookup code parsed raster data in a way that could write files on the server and, from there, run code. CVE-2026-87890 hits the same module. Crafted Geospatial Data Abstraction Library (GDAL) Virtual Raster (VRT) data that points at an external raster source can make the server request that source. Django said in the October 2026 notes that applications which passed attacker-controlled bytes straight into a spatial lookup were exposed, and that the August fix had missed that path.
The October mitigation tells applications to wrap raster values that arrive as bytes in GDALRaster before using them in a spatial lookup. Bytes that are valid hexadecimal geometries are still accepted. Django called that change backward incompatible and repeated that untrusted input has to be checked before use. CVE-2026-124827 exists because those checks do not cover assigning a raster to a RasterField. Django's advisory says that assigning a raster data definition to django.contrib.gis.db.models.RasterField, with a name the user controls and a driver other than the default, can make GDAL write a file at a location the attacker chooses. Depending on the driver, that write can run code. RasterField falls back to the CharField form field, so the flaw is reachable by default on a model that has a RasterField and is registered in the admin, edited with a ModelForm, or exposed through a writable model serializer.
Fathy said the submitted JSON raster body controls the destination path, the file contents, and the filename. That can overwrite application source, drop a web shell into a static directory, or change configuration files. One path he described is writing sitecustomize.py into the worker's current directory, which is usually on Python's import path. Python imports that file at interpreter startup, before application code runs. The payload then runs as the operating-system user of the web server on the next development-server reload, gunicorn worker fork, manage.py job, or subprocess. He also said the write can plant .pth files in site-packages, read secrets and environment variables, copy or change data, and move onto the host or the network. None of that requires a database write, and the model's save method does not have to be called.
Fathy said four conditions have to be true, and that three of them are already true on a normal GeoDjango install. The app must use django.contrib.gis with a RasterField model, which he called moderately common and typical of government, mapping, GIS, agricultural, and environmental platforms. The field must be exposed through a ModelForm or the default admin, which Django creates for every registered model unless someone excludes it. GDAL must include the EHdr driver, which he said ships in standard builds from apt, yum, Homebrew, and conda. The worker must be able to write the target path. The working directory is writable and is usually on the import path, so it is a natural place for sitecustomize.py. He said the primary requirement is staff-level authentication, and that an application which uses RasterField should assume the other conditions are already met. His advice is that a GeoDjango site with raster data, the standard admin, and a default GDAL build should treat itself as exposed until it is patched.
The same three releases also fix an SQL injection in range and in lookups (CVE-2026-132092), a possible cross-site scripting bug in the truncatechars_html template filter (CVE-2026-115868), and cache poisoning through dot segments in request paths (CVE-2026-125673). The project said seven vulnerabilities are fixed in these releases. The report names these four. It does not give a fixed version for a Django line older than 5.2. It also does not say the flaw has been used in attacks, and it does not give a configuration switch that closes CVE-2026-124827 without the upgrade.
For your AI agent
Agent instructions — copy paste to Claude
You are helping me respond to CVE-2026-124827, called Django4Shell, fixed in Django 6.1.4, 6.0.11, and 5.2.20. It is a GeoDjango RasterField file-write flaw, scored 9.0, that can run code depending on the GDAL driver. It needs a staff-level account on a typical install. It is an incomplete fix for CVE-2026-87890, which was an incomplete fix for CVE-2026-15307. Do not submit a raster payload, do not craft a GDAL Virtual Raster, do not write sitecustomize.py or a .pth file, and do not place a web shell. Ask before you upgrade Django, restart workers, remove a file, or rotate a secret. Facts from the report: - Fixed releases named: Django 6.1.4, 6.0.11, and 5.2.20. The project said these releases address seven vulnerabilities. The report names four: CVE-2026-124827, CVE-2026-132092, CVE-2026-115868, and CVE-2026-125673. Do not invent the other three identifiers or fixed versions for lines the report does not name. - CVE-2026-124827, CVSS 9.0. Named Django4Shell by Mohamed K. Fathy, head of cybersecurity at Robusta Technology Group. Incomplete fix for CVE-2026-87890, itself an incomplete fix for CVE-2026-15307, which was addressed in August 2026. - CVE-2026-15307 is a high-severity flaw in django.contrib.gis spatial-lookup raster parsing that can write files on the server and potentially run code. - CVE-2026-87890 targets the same module and can cause server-side request forgery with crafted GDAL Virtual Raster payloads that reference an external raster. Django's October 2026 notes said apps that passed attacker-controlled bytes directly to a spatial lookup were exposed, and that the August fix missed it. The mitigation was to wrap raster byte values in GDALRaster before spatial lookups. Valid hexadecimal geometry bytes stay accepted. That change is backward incompatible. It does not cover RasterField assignment. Do not treat the GDALRaster wrap as a fix for CVE-2026-124827. - Django said assigning a raster data definition to django.contrib.gis.db.models.RasterField with a user-controlled name and a non-default driver can make GDAL write a file to an attacker-controlled location. Depending on the driver, that can run code. RasterField falls back to the CharField form field, so the flaw is reachable by default when the model is in the admin, uses a ModelForm, or uses a writable model serializer. - Fathy said a crafted JSON raster body controls the path, the contents, and the filename. Effects he described include overwriting application source, dropping a web shell in a static directory, corrupting configuration, writing sitecustomize.py into the worker's current directory (usually on sys.path) so Python imports it at startup, and dropping .pth files into site-packages. Execution would use the web server OS user, on a runserver reload, a gunicorn worker fork, a manage.py job, or a subprocess. He said this needs no database write and does not require model.save(). Do not create those files. - Fathy's four conditions: a RasterField model (moderate; common in government, mapping, GIS, agricultural, and environmental apps), exposure via ModelForm or the default admin (very high unless excluded), GDAL's EHdr driver (he said it ships in standard apt, yum, Homebrew, and conda builds), and a writable target path (the worker's working directory). He said staff-level authentication is the primary requirement, and that a RasterField app should assume the rest are already true. That is his assessment. Do not claim Django assigned those prevalence ratings. - Also fixed in the same releases: SQL injection in range and in lookups (CVE-2026-132092), possible cross-site scripting in truncatechars_html (CVE-2026-115868), and cache poisoning via dot segments in request paths (CVE-2026-125673). The report does not give separate workarounds for those three. - The report does not say attacks have been observed. Do not claim exploitation, and do not claim a clean bill of health. Context: - What was impacted: GeoDjango RasterField assignment, plus three other flaws fixed in the same Django releases. - Who should care: operators of GeoDjango sites that edit raster fields through the admin, a ModelForm, or a writable serializer, where staff can sign in. - What to do: upgrade to 6.1.4, 6.0.11, or 5.2.20 on the matching release line. The older GDALRaster wrap does not close CVE-2026-124827. Do this in order. Prefer read-only checks. Ask before you upgrade Django, restart workers, delete a file, or rotate a secret. 1. Inventory - Find Django projects in scope, the installed Django version, and whether django.contrib.gis is installed. Read only. If I have not given you the tree or the lockfile, say what you need and stop. - Search for RasterField on models, and for those models in admin registrations, ModelForms, and writable serializers. Read only. Do not submit a form. - If the version is already 6.1.4, 6.0.11, or 5.2.20, say so. If the version is on another line, say the report does not name a fixed build for that line. Do not invent one. - Look, without executing project code, for an unexpected sitecustomize.py in the worker working directory and for unexpected .pth files in site-packages. Read only. If you find one, do not open it in a Python process. 2. Contain - If an unpatched GeoDjango app exposes RasterField to staff, propose removing that model from the admin or making the form read-only until the upgrade. Ask before you change the admin or the form. - Do not propose a proof request against the live admin. 3. Remediate - Propose upgrading to the fixed release on the same line: 6.1.4, 6.0.11, or 5.2.20. Name the project before you ask me to upgrade. Ask before you install or restart workers. - Do not replace the upgrade with the October GDALRaster wrapping change. That change does not cover this bug. - If a sitecustomize.py or .pth file is unexpected, propose quarantining it and rotating secrets and environment variables the worker could read. Ask before you delete the file or rotate anything. Do not print secret values. 4. Verify - Report the Django version after the change, whether RasterField is still editable by staff, and whether the unexpected files are gone. - Report which projects I did not approve for the upgrade. 5. Report back - State that staff authentication is the gate Fathy described, that the report does not say the bug is unauthenticated, and that it does not say attacks have been seen. - Mention the three other named fixes only as part of the same upgrade. Do not draft a customer notice unless I ask. Do not invent a CVE, a fixed version, a driver name, or exploit steps. If a check needs access I have not given you, say what you need and stop.