Django4Shell (CVE-2026-124827): Analyzing GeoDjango’s RasterField Assignment Vulnerability and the December 2026 Django Security Release

Architectural analysis of Django4Shell (CVE-2026-124827) and the Dec 2, 2026 Django security release (6.1.4, 6.0.11, 5.2.20): how GeoDjango RasterField reached file-backed GDAL drivers, plus CVE-2026-132092 SQLi and hardening.

Django4Shell (CVE-2026-124827) GeoDjango RasterField Security Architecture
🚨
Vulnerability Intelligence: CVE ID: CVE-2026-124827 ("Django4Shell") + 6 Companion Dec 2, 2026 Django CVEs (incl. CVE-2026-132092 Critical SQLi) (CWE-73 External File Path Control, CWE-434 Unrestricted File Write & CWE-89 SQL Injection) Severity: CRITICAL / HIGH (ARBITRARY SERVER-SIDE FILE WRITE IN GEODJANGO & ORM SQL INJECTION) (CVSS High / Critical (GeoDjango RasterField File Write -> RCE & ORM range/in SQL Injection)) Threat Actor: Mohamed K. Fathy (CVE-2026-124827 "Django4Shell") & Django Security Team — Dec 2, 2026 Status: Emergency Security Releases Shipped Dec 2, 2026; Immediate Framework Upgrade Required Affected Systems: Django < 5.2.20, 6.0.x < 6.0.11, and 6.1.x < 6.1.4 (GeoDjango PostGIS RasterField & Core ORM) Fixed In: Django 6.1.4, Django 6.0.11, and Django 5.2.20 (LTS)

On December 2, 2026, the Django Software Foundation released urgent security updates (Django 6.1.4, 6.0.11, and 5.2.20) remediating seven vulnerabilities across GeoDjango, the Django ORM, caching middleware, template truncation filters, and Django Admin. The headline GeoDjango flaw—tracked as CVE-2026-124827 and dubbed "Django4Shell" by researcher Mohamed K. Fathy—closes an incomplete patch lineage stemming from the August 2026 GDAL raster advisories (CVE-2026-15307 and CVE-2026-87890). While those earlier patches restricted raster definitions inside spatial lookups, the model field assignment path on django.contrib.gis.db.models.RasterField remained reachable via default Django Admin panels, ModelForms, and writable model serializers. Because RasterField defaulted to editable=True, fell back to a plain CharField form widget, and forwarded dictionary or JSON raster definitions directly into GDALRaster, untrusted input specifying a non-default file-backed GDAL driver and target path could trigger arbitrary server-side file writes on PostGIS-backed GeoDjango deployments.

Django4Shell (CVE-2026-124827) GeoDjango RasterField Architecture
Figure 1: Architectural overview of Django4Shell (CVE-2026-124827) and the December 2, 2026 Django security suite, illustrating the incomplete patch lineage from CVE-2026-15307, the RasterField -> SpatialProxy -> GDALRaster assignment path, and the defensive controls enforced in Django 6.1.4, 6.0.11, and 5.2.20.

1. Complete Matrix of the December 2, 2026 Django Security Release

Even deployments that do not use GeoDjango or PostGIS must treat this release as urgent because it bundles a Critical ORM SQL Injection (CVE-2026-132092) alongside six additional security fixes:

CVE Identifier Severity Component Technical Summary
CVE-2026-124827
("Django4Shell")
High django.contrib.gis (RasterField) Arbitrary server-side file write (code execution risk) when untrusted dict/JSON raster definitions specifying non-default GDAL drivers are assigned to RasterField (PostGIS only).
CVE-2026-132092 Critical Django ORM (range / in lookups) SQL injection when range or in query lookups operate over query aliases or key transforms containing percent signs (%).
CVE-2026-132809 High django.contrib.gis (OGRGeometry.wkb) Heap buffer overflow during Well-Known Binary (WKB) geometry handling in OGRGeometry.wkb.
CVE-2026-115868 Moderate truncatechars_html / Truncator Cross-Site Scripting (XSS) when truncating HTML strings at specific boundary lengths inside HTML attributes.
CVE-2026-125673 Moderate Cache / Path Normalization Web cache poisoning via dot segments in incoming request paths.
CVE-2026-119642 &
CVE-2026-127929
Moderate django.contrib.admin (Changelist) Information disclosure in Django Admin changelist queries via pk aliases and reverse model relations.

2. Incomplete Patch Lineage: From CVE-2026-15307 to Django4Shell (CVE-2026-124827)

In August 2026, Django patched CVE-2026-15307 (and follow-up CVE-2026-87890), which prevented GeoDjango spatial lookups from forwarding untrusted raster definitions into GDAL’s file-backed drivers. However, organizations that installed those August updates (such as Django 5.2.17 or 6.0.8) remained exposed through a parallel entry point: direct model field assignment on RasterField.

HTTP Request (Django Admin / ModelForm / Writable API Serializer)
         │
         ▼
[1] Form / Serializer binds string or dict to Model.raster_field
    (Previously reachable by default: editable=True, fallback = CharField)
         │
         ▼
