CVE-2026-124827: Django4Shell
Django4Shell is an external control of file name or path vulnerability in GeoDjango's django.contrib.gis.db.models.RasterField. Attacker-controlled raster definitions supplied as dictionaries or JSON strings can specify a name and a non-default GDAL driver, causing GDAL to create files at attacker-selected locations. File-backed drivers interpret the name as a destination rather than an in-memory label. The vulnerable conversion can occur during raster attribute evaluation or form validation, without a database write or model.save() call. Depending on the driver and filesystem permissions, the file-write primitive can enable remote code execution. Affected supported releases are Django 5.2 before 5.2.20, 6.0 before 6.0.11, and 6.1 before 6.1.4. Unsupported series, including 4.2, 5.0, and 5.1, were not evaluated and may also be affected. RasterField is supported only on PostGIS; geometry fields are unaffected.
Impact, mitigation & remediation
What it means and what to do now: patch path, interim mitigations, and the assume-compromise checklist.
Impact
What an attacker gets, and what they’ve been doing with it.
Successful exploitation permits attacker-controlled file creation and potentially modification of application code or configuration within locations writable by the Django process. If a written file is subsequently loaded or executed, an attacker may obtain code execution with the application's operating-system privileges. Consequences can include disclosure of application secrets and data, unauthorized data modification, service disruption, persistence, and further host or network compromise. Remote code execution is conditional on the available GDAL driver, writable destinations, and subsequent loading or execution of the planted content.
Mitigation
If you can’t patch tonight, do this now.
Until patching is possible, disable untrusted raster submissions and exclude RasterField from Django admin forms, ModelForms, and writable serializers. Set editable=False, but also block direct assignment of unvalidated input because form exclusion does not protect custom assignment paths. Restrict raster-editing interfaces to trusted users, protect administrative access with multifactor authentication and network restrictions, and limit available GDAL raster drivers. Run Django with minimal filesystem privileges and make application code and Python package directories read-only where feasible. Review raster submissions and unexpected file modifications for signs of attempted or successful exploitation.
Remediation
Patch, then assume compromise.
Upgrade to Django 5.2.20, 6.0.11, or 6.1.4, or a later supported patched release. Migrate unsupported installations to a supported patched branch. Rebuild and redeploy affected application images and verify the running Django version. The fix makes RasterField non-editable by default and rejects dictionary or JSON raster definitions specifying drivers other than the in-memory MEM driver. Test raster-editing workflows for compatibility. Explicit GDALRaster construction with other drivers should be reserved for trusted, validated definitions. Continue validating raster input after upgrading because the file-write fix does not eliminate server-side request forgery risks. If exploitation is confirmed, rebuild affected hosts from known-good images and rotate application-accessible secrets; upgrading alone does not remove planted files.
Exploits
3 exploits validated by Mallory's analysis. Hidden: 1 rejected by Mallory's analysis as not a working exploit.
References
Frequently asked questions
- Is CVE-2026-124827 exploited in the wild?
- As of Dec 3, 2026, Mallory has no reports of CVE-2026-124827 being exploited in the wild. It is not listed in CISA KEV.
- Is there a public exploit for CVE-2026-124827?
- Yes. Mallory tracks 3 public exploits or proofs of concept for CVE-2026-124827, the earliest disclosed Dec 2, 2026.
- Is there a patch for CVE-2026-124827?
- Upgrade to Django 5.2.20, 6.0.11, or 6.1.4, or a later supported patched release. Migrate unsupported installations to a supported patched branch.
- How severe is CVE-2026-124827?
- CVE-2026-124827 has a CVSS v4 score of 8.7 (High) as of Dec 3, 2026.
Recent activity
70 sources tracked across advisories, community write-ups, and news. New activity surfaces here as Mallory finds it.