Django SQL injection in range and in lookups (CVE-2026-132092)
Django has patched a SQL injection vulnerability (CVSS 3.1 9.8 Critical, CVSS 4.0 9.3 Critical; Django rating: high) in its range and in ORM lookups when queries involve column aliases or key transforms containing percent signs. Affected supported releases are Django 6.1 before 6.1.4, 6.0 before 6.0.11, and 5.2 before 5.2.20.
Key facts: CVE.org scores CVE-2026-132092 at CVSS 3.1 9.8 Critical (AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H) and CVSS 4.0 9.3 Critical (AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H), while Django rates it "high" under its own security policy (CWE-89). NVD status for CVE-2026-132092 and CVE-2026-124827 is Deferred as of 2 December 2026 14:17 GMT, not a completed NVD analysis. Affected: Django 6.1 before 6.1.4, 6.0 before 6.0.11, 5.2 before 5.2.20, and Django main (earlier unsupported series such as 5.1.x, 5.0.x and 4.2.x were not evaluated and may also be affected). Fixed: 6.1.4, 6.0.11 and 5.2.20. No exploitation reported by Django as of 2 December 2026; not listed in CISA KEV as of 2 December 2026 (catalogue 2026.11.30). KEV due dates bind US federal agencies only (BOD 26-04). Patch now regardless.
Reviewed by Simon Phillips (Principal Security Architect) and Oliver Legg (Head of Security Operations). First published 2 December 2026.
At a glance
Verified directly from the Django 2 December 2026 security releases, CVE.org, NVD and the CISA KEV catalogue.
CVSS 3.1 9.8 Critical
CVE.org scores CVE-2026-132092 at CVSS 3.1 9.8 Critical and CVSS 4.0 9.3 Critical (network reachable, no privileges or user interaction required). Django rates the flaw "high" under its own security policy. NVD vulnStatus is Deferred as of 2 December 2026 14:17 GMT. Reported by security researchers.
6.1, 6.0 and 5.2 branches
Affects Django 6.1 before 6.1.4, 6.0 before 6.0.11, 5.2 before 5.2.20, and main. Earlier unsupported series (5.1.x, 5.0.x, 4.2.x) were not evaluated and may also be affected. Upgrade to 6.1.4, 6.0.11 or 5.2.20.
No reported exploitation
No exploitation reported by Django as of 2 December 2026; not listed in CISA KEV as of 2 December 2026 (catalogue 2026.11.30). KEV due dates bind US federal agencies only (BOD 26-04). Patch now regardless.
What happened
SQL injection in Django ORM range and in lookups with percent signs in aliases or key transforms.
Security researchers reported that Django's range and in ORM lookups were vulnerable to SQL injection when used in queries involving column aliases or key transforms containing percent signs (%).
Per the Django advisory, the __range flaw required incorrectly passing more than two right-hand side values, while the __in flaw required a bilateral transform. As part of the fix, Django's range lookup now strictly requires exactly two right-hand side values. Using percent signs in column aliases and key transforms was already deprecated in Django 6.0 and is scheduled for removal in Django 2028.
The same 2 December 2026 security releases (6.1.4, 6.0.11 and 5.2.20) also fix six other issues. None of those six have a CVSS score of 9.0 or higher:
CVE-2026-124827(Django "high"; CVE.org CVSS 3.1 8.8 High, CVSS 4.0 8.7 High; NVD status Deferred as of 2 December 2026 14:17 GMT): server-side file-write viaRasterFieldassignment, which could enable remote code execution depending on the raster driver.RasterFieldis only implemented on PostGIS, and geometry fields were not affected. After the patch,RasterFielddefaultseditabletoFalse, but server-side request forgery (SSRF) is still possible if untrusted input is assigned toRasterField.CVE-2026-125673(Django "low"; CVSS 3.1 3.7 Low, CVSS 4.0 6.3 Medium): potential cache poisoning via dot segments in request paths. Existing cached responses are not invalidated by the upgrade, so clear any potentially affected caches after upgrading.CVE-2026-127929(Django "low"; CVSS 3.1 2.7 Low, CVSS 4.0 5.1 Medium): information leakage in admin changelist via reverse relations, a special case ofCVE-2010-4534that regressed in Django5.0.3.
| CVE | Issue | Django rating | CVSS 3.1 | CVSS 4.0 |
|---|---|---|---|---|
CVE-2026-132092 | Potential SQL injection in range and in lookups | high | 9.8 Critical | 9.3 Critical |
CVE-2026-124827 | Server-side file-write via RasterField assignment (PostGIS only) | high | 8.8 High | 8.7 High |
CVE-2026-115868 | Potential cross-site scripting in truncatechars_html | moderate | 6.1 Medium | 5.1 Medium |
CVE-2026-125673 | Potential cache poisoning via dot segments in request paths | low | 3.7 Low | 6.3 Medium |
CVE-2026-119642 | Information leakage in admin changelist via pk alias for OneToOneField | low | 2.7 Low | 5.1 Medium |
CVE-2026-127929 | Information leakage in admin changelist via reverse relations (regression of CVE-2010-4534 in 5.0.3) | low | 2.7 Low | 5.1 Medium |
CVE-2026-132809 | Heap buffer overflow in OGRGeometry.wkb | low | 5.3 Medium | 6.9 Medium |
Proactive remediation
Upgrade supported Django applications and audit ORM query patterns for user-influenced aliases and lookups.
Inventory and upgrade Django
Inventory every Python environment, container image and lockfile running Django 5.2, 6.0 or 6.1 and upgrade to 5.2.20, 6.0.11 or 6.1.4. Migrate any unsupported 4.2.x, 5.0.x or 5.1.x deployments to a supported patched release.
Audit range and in lookups
Search codebases for __range and __in lookups combined with dynamic annotations, column aliases, JSON/HStore key transforms or bilateral transforms. Confirm __range always passes exactly two values and reject percent signs in any user-influenced alias or key name.
Check PostGIS RasterField use
Clear potentially affected caches after upgrading if you use Django cache middleware or cache_page (CVE-2026-125673). For PostGIS apps using RasterField (CVE-2026-124827, 8.8 High / 8.7 High), do not assign untrusted input even after patching because SSRF remains possible; geometry fields were not affected.
Reactive detection and response
What to inspect in application, WAF and database logs if an unpatched Django service was exposed.
Anomalous SQL syntax
Review PostgreSQL, MySQL, MariaDB or Oracle query logs for unexpected SQL syntax errors, injected clauses or abnormal BETWEEN / IN statements originating from Django application database users.
Percent-sign query keys
Inspect HTTP access logs, Django error tracebacks and WAF alerts for requests passing encoded percent signs (%25) in filter parameter names, sort/alias fields or JSON key paths targeting endpoints that build dynamic ORM queries.
Contain and rotate secrets
If suspicious SQL execution or unexplained data access is found, isolate the affected application tier, preserve database and application logs, investigate exposed tables, and rotate database credentials, Django SECRET_KEY and API tokens.
Free detection pack
Pack version 1.0.0, slot django-cve-2026-132092-pack-v1, built by the CybaVerse threat hunt team for developers, IT teams and MSPs. It includes 11 KQL hunts, 7 Sigma rules, and read-only bash and PowerShell version checkers with byte-for-byte parity. The checkers never execute Python and never open settings.py or .env files.
check-django-cve-2026-132092.sh
Read-only offline checker from pack v1. Accepts --version, --version-file, --root DIR (reads only django/__init__.py, METADATA, PKG-INFO or requirements.txt; no tree walk) or --csv (host,version). Never executes Python and never opens settings.py or .env.
bash check-django-cve-2026-132092.sh --version 6.1.3
bash check-django-cve-2026-132092.sh --root /srv/app/venv/lib/python3.12/site-packages
bash check-django-cve-2026-132092.sh --csv inventory.csvCheck-DjangoCve2026132092.ps1
The same read-only version checks in PowerShell 7 with byte-for-byte matching output and identical exit codes. Never executes Python and never opens settings.py or .env.
pwsh -File Check-DjangoCve2026132092.ps1 --version 6.1.3
pwsh -File Check-DjangoCve2026132092.ps1 --version-file requirements.txt
pwsh -File Check-DjangoCve2026132092.ps1 --csv inventory.csvKQL and Sigma
11 KQL hunts for Microsoft Sentinel and Defender, and 7 Sigma rules, covering percent-sign range/in tokens in WAF/proxy logs, inbound TCP 80/443, syslog SQL/BETWEEN/IN errors, shells and unexpected file writes from python, python3, gunicorn, uwsgi, uvicorn or celery (also covering CVE-2026-124827), and unusual outbound connections. Every hunt is our own pattern. Field names and log paths are unverified. The KQL has NOT been run against a live tenant yet.
Verdicts
- AFFECTEDDjango
5.2.0to5.2.19,6.0.0to6.0.10,6.1.0to6.1.3, or pre-releases of fixed versions (such as5.2.20rc1or6.1.4a1). - FIXEDDjango
5.2.20,6.0.11or6.1.4(final) and later micro versions on those branches, plus later supported series (6.2+). - REVIEWUnsupported series before
5.2(including4.2.x,5.0.xand5.1.x, which CVE.org states were not evaluated and may also be affected), unknown series, or unparseable input.
Exit codes
| Code | Meaning |
|---|---|
| 0 | FIXED |
| 2 | AFFECTED |
| 3 | REVIEW |
| 5 | Usage or read error |
On multi-row CSV runs (host,version) the worst result wins: AFFECTED, then REVIEW, then FIXED. Patch now regardless.
Know the limits
- Both checkers are read-only and offline. They never execute Python, never open
settings.py,local_settings.py,secrets.py,credentials.pyor.env, and print non-version inputs as(not shown). - The KQL and Sigma rules are our own pattern. WAF, proxy, syslog, application and database field names and line formats are unverified, and the KQL has NOT been run against a live tenant yet. Test in your own workspace first and treat hits as a review list, not proof of exploitation.
- No exploitation reported by Django as of 2 December 2026; not listed in CISA KEV as of 2 December 2026 (catalogue 2026.11.30). KEV due dates bind US federal agencies only (BOD 26-04). Patch now regardless.
How CybaVerse helps
One 24/7 UK-based Cyber Operations team using CybaOps to find exposed software, verify remediation and hunt for suspicious database and application activity.
CybaOps brings asset inventory, exposure tracking and 24/7 detection and response together in one platform, with your EDR optional. When critical framework vulnerabilities like CVE-2026-132092 drop, our Cyber Operators triage alerts within 15 minutes, help your team verify patched builds across production estates, and monitor application and database telemetry for exploitation attempts.
Official sources
Primary vendor and vulnerability records verified on 2 December 2026.