Django Fixes Raster File Write And SQL Injection
Django fixed seven flaws across raster input, ORM queries, templates, caches, admin views and geometry code. Upgrade and retest each path.
The Django project released 6.1.4, 6.0.11 and 5.2.20 on December 2 to fix seven security issues. The two high-severity flaws affect GeoDjango raster assignment and unusual ORM lookup construction: one can write an attacker-chosen server file and may lead to code execution depending on the GDAL driver, while the other can produce SQL injection through aliases or key transforms containing percent signs under specific `range` or `in` conditions.
The same release also repairs HTML truncation XSS, cache poisoning through dot segments, two staff-only admin enumeration paths and a very-large-geometry buffer overflow. These are separate boundaries with different prerequisites, not one attack chain. Upgrade every supported branch, clear potentially affected caches, inspect applications that expose raster, custom query, HTML attribute or admin search paths, and retain application-specific validation because Django explicitly says the raster fix does not remove SSRF risk from untrusted raster input.
Key Takeaways
- check_circle The fixed releases are Django 6.1.4, 6.0.11 and 5.2.20 across all currently supported branches.
- check_circle CVE-2026-124827 affects PostGIS `RasterField`, not geometry fields, and requires a user-controlled raster definition with a `name` and non-default driver.
- check_circle The raster patch blocks the documented server-side file-write path, but Django warns that assigning untrusted raster input can still cause server-side requests.
- check_circle CVE-2026-132092 needs unusual aliases or key transforms containing percent signs plus malformed `range` values or a bilateral `in` transform.
- check_circle The cache fix does not invalidate responses already stored under affected path handling, so some deployments need an explicit cache clear after upgrading.
- check_circle Django's announcement does not report exploitation, victims or a campaign; patch priority should follow reachable application paths rather than headline severity alone.
Seven Fixes Landed Across Three Supported Branches
Django issued 6.1.4, 6.0.11 and 5.2.20 on December 2. The project rates CVE-2026-124827 and CVE-2026-132092 High, CVE-2026-115868 Moderate, and the remaining four issues Low under its security policy. Main, 6.1, 6.0 and the 5.2 long-term-support branch received patches. Deployments on unsupported branches need a supported upgrade path rather than a local version string that merely looks close.
The release spans six kinds of boundary: geospatial raster input, ORM query construction, HTML rendering, cache-key routing, admin data visibility and geometry serialization. A single dependency scanner finding therefore cannot describe practical reachability. One application may not install GeoDjango at all; another may expose `RasterField` through a writable serializer; a third may rely heavily on full-page caching or custom bilateral transforms.
Inventory the running package from the process environment, container image or deployed lock file. Record Django version, Python environment, database backend, PostGIS and GDAL use, cache backend, admin exposure and custom query or template code. Then move each supported branch to its fixed patch release and rebuild immutable artifacts so the verified dependency is the one production actually loads.
Raster Assignment Could Reach The Server Filesystem
CVE-2026-124827 begins when an application assigns a raster data definition to a GeoDjango `RasterField` with a user-controlled `name` and a non-default GDAL driver. GDAL can use the name as an output destination. Under the affected behavior, that could write a file to an attacker-chosen location and, depending on the available driver, file contents, path permissions and surrounding application, could enable remote code execution.
The path was more reachable than a hand-written GDAL import alone. `RasterField` fell back to the normal `CharField` form behavior, so a registered model could expose it through Django admin, a `ModelForm` or a writable model serializer. The field exists only on PostGIS, and Django says geometry fields were not affected. Those constraints should drive the search: find model definitions, generated forms, admin registrations and serializers that accept raster values from users or staff.
The patch makes `RasterField` non-editable by default and rejects dictionary or JSON-string assignment that selects a non-default driver. Trusted code that needs another driver must wrap the definition in `GDALRaster`. Django also gives a crucial residual warning: the change limits server-side file writes but does not stop server-side request forgery when untrusted input still reaches `RasterField`. Applications must validate or reject such definitions rather than treating the framework patch as a complete trust policy.
The SQL Injection Requires Specific Query Construction
CVE-2026-132092 affects `range` and `in` lookups when a query uses aliases or key transforms containing percent signs. The `range` path also requires incorrectly supplying more than two right-hand-side values. The `in` path requires a bilateral transform, which applies transformation logic to both sides of the lookup. Django now requires exactly two values for `range` and repairs the unsafe formatting behavior.
This is not a claim that normal `field__range=(start, end)` or a routine `field__in=[...]` query is injectable. Review code that constructs annotations, aliases, transforms or lookup names dynamically, especially database-specific JSON or key transforms and third-party fields. Search for percent signs in aliases and custom `Transform` implementations with `bilateral = True`, then trace whether an untrusted value can reach the lookup list or alias.
Django deprecated percent signs in column aliases and key transforms in 6.0 and plans to remove that support in Django 2028. After updating, replace those names rather than relying on the repaired legacy behavior indefinitely. Add regression tests that submit extra `range` operands, hostile lookup values and expected bilateral transformations, and assert both the result and generated query parameters without logging real sensitive inputs.
Rendering And Cache Paths Need Separate Cleanup
CVE-2026-115868 affects the `truncatechars_html` template filter and `Truncator.chars()` with `html=True`. Certain inputs whose text length exactly matched the truncation length could produce unsafe output when that result was placed in an HTML attribute. The flaw is Moderate, but reachability depends on both the truncation call and the attribute context. Inventory uses in templates and server-side rendering helpers, then test attacker-controlled strings at the configured boundary length.
CVE-2026-125673 affects `UpdateCacheMiddleware` and the `cache_page()` decorator. `build_absolute_uri()` incorrectly normalized request paths containing `.` or `..`, which could make an unauthenticated request populate a response under an unintended cache relationship in certain URL and deployment configurations. The fixed function preserves dot segments when called without a location.
The project says existing cached responses are not invalidated by the code update. After deploying, clear affected application or edge-cache entries where dot-segment requests could have reached Django's cache middleware or decorator. Also test the full proxy path because a CDN, load balancer or web server may normalize dot segments before Django sees them. Compare cache keys and responses for ordinary, encoded and dot-segment variants without assuming every layer treats the path identically.
Admin Enumeration And Geometry Overflow Are Narrower
CVE-2026-119642 allowed a staff user with view permission on a registered model to enumerate related data through repeated admin changelist searches using the `pk` alias when a `OneToOneField` was the primary key. Multi-table inheritance was affected by default because its implicit parent link is a one-to-one primary key. Exploitation requires authenticated staff access and enough knowledge of the related model fields.
CVE-2026-127929 is a related changelist enumeration path through reverse relations. It requires a staff user with model view permission and knowledge of related model names or custom `related_query_name` values. It is a regression of a class of restriction added after CVE-2010-4534. Review view-only staff roles, admin exposure and repeated lookup-error or filter requests, but do not describe either issue as an unauthenticated internet data dump.
CVE-2026-132809 affects `OGRGeometry.wkb` on 64-bit platforms when a geometry exceeds 4GB. An undersized buffer could cause a segmentation fault or undefined behavior; the `hex` and `geos` properties and pickling were also affected. The size and code-path requirements make it a different operational problem from the raster write. Services that ingest or construct extremely large geometries should apply input and resource limits in addition to the framework update.
Upgrade, Retest Reachable Paths And Scope Evidence
Deploy 6.1.4, 6.0.11 or 5.2.20 through the application's normal dependency workflow. Rebuild containers and serverless bundles, restart long-running workers, and verify `django.get_version()` or equivalent runtime evidence from each production unit. Run migrations and system checks according to the application's release procedure, then execute focused tests for raster forms and serializers, custom lookups, truncated HTML attributes, cache keys, admin filters and large geometry handling.
The Django announcement reviewed here does not report exploitation. If the application exposed one of the paths, preserve request, application, database, cache, admin and filesystem telemetry for the vulnerable window. For raster exposure, inspect unexpected file creation, outbound requests and GDAL errors. For query exposure, review database errors and unusual lookup shapes. For XSS, use content-security-policy reports and affected page logs. For admin paths, correlate repeated filters with staff sessions and authorization changes.
Match response to evidence. A vulnerable package with no reachable feature calls for prompt patching and recorded validation. A suspicious file write, hostile database query, poisoned private response or staff enumeration requires path-specific incident handling and downstream scoping. Keep the seven issues separate in the incident record so a clean check for one path does not close the others and so a GeoDjango finding does not become an unsupported claim about every Django application.
Checklist
- Upgrade supported deployments to Django 6.1.4, 6.0.11 or 5.2.20 and verify the version from every running process image.
- Inventory PostGIS `RasterField` models exposed through admin, forms or writable serializers and reject untrusted raster definitions.
- Find percent signs in aliases or key transforms, bilateral transforms and malformed `range` construction, then add negative query tests.
- Audit `truncatechars_html` and `Truncator.chars(html=True)` outputs used inside HTML attributes.
- Clear potentially affected caches and test path handling across the CDN, proxy, web server and Django layers.
- Review view-only admin roles and logs for repeated changelist filters against one-to-one primary keys or reverse relations.
- Preserve path-specific evidence and investigate confirmed file, query, cache, browser or admin anomalies without combining the CVEs into one chain.
Sources
- Django December 2 security release announcement open_in_new
- Django 6.1.4 release notes open_in_new
- Django 6.0.11 release notes open_in_new
- Django 5.2.20 release notes open_in_new
- Django GDAL API and trusted-input guidance open_in_new
- Django security policies and severity process open_in_new
- Django supported versions and downloads open_in_new
Continue Reading
Acronis Backup Plugin Flaw Is Under Targeted Attack
Acronis says attackers exploited its cPanel backup plugin. Fix exact builds, handle 1.9.4 carefully, preserve evidence and scope exposure.
WatchGuard Endpoint Update Fixes 35 Windows Flaws
WatchGuard fixed 35 Windows endpoint flaws across network parsers, kernel drivers and agent trust. Verify both protection and agent versions.
KARTE Breach Puts Data And Connector Keys In Scope
PLAID's KARTE breach exposed client data and integration credentials. Map every feed, revoke connectors, preserve notices and rebuild trust.