Django Security Update: 6.1.4, 6.0.11 and 5.2.20 Fix SQL Injection and a RasterField File Write

Published
Last updated
7 min read
Table of contents
Django security update December 2026 graphic: Django 6.1.4, 6.0.11 and 5.2.20 fix CVE-2026-132092 and CVE-2026-124827

Introduction

The December 2026 Django security update fixes seven vulnerabilities in every supported Django series. The Django team released 6.1.4, 6.0.11 and 5.2.20 on December 2, 2026. Two issues are rated “high” by Django: a SQL injection in the range and in lookups (CVE-2026-132092) and a server-side file write through RasterField (CVE-2026-124827).

Most of the seven bugs only matter if your project uses a specific feature. This guide shows which features, how to check your version and how to upgrade.

Key Facts: Django Security Update at a Glance

  • What: Django security releases 6.1.4, 6.0.11 and 5.2.20, published December 2, 2026.
  • High (Django rating): CVE-2026-132092 (SQL injection in range and in lookups) and CVE-2026-124827 (server-side file write via RasterField, GeoDjango on PostGIS).
  • Moderate: CVE-2026-115868 (XSS in truncatechars_html).
  • Low: CVE-2026-125673 (cache poisoning via dot segments), CVE-2026-119642 and CVE-2026-127929 (admin changelist information leaks), CVE-2026-132809 (heap overflow in OGRGeometry.wkb).
  • Affected: Django 6.1 before 6.1.4, 6.0 before 6.0.11 and 5.2 before 5.2.20.
  • Severity scores: the Django Software Foundation, as CNA, also published CVSS scores: 9.8 (v3.1) for CVE-2026-132092 and 8.8 (v3.1) for CVE-2026-124827. NVD lists both as “Deferred” (no own score).
  • Exploitation: Django does not report exploitation. None of the seven CVEs was in the CISA KEV catalog as of December 3, 2026.
  • Action: upgrade to the patch release for your series, clear affected caches and restart your application servers.

Vulnerability Overview: What Does the Django Security Update Fix?

The Django security update closes two high, one moderate and four low severity issues. The table lists them with the conditions Django gives for each one.

CVEDjango severityComponentWhen it matters
CVE-2026-132092Highrange and in lookupsQueries with aliases or key transforms that contain percent signs
CVE-2026-124827Highdjango.contrib.gis RasterFieldUser-controlled raster input with a non-default driver
CVE-2026-115868Moderatetruncatechars_html, Truncator.chars(html=True)Truncated output rendered in an HTML attribute
CVE-2026-125673LowUpdateCacheMiddleware, cache_page()Request paths with . or .. segments
CVE-2026-119642LowAdmin changelistCustom OneToOneField primary key or multi-table inheritance
CVE-2026-127929LowAdmin changelistLookups across reverse relations (regressed in 5.0.3)
CVE-2026-132809LowOGRGeometry.wkbGeometries larger than 4 GB on 64-bit platforms

What is the Django SQL injection, CVE-2026-132092?

The range and in lookups could build unsafe SQL when a query used aliases or key transforms containing percent signs. According to Django, the __range flaw also required passing more than two right-hand values. The __in flaw required a bilateral transform. After the fix, range accepts exactly two values. Django also notes that percent signs in column aliases and key transforms are already deprecated since Django 6.0.

What is the RasterField file write, CVE-2026-124827?

Assigning a raster definition with a user-controlled name and a non-default GDAL driver to RasterField could make GDAL write a file to a location the attacker chooses. Django says this could enable remote code execution, depending on the driver. The field was reachable by default through the admin, ModelForms and writable model serializers. Geometry fields are not affected, and RasterField exists only on PostGIS.

Affected Versions: Which Django Releases Need This Security Update?

Every supported Django series needs this security update. Django lists only supported series in its notices.

SeriesAffectedFixed inSupport status (Django download page, December 3, 2026)
6.1Before 6.1.46.1.4Mainstream support until April 2027
6.0Before 6.0.116.0.11Extended support until April 2027
5.2 LTSBefore 5.2.205.2.20Extended support until April 2028
5.1, 5.0, 4.2 LTS and olderNot investigatedNo patchUnsupported

Django’s security policy says older versions “may also be affected”, but the team does not investigate them and will not release patches. If you still run 4.2 or 5.1, plan a move to 5.2 LTS or 6.1.

Security Impact: How Serious Is This Django Security Update?

The two high issues can lead to database compromise or arbitrary file writes, but each needs a specific code pattern. The CNA scores reflect the worst case. CVE-2026-132092 has CVSS 3.1 9.8. CVE-2026-124827 has 8.8, because its vector requires low privileges (PR:L).

The other five issues are narrower. The XSS bug needs truncated HTML inside an attribute. The cache bug needs certain deployment and URL configurations. The two admin leaks need a staff user with view permission. The wkb overflow needs geometries above 4 GB.

Django security update chart: which Django features make each of the seven December 2026 CVEs relevant
Django security update, December 2, 2026: which feature each CVE depends on, and what to do after upgrading. Based on the Django release notes.

How to Check Whether You Are Affected

Start with the installed Django version, then look for the features in the table. Run the commands inside the virtual environment or container that serves your site.

python -m django --version
python -m pip show Django

Any version below 6.1.4, 6.0.11 or 5.2.20 in its series needs the Django security update. Next, search your code for the features with the highest impact:

