HighCVE-2026-124827 3 Hunt LeadsRemote AttackerThe Hacker News

Django4Shell: Third Try at Fixing GeoDjango’s File-Write Hole

Django 6.1.4, 6.0.11 and 5.2.20 fix Django4Shell (CVE-2026-124827), a GeoDjango RasterField bug that lets a staff-level user write files anywhere and get code execution. It's the third fix for the same code since August.

Django’s GeoDjango raster code has now needed three fixes in four months. The latest, CVE-2026-124827, nicknamed Django4Shell by researcher Mohamed K. Fathy, lets a user with staff access make the server write a file wherever they like, and a well-placed file becomes code execution. The Django team patched it on Dec. 2 in 6.1.4, 6.0.11 and 5.2.20, along with six other bugs, The Hacker News reports.

For defenders

Affected: Django 6.1 before 6.1.4, 6.0 before 6.0.11 and 5.2 before 5.2.20, on apps using django.contrib.gis with a RasterField model (PostGIS only). Unsupported series such as 5.1, 5.0 and 4.2 weren’t evaluated and may be affected. Geometry fields are not affected.

Severity: the CVE record scores it 8.7 (CVSS 4.0, High) and Django rates it “high”; the researcher and The Hacker News cite 9.0. EPSS is about 2.9% (87th percentile). Not in CISA KEV. No exploitation reported, though our CVE data counts 7 public GitHub proof-of-concept repositories.

How it works: assigning a raster definition with a user-controlled name and a non-default GDAL driver makes GDAL write a file to that path. RasterField fell back to a plain text form field, so it was reachable by default through the admin, ModelForms and writable serializers. Fathy says the near-universal EHdr driver is enough, and that dropping sitecustomize.py in the worker’s working directory (or a .pth file in site-packages) gets code run the next time Python starts: a gunicorn worker fork, a reload or a manage.py cron job. The catch is that the attacker needs a staff login. This is an incomplete fix for CVE-2026-87890 (October), itself an incomplete fix for CVE-2026-15307 (August). T1190 (Exploit Public-Facing Application), T1546.018 (Event Triggered Execution: Python Startup Hooks).

Also fixed: SQL injection in range/in lookups (CVE-2026-132092, high), XSS in truncatechars_html (CVE-2026-115868), cache poisoning via dot segments (CVE-2026-125673; clear caches after upgrading), two admin changelist info leaks and a GDAL buffer overflow.

Mitigate now: upgrade. The fix makes RasterField non-editable by default and rejects dict or JSON definitions naming a non-default driver. It does not stop server-side request forgery if you still assign untrusted input to the field, so validate it.

What it means for you

Django is the framework behind a lot of websites, including many mapping, government, farming and environmental platforms that use its GeoDjango add-on. If your site’s developer used GeoDjango with raster (image-style map) data, someone who gets hold of a staff login could take over the server. Ask whoever maintains the site to upgrade Django this week. If your site doesn’t use Django, nothing to do.

Do this now

  1. Upgrade to Django 6.1.4, 6.0.11 or 5.2.20 (or move off unsupported 5.1, 5.0 and 4.2).
  2. Check whether any model uses RasterField, and keep it out of the admin and forms unless you really need it there.
  3. Look for unexpected sitecustomize.py or .pth files in your project folder and site-packages.
  4. Turn on multi-factor login for every Django staff account, since staff access is the attacker’s way in.

Source article: New Django4Shell Vulnerability Enables Django RCE via GeoDjango Form Validation
Publisher: The Hacker News (Ravie Lakshmanan)
Published: Dec. 2, 2026
URL: https://thehackernews.com/2026/12/new-django4shell-vulnerability-enables.html

Executive Summary

