Skip to content
Stacklumen is now RelpilotSee the list here

Django fixes seven security flaws, two rated high: update to 6.1.4, 6.0.11 or 5.2.20

Django's 2 December security releases fix seven issues, including a GeoDjango file write and a SQL injection in the range and in lookups. Here is what changed and what to do.

Stacklumen blog card: 'Django fixes seven flaws. Two are rated high.' A large figure 7 for the security issues fixed on 2 December, a list of the two high CVEs and the moderate one with four more rated low, and the fixed versions 6.1.4, 6.0.11 and 5.2.20.
On this page
  1. The two high issues
  2. The moderate issue
  3. The four low issues
  4. Which versions are supported
  5. What it means for your site
  6. Sources

The Django project released Django 6.1.4, 6.0.11 and 5.2.20 on 2 December 2026. Together they fix seven security issues. The project rates two of them high, one moderate and four low, and asks everyone running Django to upgrade as soon as possible.

This comes a month after November's releases, which fixed six issues. If a client site, an internal tool or an API you look after runs on Django, plan this update now. One of the high issues sits in GeoDjango, but the other is in the ORM's range and in lookups, and the cache fix asks you to clear your caches after upgrading.

The two high issues

File writes through RasterField (CVE-2026-124827). In GeoDjango, assigning a raster definition to a RasterField with a user-controlled name and a non-default driver could make GDAL write a file to a location the attacker chooses. Depending on the driver, the project says this could lead to remote code execution. Because RasterField falls back to a plain text form field, the flaw was reachable by default wherever the field was registered in the admin or used through ModelForms or writable model serializers.

RasterField now defaults to editable=False, so it is left out of a ModelForm unless you include it. It also refuses a dict or JSON string that names a non-default driver. To use another driver, wrap the definition in GDALRaster to mark it as trusted. The project notes that this only stops file writes: server-side request forgery is still possible if untrusted input reaches RasterField, so validate that input first. Geometry fields are not affected, and RasterField exists only on PostGIS.

SQL injection in range and in lookups (CVE-2026-132092). The range and in lookups could be used for SQL injection in queries with aliases or key transforms that contain percent signs. The range case needed more than two right-hand values, which is incorrect use, and the in case needed a bilateral transform. The range lookup now requires exactly two values. Percent signs in column aliases and key transforms were already deprecated in Django 6.0.

The moderate issue

Cross-site scripting in truncatechars_html (CVE-2026-115868). The truncatechars_html template filter, and Truncator.chars() with html=True, could produce an XSS issue when the input's text length matched the truncation length and the result was rendered inside an HTML attribute.

The four low issues

  • Cache poisoning through dot segments (CVE-2026-125673). UpdateCacheMiddleware and cache_page() relied on build_absolute_uri(), which wrongly normalised paths containing . or ... Under some deployments and URL setups, an unauthenticated attacker could get cached responses served for the wrong URL. The fix does not clear existing cache entries, so the project says to clear any cache that may be affected after you upgrade.
  • Admin data leak through the pk alias (CVE-2026-119642). Staff with view permission could enumerate data on models whose primary key is a custom OneToOneField, by using pk in the changelist query string. Models using multi-table inheritance were affected by default.
  • Admin data leak through reverse relations (CVE-2026-127929). Staff with view permission could enumerate values by adding lookups on related models to the changelist query string. The project says this regressed in Django 5.0.3.
  • Heap buffer overflow in OGRGeometry.wkb (CVE-2026-132809). On 64-bit systems, geometries larger than 4 GB got an undersized buffer, which could crash the process. The hex and geos properties and pickling were also affected.

Which versions are supported

Django's download page lists three supported series:

  • 6.1, now at 6.1.4, with extended support until December 2027.
  • 6.0, now at 6.0.11, on security fixes until April 2027.
  • 5.2 LTS, now at 5.2.20, on security fixes until April 2028.

A site on any older series, including 4.2 LTS, gets none of these fixes.

What it means for your site

  • Find your Django sites. Check each project's requirements or lock file, then move to 6.1.4, 6.0.11 or 5.2.20, whichever matches the series you are on.
  • Clear your caches after upgrading if a site uses UpdateCacheMiddleware or cache_page().
  • Treat GeoDjango sites as the priority. If a model with a RasterField is in the admin, a ModelForm or a writable serializer, upgrade first, and check whether any user input can reach that field.
  • Check templates that truncate HTML. If truncatechars_html output ends up inside an attribute, the upgrade closes the XSS issue.
  • Plan a move off unsupported versions. If anything still runs Django 5.1 or older, it is not receiving security fixes.

Sources

New posts by email

Product updates and field notes from Relpilot, in one email a day or one a week.

How often