Skip to content

Vulnerabilities & Patches

Django patches seven flaws including critical Django4Shell RCE

The GeoDjango flaw rated 9.0 CVSS and codenamed Django4Shell by Mohamed K. Fathy of Robusta Technology Group is fixed in Django releases 6.1.4, 6.0.11 and 5.2.20.

https://breach-signal.com/vulnerabilities/django-patches-seven-flaws-including-critical-django4shell-rce/

Share

Key facts

  • Django maintainers issued releases 6.1.4, 6.0.11, and 5.2.20 on Dec 2, 2026, to patch seven security vulnerabilities.
  • CVE-2026-124827 lets an attacker with staff-level access write arbitrary files and achieve remote code execution through the RasterField assignment path.
  • CVE-2026-124827, codenamed Django4Shell by Mohamed K. Fathy of Robusta Technology Group, carries a CVSS score of 9.0.
  • CVE-2026-124827 is an incomplete fix for CVE-2026-87890, which itself incompletely patched CVE-2026-15307 addressed in August 2026.

On Dec 2, 2026, the Django project released versions 6.1.4, 6.0.11 and 5.2.20 to fix seven security vulnerabilities across supported branches. The patch release announcement covers supported Django branches.

The critical flaw, CVE-2026-124827, carries a CVSS score of 9.0 and was codenamed Django4Shell by Mohamed K. Fathy, head of cybersecurity at Robusta Technology Group. Fathy provided details to The Hacker News by e-mail. The flaw lets an attacker with staff-level access write arbitrary files and achieve remote code execution through the RasterField assignment path. RasterField is a Django model field for raster or image data.

Because RasterField uses a plain CharField form field as its fallback, models reachable through the admin, ModelForms, or writable serializers can trigger the issue by default. Rasters are common in mapping, government, agriculture, and environmental platforms. Even sites that do not consider themselves GIS applications may be exposed if django.contrib.gis is installed with a RasterField model.

CharField is a basic text field in Django forms. ModelForms are Django forms built from models. django.contrib.gis is Django’s geographic information system module.

Assigning a raster definition with a user-controlled name and non-default driver to RasterField lets GDAL create a file at an attacker-chosen location. Depending on the raster driver, that file write can enable remote code execution. Fathy lists four exploitation pre-conditions: a RasterField model, field exposure through a form or admin, a GDAL build with the EHdr driver, and a writable target path. Three of the four pre-conditions are satisfied by default in a standard Django or GeoDjango deployment, Fathy said.

GDAL is a geospatial data library. EHdr is a GDAL driver.

Staff-level authentication stands as the main requirement, Mohamed K. Fathy said. A crafted JSON raster body lets an attacker choose the destination path, file contents, and filename, Mohamed K. Fathy told The Hacker News. An attacker can replace application source code, place web shells in static directories, or alter configuration files, Mohamed K. Fathy told The Hacker News.

When sitecustomize.py sits in the worker’s current working directory, Python loads it at startup before application code runs, Mohamed K. Fathy told The Hacker News. Privileges belong to the web server OS user when the payload runs after a runserver reload, gunicorn worker fork, manage.py cron job, or subprocess execution.

Attackers can drop .pth files into site-packages. The code reaches secrets and environment variables, copies or changes data, and moves into the host or network without using model.save() or database interaction.

sitecustomize.py is a Python file loaded at interpreter startup. gunicorn is a Python web server. manage.py is Django’s command-line utility.

.pth files are Python path files. site-packages is the directory where Python installs third-party modules. The Hacker News explains when the attacker’s code executes after being placed through sitecustomize.py.

The October fix requires raster values as bytes to be wrapped in GDALRaster before spatial lookups. It accepts valid hexadecimal geometries, is backward incompatible, and requires validation of untrusted input. GDALRaster is a GDAL raster object wrapper.

Django maintainers said October release notes indicate that bytes controlled by attackers and delivered to a spatial lookup can be exploited and were missed in the CVE-2026-15307 fix. “This issue could be exploited by applications that passed attacker-controlled bytes directly to a spatial lookup,” Django maintainers said. The RasterField assignment path lacks protection, so the latest flaw allows attackers to write arbitrary files and run remote code.

A spatial lookup is a database query for geographic relationships. The Hacker News quotes the October release notes describing the earlier oversight.

CVE-2026-124827 is an incomplete fix for CVE-2026-87890, which itself incompletely patched CVE-2026-15307 addressed in August 2026. CVE-2026-15307 rates as high severity in GeoDjango spatial lookups and enables server-side file writes with possible remote code execution.

CVE-2026-87890 targets django.contrib.gis and permits server-side request forgery via crafted GDAL Virtual Raster payloads. Server-side request forgery makes a server request to internal resources.

GDAL Virtual Raster payloads are crafted geospatial data files. This represents a chain of earlier incomplete GeoDjango fixes.

The remaining fixes cover CVE-2026-132092, a SQL injection flaw in range and lookups; CVE-2026-115868, cross-site scripting in truncatechars_html; and CVE-2026-125673, cache poisoning through dot segments. All are included in the Dec 2 releases across supported branches. These are additional vulnerabilities fixed in the release.

SQL injection inserts database commands through input. Cross-site scripting injects scripts into web pages. Cache poisoning corrupts cached data.

Was this helpful?

Join the discussion

Please read our Comment Policy before commenting. First-time comments are held for moderation. By posting a comment you agree to our Terms of Use and Privacy Policy, which explain how your name, email address and comment are used.

Your email address will not be published. Required fields are marked *