Django maintainers have released security updates addressing CVE-2026-124827, a high-severity vulnerability in GeoDjango that can allow an attacker to write arbitrary files to the server and potentially achieve remote code execution.
Dubbed Django4Shell by security researcher Mohammed Fathy, the flaw resides in the RasterField assignment path within django.contrib.gis. By supplying a specially crafted raster data definition containing an attacker-controlled filename and a non-default GDAL driver, an attacker can cause files to be written to arbitrary locations accessible to the Django application process. Depending on where and what is written, this primitive can be turned into code execution.
Django disclosed the vulnerability on December 2, 2026 and released versions 6.1.4, 6.0.11, and 5.2.20 to address it. The Django Security Team rates the issue High, with a CVSS 3.1 score of 8.8 and a vector indicating network access, low attack complexity, low privileges, and no required user interaction.
The vulnerability is particularly relevant to organizations running GeoDjango applications that process geospatial raster data. Government, mapping, agriculture, environmental monitoring, infrastructure, and other GIS-heavy environments may be more likely to expose the vulnerable functionality.
Importantly, Django4Shell should not be interpreted as a universal unauthenticated RCE affecting every Django deployment. The vulnerable application must use GeoDjango with RasterField, and the field must be reachable through functionality such as Django Admin, a ModelForm, or a writable serializer. In the default administrative attack path described by the researcher, staff-level authentication is required.
Organizations can strengthen defenses against emerging vulnerability exploitation with SOC Prime’s AI-Native Detection Intelligence Platform, helping security teams operationalize threat intelligence and accelerate detection engineering and threat hunting across SIEM, EDR, XDR, and Data Lake environments.
Detect CVE-2026-124827 by correlating suspicious requests to GeoDjango forms or administrative endpoints with unexpected file creation by Python or application-server processes, particularly writes into application directories, Python module paths, site-packages, or other locations that could result in automatic code execution.
Detection content may not be available for every CVE. Check the SOC Prime Platform for current coverage. If relevant detections are not yet available, check again as new threat intelligence and detection content are continuously added.
CVE-2026-124827 analysis
CVE-2026-124827 affects supported Django 5.2, 6.0, and 6.1 releases before the security updates published on December 2, 2026.
The confirmed vulnerable and fixed versions are:
| Django branch | Vulnerable versions | Fixed version |
| Django 6.1 | Before 6.1.4 | 6.1.4 |
| Django 6.0 | Before 6.0.11 | 6.0.11 |
| Django 5.2 | Before 5.2.20 | 5.2.20 |
Earlier unsupported branches, including Django 5.1.x, 5.0.x, and 4.2.x, were not evaluated by the Django Security Team and may also be affected. Organizations should therefore not interpret the absence of those releases from the supported-version table as confirmation that legacy deployments are safe.
The vulnerable functionality exists in:
django.contrib.gis.db.models.RasterField
GeoDjango uses the Geospatial Data Abstraction Library, or GDAL, to handle raster datasets. Django applications can construct raster objects from data definitions containing information such as width, height, spatial reference, pixel data, driver, and output filename.
The issue occurs when attacker-controlled raster data reaches a RasterField. A crafted definition can specify a user-controlled name parameter along with a non-default GDAL driver. Django passes the resulting definition to GDAL, which can create files using the attacker-supplied path.
The vulnerability becomes reachable because RasterField historically falls back to Django’s CharField form field behavior. This means models containing a raster field can expose the value through automatically generated Django Admin interfaces, ModelForms, or writable model serializers unless application developers explicitly restrict it.
The Hacker News reports that the attack can use a crafted JSON raster body to control the target path, filename, and file contents.
A non-default GDAL driver such as EHdr can then cause GDAL to create a file at the chosen location. The arbitrary file-write primitive occurs during field assignment and validation, before the application necessarily calls model.save() or performs database interaction.
This distinction matters because security controls focused only on database writes may fail to detect the attack.
The researcher demonstrated several ways arbitrary file creation could lead to code execution.
One technique involves placing a malicious sitecustomize.py file within a location on Python’s module search path. Python automatically attempts to import sitecustomize during interpreter initialization. Consequently, attacker-controlled Python code could execute when a new application worker starts, Gunicorn forks a worker, a management command runs, or another Python process initializes within the compromised environment.
A similar approach could target .pth files inside Python site-packages, which can also influence Python startup behavior.
Other potential outcomes of arbitrary file write include modifying application source code, overwriting configuration files, planting web-accessible payloads where deployment architecture permits it, or corrupting files required by the application.
Successful exploitation therefore does not necessarily execute code immediately during the malicious HTTP request. In some scenarios, the attacker first obtains an arbitrary write primitive and then waits for an application reload, worker restart, scheduled management task, or other Python execution event to trigger the planted payload.
According to the researcher, four conditions are particularly relevant:
- the application uses django.contrib.gis and contains a RasterField;
- the field is exposed through Django Admin, a ModelForm, or another writable interface;
- the server uses a GDAL build containing an appropriate writable raster driver;
- the Django worker can write to a useful filesystem location.
Three of these conditions may be common in standard GeoDjango environments once an application actually uses raster data. However, the requirement to use RasterField significantly limits exposure compared with vulnerabilities affecting Django core request processing universally.
The default Django Admin path also requires an authenticated staff user. The official CVE vector accordingly assigns PR:L, or low privileges, rather than treating the flaw as unauthenticated. An application that exposes a vulnerable writable model endpoint differently could alter the practical attack surface, so organizations should evaluate their own forms, serializers, and authorization controls.
The vulnerability is also notable because it follows earlier GeoDjango security issues.
CVE-2026-15307, addressed in August 2026, involved GeoDjango spatial lookup raster parsing and could enable server-side file writes.
A subsequent flaw, CVE-2026-87890, involved crafted GDAL Virtual Raster payloads and could enable server-side request forgery. Django described that issue as functionality overlooked by the earlier fix.
CVE-2026-124827 reaches a different code path: RasterField assignment rather than the previously addressed spatial lookup flow. This is why protections introduced for the earlier vulnerabilities did not fully eliminate the risk.
The fix changes the behavior of RasterField by making it non-editable by default. In patched versions, RasterField defaults to editable=False, preventing Django from automatically including it in a ModelForm unless a developer deliberately exposes the field.
The CVE-2026-124827 PoC situation has developed quickly since disclosure. Multiple public GitHub repositories now claim to demonstrate the arbitrary file-write and RCE chain, including examples targeting authenticated Django Admin or custom ModelForm endpoints. Public exploit repositories appeared on December 2 and December 3, meaning defenders should assume that the technical details required to reproduce the issue are readily available.
However, public exploit code should not be confused with confirmed malicious exploitation.
As of December 4, 2026, the vulnerability is not listed in CISA’s Known Exploited Vulnerabilities catalog, and the sources reviewed for this article do not report verified exploitation in real-world attacks.
For CVE-2026-124827 detection, security teams should focus on both application-layer activity and the resulting filesystem behavior.
Potentially valuable web telemetry includes unusual POST requests to Django Admin add or change endpoints associated with models containing raster fields, as well as suspicious requests to custom GeoDjango form or API endpoints that accept raster definitions.
Defenders should examine incoming payloads for unusual raster JSON structures containing fields such as:
driver
name
and filesystem-style paths that would be unexpected in legitimate geospatial data.
Endpoint monitoring is even more important because successful exploitation ultimately creates files.
Security teams should investigate Python, Gunicorn, uWSGI, ASGI, WSGI, or other application-server processes creating unexpected files in:
- Django project directories;
- Python module search paths;
- virtual environments;
- site-packages;
- writable static or application directories;
- temporary locations followed by execution or module loading.
Particular attention should be given to unexpected creation or modification of:
sitecustomize.py
.pth files
Python application modules
configuration files
startup scripts
File creation followed by a Gunicorn worker restart, Python subprocess execution, manage.py activity, or a service reload may represent the transition from arbitrary file write to code execution.
Security teams should also monitor application-server processes spawning unexpected utilities or shells such as sh, bash, curl, wget, or interpreters inconsistent with normal application behavior.
Traditional CVE-2026-124827 IOCs are currently limited. The vulnerability does not inherently require a fixed attacker IP address, domain, malware hash, or command-and-control infrastructure. Each attacker can construct a different raster payload and choose different output paths.
Behavior-based hunting is therefore more reliable than static blocklists.
CVE-2026-124827 Mitigation
Django users should upgrade affected deployments immediately to one of the fixed releases:
- Django 6.1.4 or later;
- Django 6.0.11 or later;
- Django 5.2.20 or later.
The fixes were released on December 2, 2026. Organizations using unsupported branches should move to a supported release rather than assuming an older version is unaffected.
The most important CVE-2026-124827 mitigation measure is applying the official update, because the patched framework changes RasterField behavior and closes the vulnerable default exposure path.
The patch sets RasterField to editable=False by default. As a result, Django no longer automatically exposes raster fields through generated ModelForms unless developers explicitly opt into that behavior.
Organizations should additionally inventory applications that use:
django.contrib.gis
and determine whether their data models contain:
RasterField
If GeoDjango is installed but the application never uses raster fields, the vulnerable code path may not be reachable. Nevertheless, teams should still install the latest security release because the December Django updates address several other security vulnerabilities.
Application owners should review:
- Django Admin registrations containing raster models;
- custom ModelForms;
- Django REST Framework or other writable model serializers;
- custom APIs that accept geospatial raster definitions;
- permissions assigned to staff or other users able to edit raster data.
Fields that do not need to be modified by users should not be exposed through forms or API serializers.
Administrators should also apply filesystem least privilege to Django application workers. Application processes should not have write permission to Python package directories, application source directories, startup locations, or other sensitive paths unless operational requirements explicitly demand it.
Containers can further reduce impact when application filesystems are immutable or read-only and writable directories are tightly scoped.
Security teams should review existing deployments for suspicious files even after upgrading. Since public technical information and exploit examples appeared almost immediately after disclosure, patching protects against future attempts but does not determine whether a vulnerable application had already been tested or compromised.
Organizations should look for unexpected sitecustomize.py, .pth, and Python source files, particularly files owned by the account running Gunicorn, uWSGI, Apache, Nginx application workers, or containerized Django services.
If suspicious arbitrary file writes are identified, responders should assume attackers may have gained code execution under the Django application account.
Incident response should include reviewing application secrets, environment variables, database credentials, cloud credentials, API tokens, SSH material, and other sensitive values accessible to the web application.
Potentially exposed credentials should be rotated after containment.
Administrators should also review application and reverse-proxy logs for the original request, determine which authenticated account was used, and investigate whether those credentials were compromised.
Because the typical demonstrated path requires staff-level privileges, unexplained administrator or staff activity preceding exploitation may indicate an earlier credential compromise that must also be remediated.
FAQ
What is CVE-2026-124827 and how does it work?
CVE-2026-124827, also known as Django4Shell, is an arbitrary server-side file-write vulnerability in GeoDjango’s RasterField handling. An attacker who can submit a crafted raster definition can control the output filename and use a non-default GDAL driver to write data to a chosen filesystem location. If the attacker places executable Python content in a location loaded by the application, the file-write primitive can lead to remote code execution.
When was CVE-2026-124827 first discovered?
Django credits security researcher Mohammed Fathy with reporting the vulnerability. The CVE was reserved on November 9, 2026, while Django publicly disclosed the issue and released patched versions on December 2, 2026. The available official advisory does not specify the exact date on which the researcher originally discovered or privately reported the flaw.
What is the impact of CVE-2026-124827 on systems?
Successful exploitation enables an attacker to write files to locations accessible to the Django application account. This could allow modification of application code or configuration, placement of persistent Python startup files, access to secrets after code execution, data theft, and potentially further compromise of the host or connected infrastructure. The practical impact depends heavily on filesystem permissions and the privileges of the Django worker process.
Can CVE-2026-124827 still affect me in 2026?
Yes. Django 6.1 installations earlier than 6.1.4, Django 6.0 installations earlier than 6.0.11, and Django 5.2 installations earlier than 5.2.20 remain vulnerable when the affected GeoDjango functionality is exposed. Older unsupported branches may also be affected but were not evaluated by Django. Public proof-of-concept code is already available, although no confirmed in-the-wild exploitation was identified in the sources reviewed as of December 4, 2026.
How can I protect myself from CVE-2026-124827?
Upgrade to Django 6.1.4, 6.0.11, or 5.2.20 or later, depending on the release branch. Review applications using GeoDjango RasterField, restrict access to forms and serializers that accept raster data, apply least-privilege filesystem permissions to application workers, and investigate unexpected Python-related file creation. Administrators should continue monitoring Django’s official security releases for updated details for CVE-2026-124827 and any changes in exploitation status.