CVE-2026-124827 (Django4Shell): Arbitrary file write to RCE via GeoDjango RasterField. PoC exploit, Nmap NSE, Nuclei template, Docker lab.
<h1 align="center">Django4Shell (CVE-2026-124827) PoC</h1>
<p align="center">
<img src="https://api.visitorbadge.io/api/visitors?path=https%3A%2F%2Fgithub.com%2Fjoshuavanderpoll%2FCVE-2026-124827&label=Views&countColor=%2337d67a" />
<img src="https://img.shields.io/badge/python-%23FFDF76.svg?style=for-the-badge&logo=python&logoColor=black" alt="Python">
<img src="https://img.shields.io/badge/django-%23092E20.svg?style=for-the-badge&logo=django&logoColor=white" alt="Django">
</p>
## Demo
<p align="center">
<img src="assets/demo.gif" alt="CVE-2026-124827 PoC Demo" width="800">
</p>
## Description
CVE-2026-124827 (dubbed **Django4Shell**) is an arbitrary file write vulnerability in Django's GeoDjango module that leads to remote code execution. It is an incomplete fix for CVE-2026-87890, which itself was an incomplete fix for CVE-2026-15307.
The flaw exists in the `RasterField` assignment path: when a crafted JSON raster body with a non-default GDAL driver (e.g. EHdr) is submitted through a Django admin form or ModelForm, GDAL writes a file to an attacker-controlled path with attacker-controlled content. The write fires during field assignment (`SpatialProxy` -> `GDALRaster.__init__`), before any database interaction or `model.save()` call.
**Affected versions:** Django 5.2 < 5.2.20, 6.0 < 6.0.11, 6.1 < 6.1.4 (with `django.contrib.gis`)
**CVSS:** 9.0 (Critical)
## Vulnerability Chain
| CVE | Date | Attack Path | Primitive |
|-----|------|-------------|-----------|
| CVE-2026-15307 | Aug 2026 | Spatial lookup | File write via dict/str in lookups |
| CVE-2026-87890 | Oct 2026 | Spatial lookup | SSRF via bytes/VRT (missed in 15307 fix) |
| **CVE-2026-124827** | Dec 2026 | **Field assignment** | File write + RCE (guard only on lookup, not assignment) |
## How It Works
1. `RasterField` falls back to `CharField` as form field (editable by default on vulnerable versions)
2. Admin / ModelForm / serializer accepts a raw JSON string
3. `SpatialProxy.__