
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
rangeandinlookups) and CVE-2026-124827 (server-side file write viaRasterField, 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.
| CVE | Django severity | Component | When it matters |
|---|---|---|---|
| CVE-2026-132092 | High | range and in lookups | Queries with aliases or key transforms that contain percent signs |
| CVE-2026-124827 | High | django.contrib.gis RasterField | User-controlled raster input with a non-default driver |
| CVE-2026-115868 | Moderate | truncatechars_html, Truncator.chars(html=True) | Truncated output rendered in an HTML attribute |
| CVE-2026-125673 | Low | UpdateCacheMiddleware, cache_page() | Request paths with . or .. segments |
| CVE-2026-119642 | Low | Admin changelist | Custom OneToOneField primary key or multi-table inheritance |
| CVE-2026-127929 | Low | Admin changelist | Lookups across reverse relations (regressed in 5.0.3) |
| CVE-2026-132809 | Low | OGRGeometry.wkb | Geometries 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.
| Series | Affected | Fixed in | Support status (Django download page, December 3, 2026) |
|---|---|---|---|
| 6.1 | Before 6.1.4 | 6.1.4 | Mainstream support until April 2027 |
| 6.0 | Before 6.0.11 | 6.0.11 | Extended support until April 2027 |
| 5.2 LTS | Before 5.2.20 | 5.2.20 | Extended support until April 2028 |
| 5.1, 5.0, 4.2 LTS and older | Not investigated | No patch | Unsupported |
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.

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 DjangoAny 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.
- Pin the fixed version in your requirements file, for example
Django==6.1.4,Django==6.0.11orDjango==5.2.20. - Install it with pip, as described in Django’s upgrade guide:
python -m pip install -U Django(or install the exact pinned version). - Run your test suite. Note that
rangelookups with more than two values now fail by design. - If you use
cache_page()orUpdateCacheMiddleware, clear potentially affected caches. Django warns that existing cached responses are not invalidated by the upgrade. - 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
- Django security releases issued: 6.1.4, 6.0.11 and 5.2.20 (Django weblog)
- Django 6.1.4 release notes, 6.0.11 and 5.2.20
- Django security issues archive
- Django security policy
- Django download page and supported versions
- GDAL raster security considerations
- Django cache framework
- How to upgrade Django to a newer version
- Django on PyPI
- CVE-2026-132092 on CVE.org and NVD
- CVE-2026-124827 on CVE.org and NVD
- CVE.org: CVE-2026-115868, CVE-2026-125673, CVE-2026-119642, CVE-2026-127929, CVE-2026-132809
- CISA Known Exploited Vulnerabilities catalog
Related Articles
- OWASP Top 10 (2025) Explained: A Practical Guide to Web Application Security
- Content Security Policy (CSP): Directives, Examples, Report-Only Rollout and Nginx
- Web Application Firewall Rules: OWASP CRS, ModSecurity, Nginx WAF and Tuning
- Laravel Security Update: Fix the JSON Request DoS (GHSA-8h64-cpq2-9h2g)
- Symfony Security Update: 23 CVEs Fixed in 8.1.12, 7.4.24, 6.4.51 and 5.4.57
- What Is a CVE? CVE Meaning, Vulnerability Databases, Scoring and Triage
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.