RTG Discovers Django4Shell: A Security Flaw Beyond Django’s Recent Patch
RTG's security research uncovered CVE-2026-124827, a GeoDjango file-write vulnerability that can lead to remote code execution. Here is what affected teams should review.
Our team at Robusta Technology Group has identified a remote code execution flaw in GeoDjango, Django's geographic application framework. Discovered by Mohamed Fathy, Head of Cybersecurity at RTG, the finding is tracked as CVE-2026-124827 and described in our research as Django4Shell.
The research demonstrates a path that bypasses Django's earlier raster lookup hardening for CVE-2026-87890. Django's official security release credits Fathy for reporting the new issue, which has also been covered by The Hacker News.
What the Vulnerability Means
In the demonstrated scenario, an attacker with staff or administrator access to an exposed raster form can trick an application into writing malicious Python code to a location the application can modify. If that location is loaded by Python at startup, the code can execute when the application process next starts or restarts.
The unexpected behavior happens during form validation, before the application saves the model to its database. The earlier protection applied to raster query lookups, but did not cover this separate assignment and validation path.
Which Applications Should Review Their Setup?
This is not a vulnerability in every Django website or every mapping feature. The relevant exposure involves GeoDjango's RasterField accepting untrusted raster definitions through Django Admin, a ModelForm, or a writable model serializer. Impact depends on the available GDAL drivers, access to that input path, and the application process's filesystem permissions.
Django's release notes explicitly state that geometry fields were not affected. Teams using geographic or mapping features should check whether their application actually uses RasterField and how raster input is accepted.
Official Severity and Available Fixes
Django classifies CVE-2026-124827 as High severity. Although the Django4Shell research describes the demonstrated impact as Critical / P1, the official CVE record lists CVSS scores of 8.8 under version 3.1 and 8.7 under version 4.0, both High.
The official advisory identifies affected supported branches as Django 6.1 before 6.1.4, 6.0 before 6.0.11, and 5.2 before 5.2.20. Earlier unsupported series were not evaluated and may also be affected.
- Upgrade to Django 6.1.4, 6.0.11, or 5.2.20, as appropriate for your supported branch, or a later security-maintained release.
- Review admin forms, ModelForms, and writable serializers that expose RasterField. Limit access and validate untrusted raster input.
- Review filesystem permissions so the application process cannot unnecessarily modify application code or Python startup locations.
- Follow Django's raster security guidance after upgrading: the file-write fix does not make all untrusted raster input safe, and server-side request forgery remains a separate consideration.
Making Open Source Safer
This discovery is part of RTG's ongoing commitment to making the open-source ecosystem safer for everyone. Identifying overlooked execution paths and reporting them responsibly helps maintainers strengthen the software that organizations rely on every day.
We believe in building technology that is not just powerful, but trustworthy. Security research is one of the ways we live that commitment.
Review Your Django Application
If your team runs a Django application with geographic or mapping features, now is a good time to review your setup. Start with your Django version, whether RasterField is used, and the forms or APIs that can write to it. Our research site and Django's official advisory provide further context and remediation guidance.
Sources and Further Reading
Secure Your Django Application
RTG offers a dedicated Django4Shell security assessment covering detection of vulnerable RasterField surfaces, full exploitation chain verification, remediation guidance for Django admin and ModelForm layers, regression test suites, and a written advisory report suitable for board-level disclosure.