CVE-2026-124827, named Django4Shell by researcher Mohamed K. Fathy of Robusta Technology Group, is a server-side arbitrary file write in GeoDjango’s RasterField that can lead to remote code execution in Django 6.1 before 6.1.4, 6.0 before 6.0.11 and 5.2 before 5.2.20, with older unsupported series possibly affected. It is the third flaw in the same raster-handling code in four months, an incomplete fix for CVE-2026-87890 (October, SSRF via GDAL VRT payloads), which was itself an incomplete fix for CVE-2026-15307 (August, file write via spatial lookups). No threat actor is associated and no in-the-wild exploitation has been reported; the CVE record scores it 8.7 (CVSS 4.0) while the researcher cites 9.0, and public proof-of-concept repositories exist. The chain requires a staff-level login: the attacker submits a crafted JSON raster definition through any RasterField exposed in the Django admin, a ModelForm or a writable serializer, setting a non-default GDAL driver (EHdr ships in every standard GDAL build) and a name parameter pointing at a path of their choosing; GDAL writes the file there without any model save. By writing sitecustomize.py into the worker’s current working directory or a .pth file into site-packages, the attacker gets code executed automatically the next time a Python interpreter starts (a gunicorn worker fork, a runserver reload, a manage.py cron job or a subprocess), with the privileges of the web server user. The objective an attacker would pursue is code execution on the application host, giving access to secrets, environment variables and data, and a pivot into the network. Hunt leads, false positive expectations and indicators are detailed below; no detection rules or file hashes were published.

ATT&CK chain: Initial Access → Persistence → Execution

Hunt Lead Grid

Hunt Lead Level Hunt Lead Name ATT&CK Risk of False Positives
1 (Junior) New sitecustomize.py or .pth Files on Django Hosts T1546.018 (Event Triggered Execution: Python Startup Hooks) Low. Package installs legitimately create .pth files in site-packages, so the sweep anchors on files written by the web server user outside a deployment window, and on any sitecustomize.py in the project root.
2 (Pro) Raster Submissions Naming a Non-Default GDAL Driver T1190 (Exploit Public-Facing Application) Medium. GIS staff may legitimately upload rasters, so the rule anchors on JSON raster definitions in form or API bodies that set a driver and a name containing a path, which normal uploads do not need.
3 (Elite) Web Worker File Write Outside Media After a Raster Save T1190 (Exploit Public-Facing Application) Medium. Django workers write to media and temp folders all the time; the correlation anchors on a write to the project root, static folders or site-packages within seconds of an admin or API request touching a RasterField model.

New sitecustomize.py or .pth Files on Django Hosts

The researcher’s described payload placement is sitecustomize.py in the web worker’s current working directory, which is usually the project root and on sys.path, or a .pth file in site-packages; Python imports both automatically at interpreter startup, before any application code. Sweep every GeoDjango host and container image for a sitecustomize.py anywhere under the application directory, and for .pth files in site-packages whose owner is the web server user or whose modification time falls outside a known deployment. Inspect any .pth file containing an import line, since legitimate ones mostly hold plain paths.

Use file integrity monitoring, EDR file inventory, or a simple find over SSH and container exec, and compare against a clean build of the same image. Sweep back to August 4, 2026, when the first of the three related flaws was fixed, since the earlier bugs gave similar file-write primitives. Scope to hosts running django.contrib.gis with RasterField models, then widen to all Django hosts because the check is cheap. Restarting workers does not remove the file and will in fact run it, so preserve and investigate before any redeploy. A sitecustomize.py the team did not write is a compromise and goes straight to incident response; the check generalizes to any Python application where an attacker can write to sys.path.

Hunt Lead Level: 1 (Junior Analyst)

ATT&CK: Persistence → T1546.018 (Event Triggered Execution: Python Startup Hooks)

Sources: “New Django4Shell Vulnerability Enables Django RCE via GeoDjango Form Validation”, The Hacker News, Dec. 2, 2026, https://thehackernews.com/2026/12/new-django4shell-vulnerability-enables.html (source article)

Raster Submissions Naming a Non-Default GDAL Driver

The attacker controls the target path, file content and filename through a crafted JSON raster body submitted to a RasterField, according to Fathy, and Django’s advisory says the trigger is a data definition with a user-controlled name parameter and a non-default driver. In practice that is a POST to a Django admin add or change view (/admin/<app>/<model>/), a ModelForm view or a writable API endpoint, where the RasterField value is a JSON object containing a driver key (EHdr is the one the researcher highlights) and a name key holding a filesystem path, often with directory separators, traversal sequences, or targets such as sitecustomize.py, .pth or a static folder. Build a rule on request bodies to those endpoints that flags JSON raster definitions with a driver other than the in-memory default, and raise severity when name contains a path separator or a Python file extension.

