TL;DR
The Django Project shipped a major Django security release on December 2, 2026, fixing seven bugs in versions 6.1.4, 6.0.11, and 5.2.20. The top fix closes the Django4Shell RCE vulnerability (CVE-2026-124827, CVSS 9.0) in GeoDjango’s RasterField. It also patches a high-risk SQL injection bug (CVE-2026-132092). Therefore, Python web teams must upgrade right away.
- Total: 7 CVEs
- Severity: 1 Critical · 1 High · 5 Medium
- Actively exploited: None confirmed
- Highest severity: 9.8 (Critical · CVSSv3) — CVE-2026-132092
- Action: Apply the latest security updates now
Notable CVEs
| CVE | CVSS (CVSSv3) | Type | Fixed in | Status |
|---|---|---|---|---|
| CVE-2026-132092 | 9.8 | Potential SQL injection in range and in lookups | 6.1.4, 6.0.11, 5.2.20 | Not exploited |
| CVE-2026-124827 | 8.8 | Server-side file-write via RasterField assignment | 6.1.4, 6.0.11, 5.2.20 | Not exploited |
| CVE-2026-115868 | 6.1 | Potential cross-site scripting in truncatechars_html | 6.1.4, 6.0.11, 5.2.20 | Not exploited |
| CVE-2026-132809 | 5.3 | Heap buffer overflow in OGRGeometry.wkb | 6.1.4, 6.0.11, 5.2.20 | Not exploited |
| CVE-2026-125673 | 3.7 | Potential cache poisoning via dot segments in request paths | 6.1.4, 6.0.11, 5.2.20 | Not exploited |
| CVE-2026-119642 | 2.7 | Information leakage in admin changelist via "pk" alias for OneToOneField | 6.1.4, 6.0.11, 5.2.20 | Not exploited |
| CVE-2026-127929 | 2.7 | Information leakage in admin changelist via reverse relations | 6.1.4, 6.0.11, 5.2.20 | Not exploited |
Why It Matters
Millions of web apps, APIs, and CMS tools like Wagtail and Django CMS run on Django. Many GeoDjango apps expose models in Django Admin or auto-built forms. Because of that, a file-write bug inside form checks gives staff users a direct path to server takeover. Researcher Mohammed Fathy at Robusta Technology Group found the bug and named it Django4Shell.
In its Django security release notice, the Django team states, “We encourage all users of Django to upgrade as soon as possible.” At press time, Django confirms no live attacks in the wild. Likewise, no public weaponized exploit code is out yet. Still, the Django4Shell research portal maps out the full attack flow. Clear bug notes make fixing this Django4Shell RCE vulnerability urgent.
How the Attack Works
Django4Shell: Bypassing RasterField Guards (CVE-2026-124827)
Earlier in Django 6.1.2, maintainers locked down QuerySet lookups against bad raster paths (CVE-2026-87890) via check_raster_lookup_value(). However, Fathy found that this guard never runs during ModelForm input checks. The Django4Shell site notes, “That guard never executes on the RasterField assignment path-allowing a staff user to write sitecustomize.py via GDAL’s EHdr driver during form.is_valid(), before model.save() is ever called.”
In Django forms, RasterField falls back to a plain CharField. Thus, a staff user can send a crafted JSON raster string with a custom file name and non-default driver. During form checks, SpatialProxy.__get__ sends that raw JSON straight to GDALRaster(). Next, GDAL’s standard EHdr driver writes raw Python bytes to disk as the web user. No PostGIS table is even needed. Once sitecustomize.py sits in a writable path, Python auto-runs it on the next worker start.
Django warns, “Assigning a raster data definition to django.contrib.gis.db.models.RasterField with a user-controlled name parameter and a non-default driver could cause GDAL to write a file to an attacker-controlled location.” To fix this, Django 6.1.4 sets editable=False on RasterField by default. It also raises GDALException for non-default drivers unless apps wrap the input in a trusted GDALRaster object. Note that SSRF risks still remain if apps pass untrusted input to RasterField.
Six Additional SQLi, XSS, Cache, and Info-Leak Flaws
Beyond Django4Shell, the Django security release closes six more bugs. First, CVE-2026-132092 (High) allows SQL injection in range and in lookups when queries use percent signs in aliases or key transforms. Second, CVE-2026-115868 (Moderate) allows XSS in truncatechars_html and Truncator.chars() when input length matches the cutoff inside an HTML tag attribute.
Next, four low-risk fixes close cache and data leak bugs. Specifically, CVE-2026-125673 stops cache poisoning from dot segments in build_absolute_uri(). Meanwhile, CVE-2026-119642 and CVE-2026-127929 fix admin changelist data leaks via pk aliases and reverse links. Finally, CVE-2026-132809 fixes a heap buffer overflow in OGRGeometry.wkb for geometries over 4GB on 64-bit hosts.
Affected Versions
- Django 6.1: Versions prior to 6.1.4.
- Django 6.0: Versions prior to 6.0.11.
- Django 5.2 LTS: Versions prior to 5.2.20.
- End-of-Life Branches: Django 4.2 and earlier are past end of support and receive no fixes.
Patch and Mitigation Steps
Teams should upgrade right away to Django 6.1.4, 6.0.11, or 5.2.20. After you patch, clear any web caches that may hold bad entries from CVE-2026-125673. Also, check every model that uses RasterField and validate all user input before building GDALRaster objects. Finally, keep app code folders read-only for web workers to block this Django4Shell RCE vulnerability.
Support Our Threat Intelligence
Find our vulnerability reports and weekly recaps helpful? Support our work today and unlock a 100% ad-free reading experience!