Skip to content
Exploit for CVE-2026

Exploit for CVE-2026

Sploitus • December 2, 2026

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 `init_raster` -> `GDALRaster(user_input)`

4. `_preprocess_input` parses JSON string to dict

5. `GDALRaster.__init__` with dict input forces `write=True` and calls `capi.create_ds(driver, name, ...)`

6. With `driver: "EHdr"` and `name: "/app/sitecustomize"`, GDAL writes `/app/sitecustomize.bil`

7. Band data contains attacker payload bytes

The file write happens **before** any DB save. An attacker can drop `sitecustomize.py` (auto-imported by Python at startup) or `.pth` files into `site-packages` for code execution on the worker restart.

- Staff-level Django authentication (or any path that assigns to a RasterField)

- `django.contrib.gis` with a RasterField model exposed via admin/ModelForm/serializer

- GDAL with EHdr driver (ships in every standard GDAL build)

- Writable target path (project root / /tmp / site-packages)

- **Docker lab:** Vulnerable Django 5.2.19 + PostGIS + GDAL, ready in one command

- **Check mode:** Non-destructive vulnerability verification (`--check`)

- **Write mode:** Arbitrary file write to attacker-controlled path (`--write-file`)

- **Batch scanning:** Scan multiple targets from a file (`--targets`)

- **OS detection:** Auto-detects target OS from Server header, adjustable with `--target-os`

- **Nmap NSE script:** Non-exploitative authenticated detection scan

- **Nuclei template:** Authenticated vulnerability check for batch scanning

- **Benign by default:** Writes a marker string to `/tmp`, no weaponized payloads

git clone

Wait for `Lab ready: in the output.

In a separate terminal from the project root:

**Check if vulnerable (non-destructive):**

--content "CVE-2026-124827 file write proof"

docker compose -f docker/docker-compose.yml exec web cat /tmp/pwned.bil

Expected output: `CVE-2026-124827 file write proof`

| `--check` | Non-destructive vulnerability check |

| `--write-file PATH` | Write file to PATH on target (GDAL appends .bil) |

| `--force` | Skip HTTP status code checks (continue on unexpected responses) |

| `--url` | Target URL (auto-prefixes http:// if missing) |

| `--targets FILE` | File with one URL per line (--check only) |

| `--username` | Staff username (required) |

| `--password` | Staff password (required) |

| `--admin-path` | Admin URL path (default: admin) |

| `--app-label` | Django app label (default: poc) |

| `--model-name` | Model name (default: rasterdemo) |

| `--field-name` | RasterField form field name (default: raster) |

| `--target-os` | Target server OS: auto, linux, windows (default: auto) |

| `--csrf-token` | Pre-obtained CSRF token |

| `--timeout` | HTTP timeout in seconds (default: 10) |

Non-exploitative scan using the included NSE script:

nmap -p 8000 --script nmap/CVE-2026-124827.nse \

--script-args 'username=staff,password=staffpass' 127.0.0.1

nmap -p 8000 --script nmap/CVE-2026-124827.nse \

--script-args 'username=admin,password=secret,app-label=myapp,model-name=mymodel,field-name=raster_data' target.example.com

nuclei -t nuclei/CVE-2026-124827.yaml -u \

-var username=staff -var password=staffpass \

-var admin_path=admin -var app_label=poc \

-var model_name=rasterdemo -var field_name=raster

- **Upgrade Django** to 5.2.20, 6.0.11, or 6.1.4+

- Remove or restrict admin access to models with `RasterField`

- Set `editable=False` on RasterField explicitly

- Validate all user input before assigning to RasterField

See [docker/DOCKER.md](docker/DOCKER.md) for build/run commands.

| Django | 5.2.19 (last vulnerable 5.2.x) |

| GDAL | Debian default (includes EHdr) |

- [Django Security Release (Dec 2, 2026)](

- [Django Security Release (Oct 6, 2026)](

- [Django Security Release (Aug 4, 2026)](

- [The Hacker News: Django4Shell](

- [NVD: CVE-2026-124827](

For authorized testing and research only. See [SECURITY.md](SECURITY.md).

The full story

This article is one source in a clustered incident — the cluster page carries the summary, timeline and every other outlet covering it.

Django4Shell: CVE-2026-124827 RasterField flaw enables file write and possible RCE Django released versions 6.1.4, 6.0.11 and 5.2.20 on 2 December 2026 to fix CVE-2026-124827, dubbed Django4Shell, a high-severity (CVSS 8.8 per the verified record; The Hacker News reports CVSS 9.0) server-side file-write flaw in GeoDjango's RasterField assignment path. Django's advisory says that assigning a raster definition with an user-controlled name and a non-default GDAL driver could write a file to an attacker-controlled location, which depending on the driver could enable remote code execution. The flaw is described as an incomplete fix for CVE-2026-87890, which itself was an incomplete fix for CVE-2026-15307. Robusta Technology Group's Mohammed Fathy is credited with the research and says an authenticated staff user could submit a crafted JSON raster through a ModelForm or Django admin view to write sitecustomize.py or.pth files, though these exploitation details come from the researcher's write-up and have not been independently verified. Django states RasterField falls back to the CharField form field, so it was reachable by default in admin and ModelForms, and only PostGIS-backed RasterField is affected, not geometry fields. The fix sets RasterField editable to False by default and raises GDALException for dict or JSON definitions specifying non-default drivers. Django notes server-side request forgery remains possible if untrusted input reaches RasterField. Cybersecuritynews reports no confirmed and no independent demonstration of unauthenticated attack as of 2 December. The same releases also fix other issues, including a separate high-severity SQL injection flaw in range and lookups. 7 sources 74

Extracted Entities