Django 6.1.4, 6.0.11, and 5.2.20 fix 7 CVEs including RCE risk
Django issued security updates 6.1.4, 6.0.11, and 5.2.20 on Dec 2, fixing seven CVEs including high-severity RasterField file-write and SQL injection bugs.
By Dillip Chowdary • Dec 02, 2026 • Source: Django Weblog

At a glance
- Patched versions
- Django 6.1.4, 6.0.11, 5.2.20
- High CVEs
- CVE-2026-124827 & CVE-2026-132092
- Moderate CVE
- CVE-2026-115868 (truncatechars_html)
- Low CVEs
- 4 flaws (cache, admin, OGRGeometry)
- Affected branches
- main, 6.1, 6.0, 5.2
In this post
The Django Software Foundation released security updates 6.1.4, 6.0.11, and 5.2.20 on December 2, 2026, patching seven vulnerabilities across the main, 6.1, 6.0, and 5.2 branches, according to the Django Weblog advisory.
Release manager Jacob Walls urged all Django users to upgrade immediately, noting two high-severity vulnerabilities—arbitrary server-side file writes via PostGIS RasterField and SQL injection in ORM range and in lookups—alongside one moderate cross-site scripting flaw and four low-severity issues.
01High-severity RasterField file-write and SQL injection fixes
In CVE-2026-124827 (reported by Mohammed Fathy), assigning a raster data definition with a user-controlled name parameter and a non-default driver to django.contrib.gis.db.models.RasterField could cause GDAL to write a file to an attacker-chosen path and, depending on the raster driver, achieve remote code execution. Because RasterField fell back to CharField for forms, PostGIS-backed models registered in Django Admin, ModelForm classes, or writable model serializers were reachable by default; geometry fields were unaffected.
Django's fix sets RasterField.editable=False by default—omitting it from ModelForm unless explicitly included—and raises GDALException whenever a dictionary or JSON string specifies a non-default driver. Applications needing non-default drivers must wrap trusted inputs in GDALRaster, and teams must still validate untrusted inputs because server-side request forgery remains possible.
02High-severity SQL injection in range and in lookups
The second high-severity bug, CVE-2026-132092 (reported by Cristian Panaro), addressed potential SQL injection in __range and __in lookups involving column aliases or key transforms containing percent signs (%). Exploiting __range required passing more than two right-hand-side values, while __in required a bilateral transform; __range now requires strictly two right-hand-side values, and percent signs in aliases and transforms remain deprecated since Django 6.0 ahead of removal in Django 2028.
Advertisement
Tech Pulse Daily
Get tomorrow's pulse first
Join engineers who read Tech Pulse before stand-up. Free, weekday mornings.
03Moderate XSS and low-severity admin, cache, and GDAL bugs
| CVE ID | Severity | Affected component | Key remediation |
|---|---|---|---|
| CVE-2026-124827 | High | RasterField (PostGIS) | Sets editable=False; blocks untrusted non-default drivers |
| CVE-2026-132092 | High | __range / __in lookups | Enforces two values on __range; blocks transform SQLi |
| CVE-2026-115868 | Moderate | truncatechars_html / Truncator | Fixes attribute XSS when text length matches limit |
| CVE-2026-125673 | Low | build_absolute_uri() | Preserves . and .. path segments to block cache poisoning |
| CVE-2026-119642 | Low | Admin changelist (OneToOneField) | Blocks staff enumeration via pk querystring alias |
| CVE-2026-127929 | Low | Admin changelist (reverse FK) | Fixes Django 5.0.3 regression (reported by OpenAI) |
| CVE-2026-132809 | Low | OGRGeometry.wkb (64-bit) | Fixes undersized buffer allocation on >4GB geometries |
04Details behind the template, admin, cache, and GDAL fixes
Under CVE-2026-115868 (reported by JoeCyberTech), the truncatechars_html template filter and django.utils.text.Truncator.chars(html=True) could expose applications to cross-site scripting when inputs whose text length matched the exact truncation limit were processed and rendered inside an HTML attribute. Under CVE-2026-125673 (reported by 4drez), UpdateCacheMiddleware and @cache_page suffered from incorrect path normalization of . and .. segments in HttpRequest.build_absolute_uri(), potentially serving cached responses for unintended URLs under certain deployment configurations.
Two low-severity admin changelist bugs extended historical CVE-2010-4534 protections: CVE-2026-119642 (also reported by JoeCyberTech) prevented staff users with view permissions from enumerating records via the pk querystring alias on models using a custom OneToOneField primary key or multi-table inheritance—provided they knew related field names—while CVE-2026-127929 (reported by OpenAI) fixed a reverse-relation and related_query_name enumeration regression introduced in Django 5.0.3. Meanwhile, CVE-2026-132809 (reported by Zhixi "Jace" Sun) resolved an undersized 64-bit buffer allocation in OGRGeometry.wkb, hex, geos, and pickling for geometries exceeding 4 GB that could trigger segmentation faults.
05Release verification, cache clearing, and reporting policy
The Django Software Foundation published tarballs and checksums for Django 6.1.4, Django 6.0.11, and Django 5.2.20 signed with release manager Jacob Walls's PGP key (131403F4D16D8DC7). Deployments using UpdateCacheMiddleware or @cache_page should note that patching CVE-2026-125673 updates HttpRequest.build_absolute_uri() to preserve dot segments when called without a location, but does not invalidate existing cached entries—administrators must clear potentially affected caches manually after upgrading.
Apps that intentionally expose RasterField in admin screens, ModelForms, or serializers must opt back in explicitly (editable=True) and wrap trusted data in GDALRaster after validating drivers and paths. Developers should pin Django==6.1.4, 6.0.11, or 5.2.20 immediately and report future vulnerabilities privately to security@djangoproject.com rather than Trac or the Django Forum.
Frequently asked questions
What is the highest-risk vulnerability fixed in Django 6.1.4, 6.0.11, and 5.2.20?
CVE-2026-124827 is a high-severity flaw where assigning a raster definition with a user-controlled name and non-default GDAL driver to RasterField could write arbitrary server files or trigger remote code execution.
What changed in RasterField after the CVE-2026-124827 patch?
RasterField now sets editable=False by default (excluding it from ModelForms unless explicitly added) and raises GDALException when assigning a dict or JSON string with a non-default driver unless wrapped in GDALRaster.
How does CVE-2026-132092 affect Django ORM queries?
CVE-2026-132092 is a high-severity potential SQL injection in __range and __in lookups involving aliases or bilateral key transforms containing percent signs; __range now strictly enforces two right-hand-side values.
Should teams clear caches after upgrading Django?
Yes. Because the fix for CVE-2026-125673 (dot-segment cache poisoning in build_absolute_uri) does not invalidate old entries, Django recommends clearing potentially affected caches after upgrading.
Sources
Author
Dillip Chowdary
Writes Tech Bytes coverage of AI, engineering, and the tools that actually ship. Editor of Tech Pulse Daily.
Related on Tech Bytes
Advertisement