Keyrook

Django fixes seven flaws, including a SQL injection and a third GeoDjango file-write patch

Django shipped 6.1.4, 6.0.11 and 5.2.20 on 2 December 2026, fixing seven flaws led by a 9.8 SQL injection and an 8.8 GeoDjango file write. Upgrade now.

The Django logo
Image: Django Software Foundation

Affects

  • Django

Tracked as

  • CVE-2026-132092Django · CVSS 9.8
  • CVE-2026-124827Django, GeoDjango RasterField · CVSS 8.8
  • CVE-2026-115868Django · CVSS 6.1
  • CVE-2026-132809Django, GeoDjango OGRGeometry · CVSS 5.3
  • CVE-2026-125673Django · CVSS 3.7
  • CVE-2026-119642Django admin · CVSS 2.7
  • CVE-2026-127929Django admin · CVSS 2.7

Django has shipped three security releases at once — 6.1.4, 6.0.11 and 5.2.20 — closing seven flaws the project disclosed on 2 December 2026. Two are rated high, and one of them is the third patch in four months for the same GeoDjango code path. Anyone running Django should upgrade in the next deployment; projects that use GeoDjango raster fields should treat it as urgent.

  • 7Flaws fixed
  • 9.8Highest NVD score
  • 2Rated high by Django
  • 3Supported series patched

The SQL injection: CVE-2026-132092, scored 9.8

The most severe flaw sits in the ORM itself. Django’s range and in lookups could be turned into SQL injection when a query involved aliases or key transforms containing percent signs. The range case needed more than two values on the right-hand side; the in case needed a two-sided transform. Both conditions are narrow, but the result of hitting them is database code running with the application’s own privileges.

The fix tightens the range lookup so it accepts exactly two right-hand-side values. Django notes that percent signs in column aliases and key transforms were already deprecated in Django 6.0 and are scheduled for removal in Django 2028 — a sign that this corner of the query builder is being closed for good.

Django4Shell: CVE-2026-124827, scored 8.8

The second high-severity flaw is the one researchers have dubbed Django4Shell. It lives in GeoDjango, the mapping extension that ships with Django, in the RasterField model field used to store raster images in PostGIS.

Assigning a raster definition to a RasterField with a user-controlled name and a non-default GDAL driver could make GDAL write a file to a location chosen by the attacker. Depending on the driver, that write can become code execution on the server. The researcher’s write-up describes the chain ending with a startup file dropped where Python reads it at launch.

What makes this flaw dangerous in practice is how easily it is reached. RasterField falls back to an ordinary text form field, so the Django admin, model forms and writable serializers all accept a raster definition as text by default. The file is created while Django validates the form, before anything is saved. Geometry fields such as PointField are not affected, and RasterField only exists on PostGIS — so most Django projects are untouched, but GeoDjango projects with raster fields are exposed.

The fix changes RasterField in two ways: it now defaults to not editable, so it no longer appears in model forms unless explicitly included, and assigning a dictionary or JSON string that names a non-default driver now raises an error. Trusted raster values should be wrapped in GDALRaster to show they are intentional. Django also warns that request forgery is still possible if untrusted input is assigned to the field, so raster input needs validation before it reaches the model.

The third fix for the same GDAL path

  1. 4 Aug 2026

    CVE-2026-15307 fixed in spatial lookups

    Django stopped spatial lookups passing raster definitions to GDAL, but left model field assignment open.

  2. Oct 2026

    CVE-2026-87890 patched the same area

    A second fix for the raster code path, which also proved incomplete.

  3. 2 Dec 2026

    CVE-2026-124827 closes the assignment path

    The December release finally covers the route the August fix deliberately left open.

The other five flaws

The remaining five are lower severity, but two deserve attention from anyone running the affected features:

  • CVE-2026-115868 (6.1): a cross-site scripting flaw in the truncatechars_html template filter and the Truncator.chars() method with HTML enabled. It triggers when input text happens to be exactly the truncation length and the result is rendered inside an HTML attribute.
  • CVE-2026-125673 (3.7): a cache poisoning flaw. The cache middleware and the cache_page decorator relied on a URL builder that stripped . and .. segments from request paths, so cached responses could be served for the wrong addresses. After upgrading, clear any caches that may hold poisoned entries — the fix does not invalidate them.
  • CVE-2026-132809 (5.3): a heap buffer overflow in OGRGeometry.wkb for geometries larger than 4GB on 64-bit systems, which could crash the process. The hex and geos properties and pickling were affected too.
  • CVE-2026-119642 (2.7): the admin changelist let staff users with view permission enumerate data from models whose custom OneToOneField is the primary key, by putting the pk alias in the query string. Models using multi-table inheritance were affected by default.
  • CVE-2026-127929 (2.7): a similar admin changelist leak through reverse relations, a variant of a flaw first fixed in 2010 that came back in Django 5.0.3.

The seven flaws by NVD score

02.557.510CVE-2026-1320929.8CVE-2026-1248278.8CVE-2026-1158686.1CVE-2026-1328095.3CVE-2026-1256733.7CVE-2026-1196422.7CVE-2026-1279292.7 02.557.510CVE-2026-1320929.8CVE-2026-1248278.8CVE-2026-1158686.1CVE-2026-1328095.3CVE-2026-1256733.7CVE-2026-1196422.7CVE-2026-1279292.7
Source: NVD · in CVSS
The numbers
CVSSNVD score
CVE-2026-1320929.8
CVE-2026-1248278.8
CVE-2026-1158686.1
CVE-2026-1328095.3
CVE-2026-1256733.7
CVE-2026-1196422.7
CVE-2026-1279292.7

How to update

Update Django

  1. Check your version

    Run python -m django --version to see which supported series you are on: 6.1, 6.0 or 5.2.

  2. Install the patched release

    Upgrade to 6.1.4, 6.0.11 or 5.2.20 to match your series, for example pip install -U "Django==6.1.4", then deploy as usual.

  3. Clear affected caches

    If you use Django’s cache middleware or cache_page, clear caches that may hold poisoned entries from CVE-2026-125673.

  4. Review GeoDjango forms

    If you use RasterField, check which forms and serializers accept raster definitions, and wrap trusted values in GDALRaster.

The patches are also applied to Django’s main branch. Older unsupported series such as 5.1, 5.0 and 4.2 were not evaluated and may still be affected; the only supported route is to move to a patched release.

Sources

  1. Django security releases issued: 6.1.4, 6.0.11, and 5.2.20Django
  2. Django4Shell (CVE-2026-124827): GeoDjango RCE FlawOrca Security

More news

All the news
  1. Patch Notes2 min

    TeamCity flaw lets attackers hijack build agents without logging in: update now

    JetBrains disclosed CVE-2026-136858 on 3 December 2026, a critical TeamCity flaw rated 9.1 that lets an attacker with no login pose as a build agent. Update to 2026.1.7, 2026.2.3 or 2026.3.

    • JetBrains TeamCity
  2. Patch Notes3 min

    Two Veeam backup console flaws are now being exploited: update to 9.3 now

    Canada's Cyber Centre said on 2 December 2026 that attackers are now exploiting two critical Veeam Service Provider Console flaws, CVE-2026-58073 and CVE-2026-58072. Upgrade to 9.3.0.35057 and check the logs.

    • Veeam Service Provider Console
  3. Patch Notes2 min

    LimeSurvey: expired password reset keys still allow account takeover — no patch yet

    Two LimeSurvey flaws disclosed on 2 December: an expired password reset key can still be used to take over an account without signing in, and a survey participant data leak. Only the second has a patch.

    • LimeSurvey