This needs request-body logging on a WAF, reverse proxy or application middleware; Django’s own logs will not show form contents by default. Sweep retained body logs to August 2026. Because staff login is required, pair every hit with the authenticating account and its login source: a staff account submitting rasters from a new IP or right after a password reset is a stronger signal than the payload alone. Disabling the admin entirely is the wrong fix where GIS staff need it; upgrading and keeping RasterField non-editable is the right one. Any hit with a path-like name should be escalated and followed by the file lead above.

Hunt Lead Level: 2 (Pro)

ATT&CK: Initial Access → T1190 (Exploit Public-Facing Application)

Sources: “New Django4Shell Vulnerability Enables Django RCE via GeoDjango Form Validation”, The Hacker News, Dec. 2, 2026 (source article); “Django security releases issued: 6.1.4, 6.0.11, and 5.2.20”, Django Software Foundation, Dec. 2, 2026, https://www.djangoproject.com/weblog/2026/dec/02/security-releases/ (additional source, same vulnerability)

Web Worker File Write Outside Media After a Raster Save

The write itself is performed by GDAL inside the web worker process (gunicorn, uWSGI or runserver), and Fathy notes it happens without any model save or database interaction, so database audit logs will show nothing. A successful exploit therefore appears as the worker process creating or overwriting a file outside the media and temp folders (the project root, a static directory, application source files, configuration files or site-packages) seconds after an inbound request to an endpoint that handles a RasterField model. Correlate EDR or auditd file-creation events by the worker process with web logs for admin or API requests on the same host, and add a third signal when available: a new Python interpreter start (worker fork, reload or cron) that loads the newly written file.

Build it on Linux EDR or auditd file and process events joined to web access logs by host and time. Baseline where the worker normally writes for a week, then alert on anything outside MEDIA_ROOT and the temp directory. Expect noise from collectstatic, migrations and deploy tooling; exclude those by their parent process and deployment window rather than by path, since the attacker targets the same paths. Hash-blocking is useless here because the attacker supplies the file content per attack. A correlated hit is a probable compromise: escalate to incident response, rotate secrets in the environment and settings, and check for overwritten source files as well as new ones.

Hunt Lead Level: 3 (Elite)

ATT&CK: Initial Access → T1190 (Exploit Public-Facing Application); Persistence → T1546.018 (Event Triggered Execution: Python Startup Hooks)

Sources: “New Django4Shell Vulnerability Enables Django RCE via GeoDjango Form Validation”, The Hacker News, Dec. 2, 2026 (source article)

Hash Appendix

CVE-2026-124827 exploitation

No file hashes were published in The Hacker News report or Django’s advisory; written files are attacker-supplied per attack. No lookups in OTX AlienVault or VirusTotal were made for this report.

MD5s

(not available)  # no payload hashes published

SHA1s

(not available)  # no payload hashes published

SHA256s

(not available)  # no payload hashes published

References Appendix

  • “New Django4Shell Vulnerability Enables Django RCE via GeoDjango Form Validation”, The Hacker News (Ravie Lakshmanan), Dec. 2, 2026, https://thehackernews.com/2026/12/new-django4shell-vulnerability-enables.html
  • “Django security releases issued: 6.1.4, 6.0.11, and 5.2.20”, Django Software Foundation, Dec. 2, 2026, https://www.djangoproject.com/weblog/2026/dec/02/security-releases/

CVE at a glance

CVE-2026-124827HighPublic exploitdjangoproject Django
CVSS
8.7 High (v4.0)
EPSS
2.9% chance of exploitation in the next 30 days (higher than 87.3% of CVEs)
Exploited in the wild
Not on CISA’s KEV list
Public exploit
Yes, reported in 7 GitHub repositories

Full CVE details

Data from NVD, FIRST EPSS and CISA KEV, refreshed automatically. We report whether public exploit code exists but never link to it: fake proof-of-concepts that infect researchers are common.

More from the Roundup