grep -rn "RasterField" --include=*.py .
grep -rn "__range\|__in=" --include=*.py .
grep -rn "truncatechars_html" .
grep -rn "cache_page\|UpdateCacheMiddleware" .

A hit does not prove you are vulnerable. It shows where to review code, for example whether a RasterField accepts user input. If you use Django from a Linux distribution package, check your vendor’s notice, because the version string may not change when a fix is backported.

How to Fix the Vulnerability

Upgrade to the patch release for your series. Django’s download page says patch releases are fully compatible with their feature release, unless that is impossible for security reasons.

  1. Pin the fixed version in your requirements file, for example Django==6.1.4, Django==6.0.11 or Django==5.2.20.
  2. Install it with pip, as described in Django’s upgrade guide: python -m pip install -U Django (or install the exact pinned version).
  3. Run your test suite. Note that range lookups with more than two values now fail by design.
  4. If you use cache_page() or UpdateCacheMiddleware, clear potentially affected caches. Django warns that existing cached responses are not invalidated by the upgrade.
  5. Restart every process that loads Django, such as Gunicorn, uWSGI, ASGI servers and Celery workers.

For GeoDjango projects, review RasterField after upgrading. The field now defaults to editable=False, and dictionaries or JSON strings with a non-default driver raise GDALException. Django warns that server-side request forgery is still possible if untrusted input reaches RasterField, so add validation.

Additional Security Recommendations

  • Never pass untrusted input into raster fields; follow Django’s raster security considerations.
  • Use a Content Security Policy to limit the damage of any XSS bug.
  • Review who has staff accounts with view permissions in the admin.
  • Subscribe to the django-announce list or the Django weblog so you see the next Django security update early.
  • Keep a Web Application Firewall as an extra layer, not as a replacement for patching.

FAQ

Is Django 4.2 LTS affected by this Django security update?

Django does not say, because 4.2 LTS left extended support on April 7, 2026. Django does not investigate unsupported versions or patch them. Upgrade to 5.2 LTS or 6.1.

Are these Django vulnerabilities being exploited?

Django has not reported exploitation. As of December 3, 2026, none of the seven CVEs was in the CISA KEV catalog, and CISA’s ADP entries on CVE.org rate exploitation as “none” for CVE-2026-124827 and CVE-2026-115868.

Do I need GeoDjango to be affected?

Only for CVE-2026-124827 and CVE-2026-132809. The SQL injection, XSS, cache and admin issues affect normal Django projects that use those features.

Why do I have to clear the cache after upgrading?

The fix changes how build_absolute_uri() handles dot segments, but responses that were already cached stay in the cache. Clearing them removes any entry that may have been stored under the wrong URL.

Is there a workaround if I cannot upgrade today?

Django did not publish workarounds. Upgrading is the only official fix. Until then, review the code patterns above and restrict untrusted input to those features.

Conclusion

The December 2026 Django security update is a routine patch release with two serious bugs behind it. Install 6.1.4, 6.0.11 or 5.2.20, clear affected caches and restart workers. Then review raster fields, lookups and truncated HTML in your code.

References

Last Verified: December 3, 2026. Prepared by SafeWebAcademy from the Django weblog announcement, release notes, security policy and download page, the CVE.org and NVD records, and the CISA KEV catalog linked above. This is not an official Django publication. Security details can change, so check the linked advisories for updates.

Related articles

OpenSSL Security Update: 4.1.1, 4.0.4 and 3.5.10 Fix ECH Bypass and TLS Server DoS

The OpenSSL security update of December 1, 2026 fixes three Moderate flaws in 4.1 and 4.0, including a TLS server memory DoS (CVE-2026-123780). Install 4.1.1, 4.0.4 or 3.5.10 and restart services.

TYPO3 CVE-2026-125160: Patch the Exploited Form Upload Flaw (TYPO3-CORE-SA-2026-029)

TYPO3 CVE-2026-125160 (TYPO3-CORE-SA-2026-029) leaks the Form Framework upload path and is exploited per TYPO3 and CISA KEV. Update to 14.3.12, 13.4.40 or ELTS and add a strict CSP to the upload folder.

OWASP Top 10 for LLM Applications (2026): Practical Security Guide for AI Developers

Explore the 2026 OWASP Top 10 for LLM Applications: all ten risks, what shifted from 2025, agentic AI threats, RAG pitfalls, and practical developer controls.

Jenkins Security Update: Pipeline Sandbox Bypass and 10 More Plugin Flaws Fixed

The Jenkins security update of November 25, 2026, fixes 11 plugins, including sandbox bypasses in Pipeline: Groovy (CVE-2026-136834) and Script Security. See affected and fixed versions and how to patch.

Laravel Security Update: Fix the JSON Request DoS (GHSA-8h64-cpq2-9h2g)

A Laravel security update fixes GHSA-8h64-cpq2-9h2g, a high-severity DoS where crafted JSON can exhaust PHP workers. Learn who is affected and how to update to 13.38.0 or 12.74.0.

GeoServer Security Update: CVE-2026-120705 and CVE-2026-129243 Added to CISA KEV

The GeoServer security update closes a five-step attack chain, and CISA added CVE-2026-120705 and CVE-2026-129243 to KEV on November 27, 2026. Upgrade to 3.0.2, 2.28.6 or 2.27.7.

CVE alerts

Get a short note when a new vulnerability write-up is published. No third-party script is loaded.