| published by | Jacob Walls |
|---|---|
| in blog | The Django weblog |
| published date | 2026-12-02 |
| original entry | Django security releases issued: 6.1.4, 6.0.11, and 5.2.20 |
In accordance with our security release policy, the Django team is issuing releases for Django 6.1.4, Django 6.0.11, and Django 5.2.20. These releases address the security issues detailed below. We encourage all users of Django to upgrade as soon as possible.
RasterField assignmentAssigning 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. Depending on the raster driver, this could enable remote code execution. Because RasterField falls back to the
CharField form field, the flaw was reachable by default on models with RasterField registered in the admin or using ModelForms or writable model serializers.
RasterField now defaults editable to False, excluding it from a ModelForm unless explicitly included. RasterField also now raises GDALException when assigning a dict or JSON string specifying a non-default driver. To use other drivers, wrap the definition in GDALRaster to signify the value is trusted. This exception only limits server-side file writes. Server-side request forgery is still possible if untrusted input is assigned to RasterField. See raster security considerations and implement validation before accepting untrusted input.
Geometry fields were not affected. RasterField is only implemented on PostGIS.
This issue has severity "high" according to the Django security policy.
Thanks to Mohammed Fathy for the report.
truncatechars_htmlThe truncatechars_html template filter and the django.utils.text.Truncator.chars()
method (with html=True) were subject to a potential cross-site scripting (XSS) attack
when certain inputs whose text length matched the truncation length were processed
and rendered in an HTML attribute.
This issue has severity "moderate" according to the Django security policy.
Thanks to JoeCyberTech for the report.
django.middleware.cache.UpdateCacheMiddleware and
django.views.decorators.cache.cache_page() were affected by a bug in
django.http.HttpRequest.build_absolute_uri(), which incorrectly
normalized request paths containing . or .. segments. Under certain
deployment and URL configurations, this could allow an unauthenticated attacker
to cause cached responses to be served for unintended URLs.
django.http.HttpRequest.build_absolute_uri() now preserves dot segments
in the request path when called without a location. Existing cached responses
are not invalidated, so users should clear any potentially affected caches
after upgrading.
This issue has severity "low" according to the Django security policy.
Thanks to 4drez for the report.
OneToOneFieldThe admin changelist allowed staff users with view permissions on a registered
model with a custom django.db.models.OneToOneField primary key to
enumerate data from those models by including the pk alias in the
querystring and performing repeated lookup searches. This requires sufficient
knowledge of the fields on the related model. It is a special case of
CVE-2010-4534.
Models using multi-table inheritance were affected by default, as the implicit
primary key field created by Django is a OneToOneField.
This issue has severity "low" according to the Django security policy.
Thanks to JoeCyberTech for the report.
The admin changelist allowed staff users with view permissions on a registered
model to enumerate values on those models via manipulating the querystring to
perform repeated lookup searches. This requires knowledge of the related model
names or django.db.models.ForeignKey.related_query_name overrides. It
is a special case of CVE-2010-4534 that regressed in Django 5.0.3.
This issue has severity "low" according to the Django security policy.
Thanks to OpenAI for the report.
OGRGeometry.wkbThe django.contrib.gis.gdal.OGRGeometry.wkb property allocated an undersized buffer for geometries larger than 4GB on 64-bit platforms. This could result in segmentation faults or undefined behavior. The hex and geos properties of OGRGeometry and its pickling were also affected.
This issue has severity "low" according to the Django security policy.
Thanks to Zhixi "Jace" Sun for the report.
range and in lookupsThe range and in lookups were subject to SQL injection in
queries involving aliases or key transforms containing percent signs. The
__range flaw required incorrectly using more than two right-hand side
values. The __in flaw required a bilateral transform.
The range lookup now requires exactly two right-hand side values.
Note that using percent signs in column aliases and key transforms was deprecated in Django 6.0 and is scheduled for removal in Django 2028.
This issue has severity "high" according to the Django security policy.
Thanks to Cristian Panaro for the report.
Patches to resolve the issue have been applied to Django's main, 6.1, 6.0, and 5.2 branches. The patches may be obtained from the following changesets.
RasterField assignmenttruncatechars_htmlOneToOneFieldOGRGeometry.wkbrange and in lookupsThe PGP key ID used for this release is Jacob Walls: 131403F4D16D8DC7
As always, we ask that potential security issues be reported via private email
to [email protected], and not via Django's Trac instance, nor via
the Django Forum. Please see
our security policies for further
information.