[2] django/contrib/gis/db/models/proxy.py :: SpatialProxy.__set__()
    & django/contrib/gis/db/models/fields.py :: RasterField
    ├─► Coerces JSON string / dictionary directly into GDALRaster(value)
    └─► Does NOT restrict the 'driver' key to the in-memory 'MEM' driver!
         │
         ▼
[3] django/contrib/gis/gdal/raster/source.py :: GDALRaster.__init__()
    ├─► Reads 'driver' parameter (non-default file-backed GDAL driver)
    ├─► Reads 'name' parameter (attacker-controlled local filesystem path)
    └─► Invokes GDAL C API (GDALCreate) -> writes raster file directly to disk!
         │
         ▼
[4] Server-Side File Write Impact
    └─► Overwriting writable Python modules (e.g., sitecustomize.py),
        templates, or application scripts can escalate to remote code execution.
🔬
Why RasterField Was Reachable by Default In django/contrib/gis/db/models/fields.py, RasterField.contribute_to_class() attaches a SpatialProxy descriptor wrapping GDALRaster. Because RasterField previously inherited editable=True and lacked a dedicated form widget, it fell back to a standard forms.CharField in Django Admin, ModelForms, and writable model serializers—allowing raw JSON raster configurations to invoke file-backed GDAL drivers instead of the safe in-memory "MEM" driver.

3. Defensive Changes in Django 6.1.4, 6.0.11, and 5.2.20

The December 2, 2026 security patches introduce two decisive behavioral invariants inside GeoDjango’s RasterField pipeline:

  1. editable=False by Default: RasterField now defaults to editable=False, automatically excluding it from Django Admin forms and ModelForms unless a developer explicitly opts back in.
  2. GDALException on Non-Default Drivers: Assigning a dictionary or JSON string specifying any non-default GDAL driver directly to a RasterField now raises a GDALException. Applications that legitimately require file-backed GDAL drivers must explicitly instantiate and pass a trusted GDALRaster(...) object.

Exposure Preconditions for CVE-2026-124827

  • Running Django < 5.2.20, 6.0.x < 6.0.11, or 6.1.x < 6.1.4.
  • Using GeoDjango configured with PostGIS (the only backend supporting RasterField).
  • Exposing a model containing a RasterField via Django Admin, a ModelForm, a writable serializer, or view logic accepting user-controlled input.
  • Having a file-backed GDAL raster driver available with filesystem write permissions.

4. Detection Engineering & Telemetry Rules

1. ModSecurity / Coraza WAF Rules (IDs 950045–950046)

# ColibriSec WAF Rules for Django4Shell (CVE-2026-124827)
SecRule REQUEST_BODY|ARGS \
  "@rx (?i)(?:\"driver\"|'driver')\s*:\s*(?:\"(?!mem\")[^\"\\]{1,32}\"|'(?!mem')[^'\\]{1,32}').{0,500}(?:\"name\"|'name')\s*:\s*[\"'](?:/|\.\./|[a-zA-Z]:\\\\|/vsi)" \
  "id:950045,phase:2,deny,status:403,log,auditlog,t:none,\
msg:'Django4Shell (CVE-2026-124827): GeoDjango RasterField non-MEM GDAL driver with filesystem path',\
tag:'attack-rce',tag:'cve-2026-124827',tag:'django4shell'"

SecRule REQUEST_BODY|ARGS \
  "@rx (?i)(?:\"name\"|'name')\s*:\s*[\"'](?:/|\.\./|[a-zA-Z]:\\\\|/vsi).{0,500}(?:\"driver\"|'driver')\s*:\s*(?:\"(?!mem\")[^\"\\]{1,32}\"|'(?!mem')[^'\\]{1,32}')" \
  "id:950046,phase:2,deny,status:403,log,auditlog,t:none,\
msg:'Django4Shell (CVE-2026-124827): GeoDjango RasterField filesystem path with non-MEM GDAL driver',\
tag:'attack-rce',tag:'cve-2026-124827',tag:'django4shell'"

2. Suricata Network IDS Signature (sid:2026124827)

alert http $EXTERNAL_NET any -> $HOME_NET any (msg:"COLIBRISEC EXPLOIT Django4Shell CVE-2026-124827 GeoDjango RasterField Non-MEM GDAL Driver Assignment"; flow:established,to_server; http.request_body; content:"driver"; nocase; content:"bands"; nocase; pcre:"/"driver"s*:s*"(?!MEM")[^"]{1,32}"/i"; reference:cve,2026-124827; classtype:web-application-attack; sid:2026124827; rev:1;)

3. Sigma Rule: Unexpected Python Runtime / site-packages File Writes

title: Unexpected File Write to Python Source or site-packages by Django Worker (CVE-2026-124827)
id: 7e2a91c4-4b88-41f3-9c12-202612482701
status: experimental
description: Detects gunicorn, uwsgi, daphne, or python web worker processes writing files into Python site-packages, application source directories, or sitecustomize.py.
references:
    - https://colibrisec.org/django4shell-cve-2026-124827-geodjango-rasterfield-security-analysis/
