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.
CVE-2026-124827: Server-side file-write via RasterField assignment
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. 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.
CVE-2026-115868: Potential cross-site scripting vulnerability in truncatechars_html
The 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.
CVE-2026-125673: Potential cache poisoning via dot segments in request paths
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.
CVE-2026-119642: Information leakage in admin changelist via "pk" alias for OneToOneField
The 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.
CVE-2026-127929: Information leakage in admin changelist via reverse relations
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.
CVE-2026-132809: Heap buffer overflow in OGRGeometry.wkb
The 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.
CVE-2026-132092: Potential SQL injection in range and in lookups
The 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.
Affected supported versions
- Django main
- Django 6.1
- Django 6.0
- Django 5.2
Resolution
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.
CVE-2026-124827: Server-side file-write via RasterField assignment
- On the main branch
- On the 6.1 branch
- On the 6.0 branch
- On the 5.2 branch
CVE-2026-115868: Potential cross-site scripting vulnerability in truncatechars_html
- On the main branch
- On the 6.1 branch
- On the 6.0 branch
- On the 5.2 branch
CVE-2026-125673: Potential cache poisoning via dot segments in request paths
- On the main branch
- On the 6.1 branch
- On the 6.0 branch
- On the 5.2 branch
CVE-2026-119642: Information leakage in admin changelist via "pk" alias for OneToOneField
- On the main branch
- On the 6.1 branch
- On the 6.0 branch
- On the 5.2 branch
CVE-2026-127929: Information leakage in admin changelist via reverse relations
- On the main branch
- On the 6.1 branch
- On the 6.0 branch
- On the 5.2 branch
CVE-2026-132809: Heap buffer overflow in OGRGeometry.wkb
- On the main branch
- On the 6.1 branch
- On the 6.0 branch
- On the 5.2 branch
CVE-2026-132092: Potential SQL injection in range and in lookups
- On the main branch
- On the 6.1 branch
- On the 6.0 branch
- On the 5.2 branch
The following releases have been issued
- Django 6.1.4 (tarball | checksums)
- Django 6.0.11 (tarball | checksums)
- Django 5.2.20 (tarball | checksums)
The PGP key ID used for this release is Jacob Walls: 131403F4D16D8DC7
General notes regarding security reporting
As always, we ask that potential security issues be reported via private email
to security@djangoproject.com, and not via Django's Trac instance, nor via
the Django Forum. Please see
our security policies for further
information.