Coresoft MMC

Django4Shell: in GeoDjango projects, an admin form can write any file to the server

03 December, 2026

Django4Shell: in GeoDjango projects, an admin form can write any file to the server

On December 2 the Django team released 6.1.4, 6.0.11 and 5.2.20. The update closes seven vulnerabilities, and the one getting the most attention is CVE-2026-124827, nicknamed Django4Shell (CVSS 8.8). It was found by Mohammed Fathy of Robusta Technology Group.

The problem sits in GeoDjango's RasterField. When the field is exposed in the admin, a ModelForm or a writable serializer, it accepts plain text. The submitted JSON is passed to GDAL during form validation, and GDAL writes a file to whatever path the text names, with whatever content it carries. This happens in is_valid(), before anything reaches the database. If an attacker drops a sitecustomize.py or .pth file into a directory Python loads from, the code runs as the web user the next time the application process starts.

The risk has limits: the attack needs a staff account, django.contrib.gis and a RasterField exposed in a form, so projects without GeoDjango are not affected by this bug. The same release, however, also fixes an SQL injection in the range and in lookups (CVE-2026-132092), so the update matters for every Django project. No attacks in the wild have been reported so far.

Move your project to the latest release of its branch. 5.1, 5.0 and 4.2 are no longer supported, so projects on them should go to at least 5.2.20. If you cannot update right away, remove RasterField from the admin and forms or set editable=False, and turn on two-factor login for staff accounts. Keep the project directory and site-packages read-only for the web process. After updating, look for unexpected sitecustomize.py and .pth files on the server: the update does not remove files that were planted earlier.

Sources: Django: security releases, December 2, 2026, Ostorlab: Django4Shell technical analysis, BreachNews: Django4Shell and GeoDjango RasterField