Threat reportVulnerabilityTL-2026-7295
Django4shell (CVE-2026-124827) - Django RCE via GeoDjango RasterField Form Validation
CVE-2026-124827 ("Django4shell", CVSS 9.0 per press; rated High by the Django project) lets a staff-level user make GDAL write attacker-controlled files via the GeoDjango RasterField assignment path, enabling potential remote code execution. It is an incomplete fix of CVE-2026-87890 and was patched in Django 6.1.4, 6.0.11 and 5.2.20.
Key facts
| Identifiers | TL-2026-7295, CVE-2026-124827, CVE-2026-87890, CVE-2026-15307, CVE-2026-132092, CVE-2026-115868, CVE-2026-125673, CVE-2026-119642, CVE-2026-127929, CVE-2026-132809 |
|---|---|
| Also known as | Django4shell |
| Severity | CRITICAL |
| CVSS | 9 |
| First disclosed | |
| EPSS | CVE-2026-15307: 1.1% (65.5th percentile); CVE-2026-87890: 0.2% (21.3th percentile) |
| Affected products | Django Software Foundation Django (django.contrib.gis / GeoDjango RasterField) |
| Weaknesses (CWE) | CWE-73 |
| Malware | Django, Python |
| Tools | GDAL (EHdr driver) |
| MITRE ATT&CK techniques | T1059.006 Python, T1078 Valid Accounts, T1190 Exploit Public-Facing Application, T1505.003 Web Shell, T1546.018 Python Startup Hooks, T1552.001 Credentials In Files, T1565.001 Stored Data Manipulation |
| Motivation | UNKNOWN |
| Target sectors | technology, government administration, finance, health, education |
| Target regions | Global |
| Detection rules | 9 (1 shown free) |
| Sources | 8 cited sources |
Detection coverage
As of 2026-12-02, Threadlinqs Intelligence publishes 9 detection rule(s) for TL-2026-7295 across Splunk SPL, Microsoft KQL and Sigma, covering 17 indicator(s) of compromise. The whole corpus is readable without an account. Every threat comes with one complete detection in Splunk SPL, Microsoft KQL and Sigma, free for everyone; a free account adds daily TL Creds to unlock the rest. Paid plans add a larger daily allowance, correlation and the MCP server. Threadlinqs MCP server · View plans.
Free detection: Django4shell CVE-2026-124827 - GDAL EHdr Arbitrary File Write Artifacts by Web Worker: Startup Hooks, Web Shells, Source/Config Tampering (Splunk)
Detects the file-write outcomes of CVE-2026-124827 (Django4shell), where a staff user makes GDAL (EHdr driver) write attacker-controlled files via a GeoDjango RasterField. Fires when a web-service account creates or modifies sitecustomize.py/usercustomize.py/.pth Python startup hooks (T1546.018), script files in static/media directories (web shells, T1505.003), Django settings/wsgi/asgi/urls/manage.py/.env files (T1565.001), or GDAL EHdr sidecar files (.hdr/.bil/.flt) outside media/tmp. A worker account should essentially never write these. No network IOCs are published, so detection is behaviour-based.
- Languages: Splunk SPL, Microsoft KQL, Sigma
- ATT&CK: T1190, T1546.018, T1505.003, T1565.001, T1059.006
- Data sources: sysmon_for_linux, DeviceFileEvents, linux_file_event
- Severity: critical
- Confidence: high
Splunk SPL
index=linux sourcetype="sysmon:linux" EventCode=11 earliest=-24h User IN ("www-data","apache","nginx","django","gunicorn") ```CVE-2026-124827 Django4shell: GDAL EHdr arbitrary file write artifacts - Python startup hooks, web shells, source/config tampering``` | eval path=lower(TargetFilename), fname=replace(lower(TargetFilename),"^.*/","") | eval hook=if(in(fname,"sitecustomize.py","usercustomize.py") OR like(fname,"%.pth"),1,0), shell=if(match(path,"/(static|staticfiles|media)/.*[.](py|php|phtml|jsp|jspx|sh|pl|cgi)$"),1,0), cfg=if(match(path,"/(settings|local_settings|wsgi|asgi|urls|manage)[.]py$") OR match(path,"/[.]env$"),1,0), gdal=if(match(path,"[.](hdr|bil|flt)$") AND NOT match(path,"/(media|tmp)/"),1,0) | where hook=1 OR shell=1 OR cfg=1 OR gdal=1 | eval artifact=case(hook=1,"python_startup_hook",shell=1,"web_shell_candidate",cfg=1,"app_config_tamper",true(),"gdal_ehdr_sidecar") | stats count min(_time) as first_seen max(_time) as last_seen values(Image) as writer by host, User, artifact, TargetFilename | convert ctime(first_seen) ctime(last_seen)Microsoft KQL
DeviceFileEvents
| where Timestamp > ago(24h)
| where ActionType in ("FileCreated", "FileModified", "FileRenamed")
| where InitiatingProcessAccountName in~ ("www-data", "apache", "nginx", "django", "gunicorn")
| extend Path = tolower(FolderPath), Fname = tolower(FileName)
| extend Artifact = case(
Fname in ("sitecustomize.py", "usercustomize.py") or Fname endswith ".pth", "python_startup_hook",
Path matches regex @"/(static|staticfiles|media)/" and Fname matches regex @"[.](py|php|phtml|jsp|jspx|sh|pl|cgi)$", "web_shell_candidate",
Fname in ("settings.py", "local_settings.py", "wsgi.py", "asgi.py", "urls.py", "manage.py", ".env"), "app_config_tamper",
Fname matches regex @"[.](hdr|bil|flt)$" and not(Path matches regex @"/(media|tmp)/"), "gdal_ehdr_sidecar",
"")
| where Artifact != ""
| project Timestamp, DeviceName, Artifact, ActionType, FolderPath, FileName, InitiatingProcessAccountName, InitiatingProcessFileName, InitiatingProcessCommandLine, SHA256Sigma
title: Django4shell CVE-2026-124827 GDAL Arbitrary File Write Artifacts by Web Worker Account
id: 7c1e5a52-3b0d-4f6e-9a41-0d6f2b7a1001
status: experimental
description: Detects Python startup hooks (sitecustomize.py, usercustomize.py, .pth), script files in static/media directories, Django settings/wsgi/asgi/urls/manage.py/.env files, or GDAL EHdr sidecar files written by a web service account, the post-write outcomes described for the Django4shell GeoDjango RasterField arbitrary file write.
references:
- https://www.djangoproject.com/weblog/2026/dec/02/security-releases/
- https://thehackernews.com/2026/12/new-django4shell-vulnerability-enables.html
author: Threadlinqs Team
date: 2026-12-02
modified: 2026-12-02
tags:
- attack.persistence
- attack.t1546.018
- attack.t1505.003
- attack.impact
- attack.t1565.001
- attack.execution
- attack.t1059.006
- attack.initial-access
- attack.t1190
- cve.2026.124827
logsource:
product: linux
category: file_event
detection:
selection_user:
User:
- 'www-data'
- 'apache'
- 'nginx'
- 'django'
- 'gunicorn'
selection_hook:
TargetFilename|endswith:
- '/sitecustomize.py'
- '/usercustomize.py'
- '.pth'
selection_static_dir:
TargetFilename|contains:
- '/static/'
- '/staticfiles/'
- '/media/'
selection_script_ext:
TargetFilename|endswith:
- '.py'
- '.php'
- '.phtml'
- '.jsp'
- '.jspx'
- '.sh'
- '.pl'
- '.cgi'
selection_config:
TargetFilename|endswith:
- '/settings.py'
- '/local_settings.py'
- '/wsgi.py'
- '/asgi.py'
- '/urls.py'
- '/manage.py'
- '/.env'
selection_gdal:
TargetFilename|endswith:
- '.hdr'
- '.bil'
- '.flt'
filter_gdal_benign:
TargetFilename|contains:
- '/media/'
- '/tmp/'
condition: selection_user and (selection_hook or (selection_static_dir and selection_script_ext) or selection_config or (selection_gdal and not filter_gdal_benign))
falsepositives:
- Deployments, collectstatic runs or package installs executed under the web service account
- Applications that legitimately accept script uploads into media directories
level: criticalKnown false positives:
- Package installs or deployments that run as the web service account and legitimately add .pth files to site-packages
- collectstatic or deployment jobs running as the web service account writing scripts under static directories
- Intentional sitecustomize.py in a managed Python environment (e.g. APM agents)
Tuning notes: Replace the User list with the real web-worker accounts. Allow-list deployment paths, CI accounts and APM-agent hooks. Run workers with read-only source, static and site-packages directories so any hit is high-fidelity. Requires Sysmon for Linux FileCreate (EventCode 11) covering the project root, site-packages and static dirs.
- Django4shell CVE-2026-124827 - GDAL EHdr Arbitrary File Write Artifacts by Web Worker: Startup Hooks, Web Shells, Source/Config Tampering (Sentinel KQL) · unlock with TL Creds
- Django4shell CVE-2026-124827 - Staff Admin POST Carrying GDAL EHdr Raster Driver Payload (Sentinel KQL) · unlock with TL Creds
- Django4shell CVE-2026-124827 - Django Worker Spawning Shell/Download Tool, Reading Secrets or Making Metadata/Shell Egress (Sentinel KQL) · unlock with TL Creds
- Django4shell CVE-2026-124827 - GDAL EHdr Arbitrary File Write Artifacts by Web Worker: Startup Hooks, Web Shells, Source/Config Tampering (Sigma) · unlock with TL Creds
- Django4shell CVE-2026-124827 - Staff Admin POST Carrying GDAL EHdr Raster Driver Payload (Sigma) · unlock with TL Creds
- Django4shell CVE-2026-124827 - Django Worker Spawning Shell/Download Tool, Reading Secrets or Making Metadata/Shell Egress (Sigma) · unlock with TL Creds
- Django4shell CVE-2026-124827 - Staff Admin POST Carrying GDAL EHdr Raster Driver Payload (Splunk) · unlock with TL Creds
- Django4shell CVE-2026-124827 - Django Worker Spawning Shell/Download Tool, Reading Secrets or Making Metadata/Shell Egress (Splunk) · unlock with TL Creds
Indicators of compromise
As of 2026-12-02, Threadlinqs Intelligence tracks 17 indicators of compromise for TL-2026-7295.
Sample indicators (3 of 17)
- File hash:
a3934abd4c0d43430efec34d6ae933794df2c2f5 - File hash:
b70d098878ae1a65fa2377be776610500ff44336 - File hash:
6b5d29eae050ac7cf72cc5a407d2094ad8e83789
Defanged, TLP:CLEAR. Full set of 17 indicators: unlock with TL Creds.
Technical analysis
CVE-2026-124827, branded "Django4shell" and reported by Mohamed K. Fathy (Robusta Technology Group), affects django.contrib.gis (GeoDjango). Assigning a user-controlled raster definition to a RasterField together with a non-default GDAL driver allows GDAL to write files to attacker-chosen locations. The attacker controls target path, file content and filename through a crafted JSON raster body supplied in a user-controlled name parameter. The flaw is an incomplete fix of CVE-2026-87890: the earlier protections (requiring raster values passed as bytes to be wrapped in GDALRaster for spatial lookups) did not extend to the RasterField assignment path. No database interaction or model.save() call is needed.
Preconditions per the researcher: django.contrib.gis with a model using RasterField; the RasterField exposed via a ModelForm or the default admin (RasterField falls back to the CharField form field); GDAL with the EHdr driver available (near-universal); a writable target path such as the project root on sys.path; and, as the primary requirement, staff-level authentication. Described post-write techniques: dropping sitecustomize.py into the worker's current working directory (imported by Python at startup), dropping .pth files into site-packages, overwriting application source, dropping web shells into static directories, and corrupting configuration. Payloads would fire on runserver reload, gunicorn worker fork, a manage.py cron job or subprocess execution, running as the web server's OS user, with access to secrets and environment variables and potential pivoting into the host or network.
The vulnerability sits in a chain of GeoDjango raster-handling issues: CVE-2026-15307 (CVSS 8.8, spatial lookups opened dict/JSON raster input in write mode, fixed in Django 5.2.17 and 6.0.8, August 2026) was incompletely fixed, followed by CVE-2026-87890 (SSRF via crafted GDAL VRT bytes in spatial lookups, published 2026-10-06, fixed in 6.1.2, 6.0.9, 5.2.18), followed by CVE-2026-124827. The Django fix makes RasterField default to editable=False and raises GDALException for non-default drivers unless the value is wrapped in GDALRaster; the project warns SSRF remains possible with untrusted input, so untrusted input must be validated. The same security release (2026-12-02) fixed seven issues, including 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), and low-severity admin enumeration and OGRGeometry buffer issues.
Exploitation in the wild is not stated in any source reviewed, and no threat actor, malware family, network IOC or hash has been published. The django4shell.com project page could not be read beyond its title ("Critical RCE in Django 6.1.2 GeoDjango RasterField"), so public PoC status is unverified. IOCs below are behavioral/file artifacts derived from the described exploitation techniques.
MITRE ATT&CK techniques by tactic:
Execution
Initial Access
T1078 Valid Accounts; T1190 Exploit Public-Facing Application
Persistence
T1505.003 Web Shell; T1546.018 Python Startup Hooks
Credential Access
T1552.001 Credentials In Files
Impact
Remediation
Patches
- Django 6.1.4
- Django 6.0.11
- Django 5.2.20
Immediate actions
- Upgrade Django to 6.1.4, 6.0.11 or 5.2.20
- Restrict staff/admin access to trusted users and enforce MFA on the Django admin
- Audit application working directories and site-packages for unexpected sitecustomize.py and .pth files
- After upgrading, clear caches that may hold poisoned entries (CVE-2026-125673)
Workarounds
- Do not expose RasterField via ModelForm or the default admin to untrusted users (the patched RasterField defaults editable to False)
- Wrap raster values in GDALRaster; non-default drivers raise GDALException after the fix
- No official workaround beyond upgrading is listed by the Django project
Longer-term hardening
- Run Django workers as a low-privileged user with read-only application source, static and site-packages directories
- Validate all untrusted input before it reaches GeoDjango raster handling; SSRF remains possible with untrusted raster input
- Monitor file integrity on the project root, site-packages and static directories
- Review whether django.contrib.gis RasterField is exposed through ModelForms or the default admin
Affected and fixed versions
- Django Software Foundation — Django (django.contrib.gis / GeoDjango RasterField)
Vulnerable versions: 6.1 before 6.1.4; 6.0 before 6.0.11; 5.2 before 5.2.20; main branch before patch
Fixed in: 6.1.4; 6.0.11; 5.2.20
Timeline
Last updated · revalidated 1× · latest source
- CVE-2026-15307 (GeoDjango spatial lookup raster parsing, file write / potential RCE, CVSS 8.8) addressed in Django 5.2.17 and 6.0.8 (August 2026; day not stated in sources reviewed).
- CVE-2026-87890 (SSRF via crafted GDAL VRT bytes in spatial lookups, incomplete fix for CVE-2026-15307) published; fixed in Django 6.1.2, 6.0.9 and 5.2.18.
- Cyber Security News covers Django4Shell and reports no confirmed in-the-wild exploitation.
- NVD record created (Deferred) with CVSS 3.1 8.8 (AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H), CVSS 4.0 8.7 and CWE-73; NVD notes earlier unsupported Django series were not evaluated and may also be affected.
- No in-the-wild exploitation, threat actor, malware or network IOCs reported in sources reviewed on the disclosure date.
- django4shell.com project page titled "Critical RCE in Django 6.1.2 GeoDjango RasterField" referenced by press coverage; contents/PoC status not verified.
- Researcher Mohamed K. Fathy's findings publicised as "Django4shell" (CVE-2026-124827, CVSS 9.0), an incomplete fix of CVE-2026-87890; The Hacker News reports the exploitation paths.
- Django 6.1.4, 6.0.11 and 5.2.20 released, fixing seven vulnerabilities including CVE-2026-124827 (RasterField arbitrary file write, rated High) and CVE-2026-132092 (SQL injection in range/in lookups).
Update history
- 2026-12-02 — Django4Shell (CVE-2026-124827): GeoDjango RasterField server-side file write enabling potential RCE: What changed No field escalations. Exploitability stays THEORETICAL (no ITW exploitation or public PoC stated). New indicators (9) Indicator values are withheld at this access level.
Sources cited
- Django security releases (Dec 2, 2026) djangoproject.com · Advisory · 2026-12-02
- NVD - CVE-2026-15307 NVD (NIST) · Advisory
- Red Hat - CVE-2026-87890 access.redhat.com · Advisory
- Red Hat Bugzilla 2511095 - CVE-2026-15307 Remote code execution via GeoDjango spatial lookups bugzilla.redhat.com · Advisory
- Django4shell project page django4shell.com · Research
- Django 5.2.17 release notes docs.djangoproject.com · Vendor report
- stack.watch - CVE-2026-87890 Django Remote Request via VRT in Spatial Lookups stack.watch · Research · 2026-10-06
- The Hacker News - New Django4Shell Vulnerability Enables Django RCE via GeoDjango Form Validation The Hacker News · News · 2026-12-02
Previous and next in vulnerability
AI-drafted from 8 cited sources; published ; last updated .