author: James Luther (ColibriSec)
date: 2026-12-02
logsource:
    category: file_event
    product: linux
detection:
    selection_process:
        Image|endswith:
            - '/python'
            - '/python3'
            - '/gunicorn'
            - '/uwsgi'
            - '/daphne'
            - '/uvicorn'
    selection_target:
        TargetFilename|contains:
            - 'site-packages'
            - 'dist-packages'
            - 'sitecustomize.py'
            - 'usercustomize.py'
            - '.pth'
            - '/templates/'
    condition: selection_process and selection_target
level: critical
tags:
    - attack.persistence
    - attack.execution
    - cve.2026.124827

5. Remediation & Hardening Playbook

# 1. Verify current Django version
python3 -m django --version

# 2. Upgrade immediately to December 2, 2026 security releases:
#    Django 6.1.4 | Django 6.0.11 | Django 5.2.20 (LTS)
pip install --upgrade "Django>=5.2.20,<5.3"

# 3. Audit repositories for RasterField / GDALRaster usage
grep -rn "RasterField\|GDALRaster" --include="*.py" .
  • Immutable Runtime Filesystem: Mount Python site-packages and application code read-only (readOnlyRootFilesystem: true in Kubernetes or systemd ProtectSystem=strict) so a file-write primitive cannot modify Python startup hooks or application modules.
  • Explicit Field Allow-Lists: Avoid fields = '__all__' on Django ModelForm and DRF ModelSerializer classes, and explicitly exclude spatial raster fields from public write endpoints.

Read more

ColibriSec Weekly Security Roundup — Week of December 4, 2026 Threat Intelligence Matrix

Security Roundup: CISA KEV Acronis/HFS/TYPO3 Wave, Agentic AI CyberStrikeAI & DoorDash Attacks, TeamCity & HPE CVSS 10.0, Linux 21-Year Netfilter & USB2Shell, Woolworths 14M & Roche 169GB Breaches (Week of December 4, 2026)

Executive Summary: The week of November 28 to December 4, 2026 marks a decisive operational inflection point across enterprise security, kernel engineering, autonomous AI threats, sovereign cyber legislation, and global data breaches. Between November 30 and December 3, the U.S. Cybersecurity and Infrastructure Security Agency (CISA) expanded its Known

By James Luther
CISA KEV Wave: Acronis CVE-2026-87887, Rejetto HFS CVE-2026-61500 & TYPO3 CVE-2026-125160

CISA KEV Nov 30–Dec 3 Wave: Acronis Backup Zero-Day (CVE-2026-87887), Rejetto HFS Math.random() RCE (CVE-2026-61500) & TYPO3 Path Disclosure (CVE-2026-125160)

📌Security Roundup Series: Week of December 4, 2026 • 7 min read deep dive🚨Vulnerability Intelligence: CVE ID: CVE-2026-87887 (Acronis), CVE-2026-61500 (Rejetto HFS) & CVE-2026-125160 (TYPO3) (CWE-863 Incorrect Authorization / CWE-338 Weak PRNG / CWE-209 Error Info Exposure) Severity: CRITICAL (ACTIVE EXPLOITATION IN WILD / MANDATORY CISA KEV BOD 26-04) (CVSS 9.8 Critical

By James Luther
JetBrains TeamCity CVE-2026-136858 and HPE Networking Central COP CVSS 10.0 Architecture

Enterprise CI/CD & Network Control-Plane Criticals: JetBrains TeamCity Build Agent Hijack (CVE-2026-136858) & HPE Networking Central On-Premises CVSS 10.0 SSH Backdoor

📌Security Roundup Series: Week of December 4, 2026 • 7 min read deep dive🚨Vulnerability Intelligence: CVE ID: CVE-2026-136858 (TeamCity) & CVE-2026-137285 / CVE-2026-137286 (HPE Central COP) (CWE-287 Improper Authentication / CWE-798 Use of Hard-coded Credentials) Severity: CRITICAL (TEAMCITY ACTIVELY EXPLOITED < 24H / HPE CVSS 10.0 HARD-CODED SSH) (CVSS 10.0 Critical

By James Luther
Linux Netfilter CVE-2026-139281, USB2Shell CVE-2026-98232 & RongYuan Keyboard Port 3814 Architecture

Linux Kernel & Peripheral Hardware Siege: 21-Year Netfilter IPv6 Firewall Bypass (CVE-2026-139281), USB2Shell (CVE-2026-98232) & 283-Brand RongYuan Keyboard Port 3814 CSWSH RCE

📌Security Roundup Series: Week of December 4, 2026 • 8 min read deep dive🚨Vulnerability Intelligence: CVE ID: CVE-2026-139281 (Linux Netfilter), CVE-2026-98232 (USB2Shell) & RongYuan Port 3814 CSWSH (CWE-681 Integer Truncation / CWE-191 Integer Underflow / CWE-306 Missing Auth & Wildcard CORS) Severity: CRITICAL (21-YEAR FIREWALL BYPASS, PRE-LOGIN KERNEL CORRUPTION & 283-BRAND BROWSER-TO-FIRMWARE

By James Luther