Django released security updates on December 2, 2026, to fix a high-severity flaw that could let attackers run malicious code on web servers using the Python framework.
The vulnerability, known as Django4Shell and tracked as CVE-2026-124827, affects GeoDjango, the part of Django that handles geographic data.
The Django team credited security researcher Mohammed Fathy with reporting the issue and urged users to upgrade as soon as possible.
The Django security advisory identifies fixes in Django 6.1.4, 6.0.11, and 5.2.20 LTS. The team also patched its main development branch.
Not every Django site exposes the affected feature, but the same releases fix six other security issues, including a separate high-severity SQL injection flaw in the framework’s range and in database lookups.
Django4Shell Vulnerability
The flaw affects RasterField , a database field used to store grid-based geographic data such as satellite images and elevation maps.
Django supports this field only on PostGIS, the spatial extension for PostgreSQL. Django’s geometry fields, which store shapes such as points and polygons, are not affected by this specific vulnerability.
On vulnerable versions, GeoDjango could pass untrusted raster definitions to GDAL, the library it uses to process geographic data. Under certain conditions, GDAL could write a file to an unintended location on the server.
Whether that write could lead to code execution depends on the available raster drivers and the Django process’s filesystem permissions.
Cyber Security News previously covered a separate GeoDjango file-write flaw involving spatial database lookups. That depends on how the application accepts raster data. In the standard Django admin interface, an attacker would need a staff account with permission to add or change records for the affected model. Superuser access is not required.
Django also identified model forms and writable API serializers, which convert incoming data into model values, as routes through which applications could expose the field.
A public form or API that accepts unvalidated raster definitions could therefore expose the flaw without a login. As of December 2, Previdian said it had found no confirmed exploitation in the wild and no independent demonstration of an unauthenticated attack.
That distinguishes Django4Shell from an earlier GeoDjango SQL injection flaw for which attacks were reported. The update leaves RasterField out of automatically generated model forms unless developers explicitly include it. Django also rejects raster definitions supplied as dictionaries or JSON strings when they specify a non-default driver.
The change limits unintended file writes, but it does not eliminate server-side request forgery, where untrusted input can make the server send unintended network requests. Django’s raster security guidance calls for validating input before passing it to the field.
Teams that cannot patch immediately should temporarily disable raster submissions from untrusted users. After upgrading, rebuild affected container images, redeploy, and run to confirm the fix is live.
If an affected form or API was exposed, review logs for unexpected file changes, new processes, and unusual outbound connections.
Django also recommends clearing potentially affected caches after upgrading because the release’s separate cache poisoning fix does not remove existing cached responses.
Provide SOC With the Latest Threat Context from 16K Sources to Quickly Stop Incidents
