On the December 2026 security release cycle, the Django maintainers shipped versions 6.1.4, 6.0.11, and 5.2.20 to address seven security vulnerabilities — headlined by CVE-2026-124827, a critical flaw carrying a CVSS score of 9.0 that can enable unauthenticated remote code execution. The vulnerability was codenamed "Django4Shell" by Mohamed K. Fathy, head of cybersecurity at Robusta Technology Group, and — critically for defenders — it represents an incomplete fix, meaning a previously patched code path was bypassed.
If you operate Django applications that use GeoDjango (the django.contrib.gis framework) with exposed form validation, you should treat this as an emergency patch event. Django is one of the most widely deployed Python web frameworks on the planet — it underpins everything from SaaS platforms and financial services to government portals and healthcare applications. A CVSS 9.0 unauthenticated RCE in a framework component is precisely the class of vulnerability that gets weaponized within days of disclosure, and the "incomplete fix" designation tells us researchers already understand this code path well enough to find bypasses quickly.
This post breaks down what we know, how to hunt for exploitation, and how to remediate.
Technical Analysis
Affected Products and Versions
| Component | Detail |
|---|---|
| Framework | Django (Python web framework) |
| Vulnerable component | GeoDjango (django.contrib.gis) form validation |
| Patched versions | 6.1.4, 6.0.11, 5.2.20 |
| CVE | CVE-2026-124827 |
| CVSS | 9.0 (Critical) |
| Authentication required | None — remotely exploitable without credentials |
| Codename | Django4Shell (Mohamed K. Fathy, Robusta Technology Group) |
Any Django deployment on a release line older than these fixed versions that exposes GeoDjango form validation should be considered vulnerable until patched. Note that the fix was backported across three release trains (6.1.x, 6.0.x, 5.2.x) — this is standard Django security practice and means supported extended-support branches received the fix as well. If you are running an end-of-life Django branch (anything older than 5.2), you will not receive a patch and must upgrade.
How the Vulnerability Works — Defender's View
Based on the disclosure, the flaw lives in GeoDjango's form validation logic. Form validation in a web framework is a pre-authentication attack surface by design: validators accept and process untrusted user input to determine whether it conforms to expected formats (in this case, geospatial data such as geometry fields, coordinate input, or WKT/GeoJSON-style values passed through GIS form fields).
The critical facts for defenders:
-
Pre-authentication reachability. Form validation executes before any auth check on a public form endpoint. An attacker needs nothing more than network access to a view that processes GeoDjango form fields.
-
Code execution outcome. The CVSS 9.0 rating and the "4Shell" naming indicate the validation path can be coerced into executing attacker-controlled code — meaning crafted input submitted to a GIS form field results in command or code execution in the context of the Django worker process (typically
gunicorn,uwsgi,daphne, or the WSGI worker under Apache/Nginx). -
Incomplete fix lineage. This is the most operationally important detail. An incomplete fix means a prior patch for this code path was bypassed. That implies (a) the vulnerable code path is well understood by the research community, (b) proof-of-concept development against the bypass tends to be fast because prior PoCs can be adapted, and (c) you should verify you are running the new fixed version even if you believe you patched the earlier related issue. "We patched that GeoDjango bug last cycle" is not a valid assumption.
Exploitation Status
At the time of this writing, the vulnerability has been publicly disclosed and codenamed by the security community. The combination of a catchy codename, a named researcher, a CVSS 9.0 score, and the "incomplete fix" framing is a reliable leading indicator that PoC development and mass scanning will follow rapidly. Historically, critical pre-auth RCEs in ubiquitous frameworks move from disclosure to in-the-wild scanning in under a week. Defenders should operate on the assumption that exploitation attempts are imminent or already occurring against internet-facing Django GIS endpoints, and should check CISA KEV and the Django project's security page for updates over the coming days.
Detection & Response
The most reliable post-exploitation signal for a web-framework RCE is behavioral: the web server worker process spawning a shell or interpreter child process. This is technology-agnostic, high-fidelity, and catches exploitation regardless of the exact payload delivered. The following detections target that behavioral chain plus suspicious request patterns against GeoDjango form endpoints.
Sigma Rules
---
title: Django Web Worker Spawning Shell or Interpreter
id: 3f9a1c74-2b8e-4d51-a9c6-7e2b4d8f0a13
status: experimental
description: Detects Django application server processes (gunicorn, uwsgi, daphne, manage.py) spawning shell or scripting interpreters, indicative of successful exploitation of a web framework RCE such as CVE-2026-124827 (Django4Shell).
references:
- https://thehackernews.com/2026/12/new-django4shell-vulnerability-enables.html
- https://attack.mitre.org/techniques/T1059/
author: Security Arsenal
date: 2026/12/03
tags:
- attack.execution
- attack.t1059
- attack.initial_access
- attack.t1190
logsource:
category: process_creation
product: linux
detection:
selection_parent:
ParentImage|endswith:
- '/gunicorn'
- '/uwsgi'
- '/daphne'
- '/python'
- '/python3'
- '/runserver'
selection_child:
Image|endswith:
- '/sh'
- '/bash'
- '/dash'
- '/zsh'
- '/curl'
- '/wget'
- '/nc'
- '/ncat'
- '/python'
- '/python3'
- '/perl'
- '/base64'
- '/id'
- '/whoami'
condition: selection_parent and selection_child
falsepositives:
- Django management commands invoked via subprocess in legitimate application code
- Health check scripts executed by orchestrators under the app user
level: high
---
title: Suspicious HTTP Requests Targeting GeoDjango Form Endpoints
id: 8b2e5d91-4c7a-4f36-b1d8-9a3c6e0f5b27
status: experimental
description: Detects web requests containing shell metacharacters, template injection markers, or encoded payloads in parameters sent to Django GIS/geospatial form endpoints, consistent with probing or exploitation of CVE-2026-124827.
references:
- https://thehackernews.com/2026/12/new-django4shell-vulnerability-enables.html
- https://attack.mitre.org/techniques/T1190/
author: Security Arsenal
date: 2026/12/03
tags:
- attack.initial_access
- attack.t1190
logsource:
category: webserver
product: linux
detection:
selection_path:
cs-uri-query|contains:
- 'geometry'
- 'geom'
- 'point'
- 'polygon'
- 'wkt'
- 'geojson'
selection_payload:
cs-uri-query|contains:
- '%3B'
- '%7C'
- '%60'
- '%24%28'
- ';id;'
- '|id'
- '$(id'
- '`id`'
- '__import__'
- 'os.system'
- 'subprocess'
- '/bin/sh'
- '/bin/bash'
- 'bash+-i'
condition: all of selection_*
falsepositives:
- Unlikely; legitimate geospatial form input does not contain shell metacharacters or Python import strings
level: high
---
title: Django Application Server Writing Executable Files to Temp Directories
id: 5c1d8e42-7a3b-4e92-a6f1-2d9b7c4e8a56
status: experimental
description: Detects Django worker processes or their web server parents writing executable content to world-writable temp paths, a common post-exploitation staging behavior following web framework RCE such as CVE-2026-124827.
references:
- https://thehackernews.com/2026/12/new-django4shell-vulnerability-enables.html
- https://attack.mitre.org/techniques/T1105/
author: Security Arsenal
date: 2026/12/03
tags:
- attack.command_and_control
- attack.t1105
- attack.persistence
logsource:
category: file_event
product: linux
detection:
selection_path:
TargetFilename|startswith:
- '/tmp/'
- '/var/tmp/'
- '/dev/shm/'
selection_user:
User|contains:
- 'www-data'
- 'nginx'
- 'apache'
- 'django'
- 'gunicorn'
- 'uwsgi'
filter_ext:
TargetFilename|endswith:
- '.log'
- '.sock'
- '.pid'
- '.tmp'
condition: selection_path and selection_user and not filter_ext
falsepositives:
- Application-level file upload features storing to temp before processing
- Legitimate cache writers (typically limited to known extensions, filtered above)
level: medium
KQL — Microsoft Sentinel / Defender
The following queries assume Linux syslog/auditd ingestion via the Syslog or CommonSecurityLog tables (standard for Defender for Endpoint on Linux, AMA-based syslog, or WAF/front-proxy logs forwarded to Sentinel). The first hunts process lineage; the second hunts suspicious request patterns in web proxy or WAF logs.
// Hunt 1: Django web worker spawning shells or download/recon tooling
// Requires Syslog (auditd EXECVE) or DeviceProcessEvents for Linux endpoints
Syslog
| where TimeGenerated > ago(7d)
| where Facility =~ "user" or SourceIP has ""
| extend Message = tostring(SyslogMessage)
| where Message has_any ("gunicorn", "uwsgi", "daphne", "runserver")
and Message has_any ("/bin/sh", "/bin/bash", "curl ", "wget ", "nc -", "ncat", "base64 -d", "whoami", "os.system", "subprocess")
| project TimeGenerated, Computer, ProcessName, Message, HostIP
| order by TimeGenerated desc;
// Hunt 2: Process lineage via Defender for Endpoint (Linux devices onboarded to MDE)
DeviceProcessEvents
| where TimeGenerated > ago(7d)
| where InitiatingProcessFileName has_any ("gunicorn", "uwsgi", "daphne", "python", "python3")
| where FileName in~ ("sh", "bash", "dash", "curl", "wget", "nc", "ncat", "perl", "base64")
| project TimeGenerated, DeviceName, InitiatingProcessFileName, InitiatingProcessCommandLine,
FileName, ProcessCommandLine, AccountName
| order by TimeGenerated desc;
// Hunt 3: Suspicious requests against GeoDjango form endpoints in proxy/WAF logs (CEF ingestion)
CommonSecurityLog
| where TimeGenerated > ago(7d)
| where RequestURL has_any ("geometry", "geom", "geojson", "wkt")
| where RequestURL has_any ("%3B", "%7C", "%60", "%24%28", "__import__", "os.system", "subprocess", "/bin/sh", "/bin/bash")
| summarize RequestCount = count(), FirstSeen = min(TimeGenerated), LastSeen = max(TimeGenerated)
by SourceIP, RequestURL, RequestMethod, DeviceAction
| order by RequestCount desc;
Velociraptor VQL
For live-fleet hunting on suspected Django hosts, this artifact surfaces web-worker process trees with suspicious children and recently dropped files in temp directories owned by the application user — the two highest-value forensic pivots after a suspected web RCE.
-- Django4Shell (CVE-2026-124827) post-exploitation hunt:
-- 1) Web worker processes with shell/tool children
-- 2) Recently created files in temp paths owned by the app user
SELECT Pid, Ppid, Name, Exe, CommandLine, Username, CreateTime
FROM pslist()
WHERE (
CommandLine =~ 'gunicorn|uwsgi|daphne|manage\\.py|runserver'
OR Exe =~ 'gunicorn|uwsgi|daphne'
)
AND (
CommandLine =~ '/bin/(ba)?sh|curl |wget |nc |ncat |base64'
OR Username =~ 'www-data|nginx|apache|django|gunicorn'
)
-- Second pass: staged payloads in world-writable dirs
SELECT FullPath, Size, Mtime, Ctime,
stat(FullPath).Uid AS Uid,
stat(FullPath).Gid AS Gid
FROM glob(globs=['/tmp/*', '/var/tmp/*', '/dev/shm/*'])
WHERE Mtime > now() - 86400 * 3
AND NOT FullPath =~ '\\.(log|sock|pid|tmp|lock)$'
ORDER BY Mtime DESC
Remediation / Verification Script
Run this on application hosts and build agents to enumerate installed Django versions across virtualenvs and flag anything below the fixed releases. It also greps running services so you know which units to restart after upgrade — a step teams routinely forget, leaving the old vulnerable code resident in memory.
#!/usr/bin/env bash
# CVE-2026-124827 (Django4Shell) — Django version audit and patch verification
# Fixed versions: 6.1.4, 6.0.11, 5.2.20
set -euo pipefail
echo "=== [1/4] Locating Django installations across virtualenvs and system site-packages ==="
VULN_FOUND=0
is_vulnerable() {
local ver="$1"
local major minor patch
IFS='.' read -r major minor patch <<<"$ver"
# Fixed floors per release line
case "$major.$minor" in
6.1) [ "$patch" -lt 4 ] && return 0 ;;
6.0) [ "$patch" -lt 11 ] && return 0 ;;
5.2) [ "$patch" -lt 20 ] && return 0 ;;
*) return 0 ;; # Any other release line: EOL or unknown -> treat as vulnerable
esac
return 1
}
for pip in $(find /opt /srv /home /usr/local /var/www -maxdepth 6 -type f -name pip3 2>/dev/null | sort -u) $(command -v pip3); do
ver=$("$pip" show django 2>/dev/null | awk '/^Version:/{print $2}' || true)
[ -z "$ver" ] && continue
if is_vulnerable "$ver"; then
echo "[VULNERABLE] $pip -> Django $ver (below fixed floor)"
VULN_FOUND=1
else
echo "[OK] $pip -> Django $ver"
fi
done
echo "=== [2/4] Checking whether GeoDjango (django.contrib.gis) is enabled ==="
grep -rsl "django.contrib.gis" /opt /srv /home /var/www --include="settings.py" 2>/dev/null | while read -r f; do
echo "[GeoDjango ENABLED] $f — this app is in the CVE-2026-124827 attack surface"
done
echo "=== [3/4] Identifying running Django application services ==="
systemctl list-units --type=service --state=running 2>/dev/null | grep -Ei 'gunicorn|uwsgi|daphne|django' || echo "No systemd-managed Django services found (check containers/processes manually)"
ps -eo user,pid,cmd | grep -E 'gunicorn|uwsgi|daphne' | grep -v grep || true
echo "=== [4/4] Summary ==="
if [ "$VULN_FOUND" -eq 1 ]; then
echo "ACTION REQUIRED: Upgrade Django to 6.1.4 / 6.0.11 / 5.2.20 (per your release line):"
echo " pip install --upgrade 'Django>=5.2.20,<5.3' # adjust pin to your release line"
echo "Then RESTART all application services — the vulnerable code stays resident until workers recycle."
else
echo "No vulnerable Django versions detected in scanned environments. Verify containers and remote hosts separately."
fi
Remediation
-
Patch immediately. Upgrade to Django 6.1.4, 6.0.11, or 5.2.20 depending on your release line. Pin explicitly in
requirements.txt/lockfiles (e.g.Django==5.2.20) and redeploy. Official release and advisory details are published at the Django project: https://www.djangoproject.com/weblog/ — review all seven fixes in this release, as several accompany the critical CVE. -
Restart every worker. A package upgrade does nothing until the application processes are recycled. Restart
gunicorn/uwsgi/daphneservices, redeploy containers with fresh images, and verify the running process reports the new version (pip show djangofrom inside the live environment — not the build environment). -
Treat "we patched the earlier GeoDjango issue" as unverified. CVE-2026-124827 is an incomplete fix — a bypass of a prior patch. Audit your version against the December 2026 release specifically, not against whatever you installed earlier in the year.
-
Reduce exposure while patching (workarounds). If you cannot patch within hours:
- At the WAF/reverse proxy, block or restrict POST bodies containing shell metacharacters and Python import/subprocess strings sent to endpoints handling geospatial form fields (this is a temporary compensating control, not a fix).
- If
django.contrib.gisform functionality is not business-critical on internet-facing apps, disable or gate those endpoints behind authentication until patched. - Ensure Django apps are not running as root and that the app user has no write access outside designated upload/media paths — this blunts post-exploitation impact.
-
Hunt before and after patching. Run the Sigma/KQL/VQL content above over at least the trailing 7–30 days. Given the disclosure dynamics of named, critical framework RCEs, assume scanning began at disclosure. Any web-worker child-shell hit is a P1 incident: isolate the host, capture memory/disk, and review outbound connections from the app user.
-
Verify EOL branches. Django releases older than 5.2 did not receive this fix. If you find them in your estate, the remediation is an upgrade project, not a patch — escalate accordingly.
-
Monitor for KEV inclusion and PoC publication. Watch the CISA Known Exploited Vulnerabilities catalog and the Django security archive over the coming days. KEV listing will trigger mandated remediation deadlines for federal environments and is a reliable signal for everyone else to accelerate.
Related Resources
Security Arsenal Penetration Testing Services AlertMonitor Platform Book a SOC Assessment vulnerability-management Intel Hub
Is your security operations ready?
Get a free SOC assessment or see how AlertMonitor cuts through alert noise with automated triage.