On December 2, 2026, security researchers disclosed CVE-2026-124827, a critical vulnerability in the Django web framework dubbed Django4Shell.
The vulnerability affects raster data processing in GeoDjango and may allow remote code execution through unauthorized filesystem writes.
Django applications providing geospatial data processing functionality should receive particular attention.
Security Vulnerability
| Parameter | Description |
|---|---|
| CVE Identifier | CVE-2026-124827 |
| Vulnerability Name | Django4Shell |
| Affected Software | Django |
| Affected Component | GeoDjango (django.contrib.gis) |
| CVSS Score | 9.0 |
| Severity | Critical |
| Vulnerability Type | Arbitrary File Write |
| Security Impact | Remote Code Execution (RCE) |
| Attack Vector | Network |
| Authentication Required | Depends on application configuration |
| Disclosure Date | December 2, 2026 |
| Active Exploitation | Not publicly confirmed |
| Security Fix | Available |
Vulnerability Details
Django4Shell affects the handling of raster data assigned to the GeoDjango RasterField model field.
Insufficient restrictions on user-supplied raster definitions may allow filesystem operations outside the intended application storage locations.
Applications exposing writable raster fields through administrative interfaces, model forms, or API serializers may be vulnerable.
The vulnerability is associated with incomplete remediation of two previously disclosed security issues:
- CVE-2026-15307 — unauthorized file writes and server-side request forgery through spatial lookups.
- CVE-2026-87890 — server-side request forgery through raster data processing.
Earlier security updates did not fully address all paths through which untrusted raster data could reach the underlying geospatial processing library.
Affected and Fixed Versions
The following Django releases contain security fixes:
| Django Branch | Fixed Version |
|---|---|
| Django 5.2 LTS | 5.2.20 |
| Django 6.0 | 6.0.11 |
| Django 6.1 | 6.1.4 |
Administrators running earlier releases within these branches should update immediately.
Applications using unsupported Django versions should migrate to a supported release containing the security fix.
Affected Environments
The vulnerability is particularly relevant to applications using:
- GeoDjango and geographic information systems (GIS).
- RasterField model fields.
- GDAL-based geospatial processing.
- Django administrative interfaces managing raster data.
- Web forms accepting geospatial information.
- REST APIs exposing writable raster fields.
- Geographic mapping and environmental monitoring platforms.
Applications that do not use GeoDjango raster processing are not exposed through the documented attack path.
The actual exposure depends on application permissions, input validation, filesystem access, and deployed components.
Security Impact
Depending on the application configuration and operating system permissions, successful exploitation could result in:
- Unauthorized creation or modification of files.
- Remote execution of malicious code.
- Modification of application source code.
- Corruption of application configuration.
- Exposure of database credentials and API tokens.
- Unauthorized access to sensitive information.
- Installation of persistent backdoors.
- Disruption of hosted applications.
- Further compromise of connected infrastructure.
Applications running with excessive operating system privileges may experience a significantly greater security impact.
Checking the Installed Version
Run the following command within the Python environment used by your Django application:
python -m django --version
Alternatively, check the installed package information:
python -m pip show Django
For projects using a Python virtual environment, activate the corresponding environment before checking the installed version.
Containerized applications should be checked independently from the host operating system.
Update Recommendations
We strongly recommend that customers running Django on their virtual or dedicated servers install the latest available security updates.
Updating Django
Activate your application's Python virtual environment and use the appropriate command for your installed Django branch.
python -m pip install --upgrade "Django>=5.2.20,<5.3"
python -m pip install --upgrade "Django>=6.0.11,<6.1"
python -m pip install --upgrade "Django>=6.1.4,<6.2"
Verifying the Installed Version
After installing the security update, verify the Django version and check package dependencies:
python -m django --version
python -m pip check
Run the Django deployment security checks from your application directory:
python manage.py check --deploy
Update the project's dependency requirements and lock files to ensure that subsequent deployments use a corrected Django release.
Restart the application processes after updating.
For containerized deployments, rebuild the application image using the corrected dependencies and redeploy the affected containers.
Important: Create a backup of your application files, configuration, and database before updating. Test compatibility with existing application dependencies before deploying changes to production.
Temporary Mitigation
If an immediate update is not possible, administrators should reduce exposure to vulnerable raster processing functionality.
Recommended temporary measures include:
- Disabling unnecessary raster data submission functionality.
- Restricting access to affected administrative interfaces.
- Removing writable raster fields from publicly accessible forms and APIs.
- Enforcing strict server-side input validation.
- Restricting filesystem write permissions.
- Separating writable data directories from application source code.
- Running Django applications under dedicated, unprivileged system accounts.
- Restricting unnecessary outbound network connections.
Where operationally possible, application source code and Python dependency directories should be read-only for application worker processes.
Warning: These measures reduce the available attack surface but do not replace the official security update.
Detection and Investigation
Administrators should review potentially affected applications for signs of unauthorized filesystem activity.
Potential indicators of compromise include:
- Unexpected Python files within application directories.
- Unauthorized modifications to application source code.
- Changes to Python startup configuration.
- Unexpected files within Python dependency directories.
- Suspicious requests involving raster data.
- Unrecognized application subprocesses.
- Unusual outbound network connections.
Checking Recently Modified Files
Run the following command from the Django project directory:
find . -type f \
\( -name '*.py' -o -name '*.pth' -o -name '*.so' \) \
-mtime -7 -ls
Review the results and compare unexpected modifications against trusted application source code and deployment records.
Recently modified files may originate from legitimate application deployments or package updates and do not necessarily indicate compromise.
If unauthorized activity is detected, isolate the affected application and investigate before restarting potentially compromised processes.
Security Recommendations
Considering the critical severity of CVE-2026-124827, administrators should prioritize the following actions:
- Update Django to a fixed release.
- Audit applications using GeoDjango and RasterField.
- Review administrative interfaces and API serializers.
- Restrict application filesystem permissions.
- Prevent application processes from modifying executable source code.
- Maintain isolation between hosted applications.
- Review application and web server logs.
- Update dependency requirements and container images.
- Maintain regular application and database backups.
- Rotate potentially exposed credentials if compromise is confirmed.
Django4Shell demonstrates the importance of validating untrusted data before passing it to external processing libraries and maintaining strict filesystem permissions within application environments.
Installing the security update remains the recommended permanent solution.