Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessReach endpoint building vulnerable range/in queryset
-
DeliverySupply input with percent-sign payload
-
ExploitBreak placeholder/parameter balance in lookup SQL
-
ExecutionInject attacker-controlled SQL
-
ImpactRead or modify database contents
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V1 - Encoding and Sanitization Parameterized queries, prepared statements
MITRE ATT&CK
2 techniques across 2 tactics: Initial Access, Persistence The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up. |
| Exploitation Conditions | Not a default-configuration flaw. Exploitation requires the application itself to construct one of two specific query shapes AND use percent signs in a column alias or key transform: (1) a |
| Impact | Signals conflict in a way that matters for prioritization. Severity signals are high: CVSS 4.0 base 9.3 with AV:N/AC:L/AT:N/PR:N/UI:N and VC:H/VI:H/VA:H, CWE-89 (SQL injection), a confirmed vendor patch across three branches, and the vuln.today Decision label 'act_now' - the last of which argues against deferring remediation. Against that, exploitation-likelihood signals are either absent or dampening: there is no CISA KEV listing (so no confirmed active exploitation), no EPSS score was provided, and no public working exploit is identified. Most importantly, the vendor's own description narrows the trigger well below what PR:N/UI:N implies: the __range flaw requires the application to incorrectly pass more than two right-hand side values, the __in flaw requires a bilateral transform, and in both cases the query must involve aliases or key transforms containing percent signs. These are developer-constructed, non-default code patterns - and percent signs in column aliases and key transforms were already deprecated in Django 6.0 - so blanket, opportunistic exploitation of arbitrary Django sites is unlikely; only applications written with these specific constructs are reachable. Net assessment: patch promptly given Django's footprint and the act_now label, but recognize this is a conditional/code-pattern-dependent flaw rather than a broadly wormable one. Note the CVSS vector is CVSS 4.0 only; no CVSS 3.1 vector was supplied in the input. |
| Exploit ScenarioDerived | In a Django application that builds a queryset using a __range lookup with more than two RHS values, or an __in lookup with a bilateral transform, over a field whose alias or key transform contains a percent sign, an attacker supplies crafted input that is reflected into the generated SQL. Because the placeholder/parameter balance breaks, attacker-controlled text is incorporated into the query rather than bound as a parameter, enabling SQL injection against the backend database. No public working exploit is identified; the mechanism is disclosed only via the fix commits and regression tests. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv2 – Dec 02, 2026
SQL injection in Django's range and in query lookups affects 5.2 before 5.2.20, 6.0 before 6.0.11, and 6.1 before 6.1.4, allowing a crafted lookup to break out of query parameterization when the application itself builds either a __range lookup with more than two right-hand-side values or an __in lookup combined with a bilateral transform, in a query whose aliases or key transforms contain percent signs. The published CVSS 4.0 vector is 9.3 (AV:N/AC:L/PR:N/UI:N, high confidentiality/integrity/availability impact), but this is not a default-configuration flaw: reachability depends on non-default lookup, transform, and alias patterns, and percent signs in aliases and key transforms were already deprecated in Django 6.0 for removal in 2028. No public exploit code was identified in the available sources at time of analysis; the vendor has shipped fixed releases, the vuln.today decision label is act_now, and Django's own security policy rates the flaw 'high'.
Earlier versions of this analysis (1)
SQL injection can occur in Django 6.1 before 6.1.4, 6.0 before 6.0.11, and 5.2 before 5.2.20 through the range and in lookups when a query involves aliases or key transforms containing percent signs. Exploitation is not reachable against a default Django installation: the __range case required more than two right-hand-side values, and the __in case required a registered bilateral transform that can compile to a parameter-less IS NULL, leaving placeholders and parameters unbalanced. Vendor patches are available for the supported branches and no public exploit code has been identified at time of analysis; earlier unsupported 5.1.x, 5.0.x, and 4.2.x series were not evaluated and may also be affected.
RemediationAI
Upgrade to the vendor-released fixed versions: Django 5.2.20, 6.0.11, or 6.1.4 according to your branch; the vendor presents updating as the remediation, and the patch commits are https://github.com/django/django/commit/1eb6104c5805d55fca4cd6cf9c715521934d45fc, https://github.com/django/django/commit/e0e7876984f1b0b63700e2743d6f2a3edf01e0c6, https://github.com/django/django/commit/da230e17c9d77a2801419b911772aefe2cbed4b3, and https://github.com/django/django/commit/5a8963c9fcb45dba9825e19c19c4190ca4772768. The fix enforces exactly two right-hand-side values for __range and adds a strict length check on the compiled SQL/parameter pairs in batch_process_rhs(). Because reachability depends on application code, also audit codebases for __range lookups passed more than two right-hand-side values, __in lookups combined with bilateral transforms, and any remaining use of percent signs in column aliases or key transforms - those patterns were deprecated in Django 6.0 and are scheduled for removal in Django 2028, so eliminating them removes the prerequisite condition; note that this is a code-level prerequisite reduction rather than a vendor-published workaround, and updating remains the only complete fix. Older unsupported series (5.1.x, 5.0.x, 4.2.x) were not evaluated by the vendor and should be moved to a supported, patched branch. Advisory: https://www.djangoproject.com/weblog/2026/dec/02/security-releases/ and https://docs.djangoproject.com/en/dev/releases/security/.
Affected VersionsENISA
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 1 package in euvd
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
Django's ORM compiles QuerySet lookups into SQL fragments carrying %s placeholders via django/db/models/lookups.py. Two related defects are addressed by the fix: Range.as_sql() formatted its BETWEEN %s AND %s template from the right-hand-side sequence without enforcing an exact arity, and FieldGetDbPrepValueIterableMixin.batch_process_rhs() zipped pre-processed SQL and parameter lists without a length check (the patch adds strict=True and unpacks start, end = rhs). The advisory and the accompanying regression tests describe the root cause as an unbalanced-placeholder condition: a bilateral transform (a Transform subclass with bilateral = True, e.g. a bilateral Lower) can compile None to a parameter-less IS NULL fragment, so the number of placeholders no longer matches the number of parameters after compilation, and % characters in column aliases or JSON key transforms (tests use data__x%sy) interact with Django's percent-based placeholder formatting. Django's advisory states the __range flaw 'required incorrectly using more than two right-hand side values' and the __in flaw 'required a bilateral transform', so neither is triggered by ordinary, correctly-formed lookups. This is CWE-89 (SQL injection), but the injection point is application-constructed query metadata rather than directly attacker-supplied input, which is why the vendor rates it 'high' under its own policy rather than critical despite the 9.3 CVSS 4.0 base. The advisory notes that percent signs in column aliases and key transforms were deprecated in Django 6.0 and are scheduled for removal in Django 2028.
Know when Django gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N
SQL injection reachable over the network without privileges or interaction once a vulnerable query exists; full read/write database impact gives C:H/I:H/A:H, consistent with the vendor 4.0 vector.
Primary rating from Vendor (DSF).
CVSS VectorVendor: DSF
Lifecycle Timeline
3DescriptionCVE.org
An issue was discovered in Django 6.1 before 6.1.4, 6.0 before 6.0.11, and 5.2 before 5.2.20. The range and in lookups are subject to SQL injection in a query involving aliases or key transforms containing percent signs. Earlier, unsupported Django series (such as 5.1.x, 5.0.x, and 4.2.x) were not evaluated and may also be affected. Django would like to thank Cristian Panaro for reporting this issue.
Articles & Coverage 1
Executive ViewAI
A critical SQL injection vulnerability in Django versions 5.2 before 5.2.20, 6.0 before 6.0.11, and 6.1 before 6.1.4 could allow attackers to compromise data confidentiality, integrity, and availability. Although exploitation requires non-default configurations, the potential business impact is severe, affecting any organization using affected Django versions in production.
Apply vendor patch.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
SQL injection exploits the way applications construct database queries by mixing user input directly into SQL statements.
The package python/cpython from 0 and before 3.6.13, from 3.7.0 and before 3.7.10, from 3.8.0 and before 3.8.8, from 3.9
In Django 1.10.x before 1.10.8 and 1.11.x before 1.11.5, HTML autoescaping was disabled in a portion of the template for
An issue was discovered in Django 3.2 before 3.2.14 and 4.0 before 4.0.6. Rated critical severity (CVSS 9.8), this vulne
Django 3.1.x before 3.1.13 and 3.2.x before 3.2.5 allows QuerySet.order_by SQL injection if order_by is untrusted input
Django before 1.11.27, 2.x before 2.2.9, and 3.x before 3.0.1 allows account takeover. Rated critical severity (CVSS 9.8
An authentication/authorization bypass in the djust Python live-view framework (versions prior to 1.0.7) lets unauthenti
Unauthenticated arbitrary Python module import in djust before 1.0.7 lets any client that can reach the WebSocket or SSE
Django 1.11 before 1.11.29, 2.2 before 2.2.11, and 3.0 before 3.0.4 allows SQL Injection if untrusted data is used as a
Cross-site scripting (XSS) vulnerability in the dismissChangeRelatedObjectPopup function in contrib/admin/static/admin/j
Forged content modification in django-page-cms through 2.0.13 lets unauthenticated remote attackers exploit five CSRF-ex
Cross-site request forgery in djust's Server-Sent-Events transport affects all versions prior to 1.0.7 and allows a cros
Unauthenticated remote attackers can read live Django view and session state and invoke server-side handlers through dju
EUVD-2026-141384
GHSA-c7wh-8726-4mmj
NVD
CVE.org
EPSS
VulDB
Exploit-DB