Skip to main content
Press slash or control plus K to focus the search. Use the arrow keys to navigate results and press enter to open a threat.
Reconnecting to live updates…

CVE-2026-1287: CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection') in djangoproject Django

0
Medium
VulnerabilityCVE-2026-1287cvecve-2026-1287cwe-89
Published: Tue Feb 03 2026 (02/03/2026, 14:36:03 UTC)
Source: CVE Database V5
Vendor/Project: djangoproject
Product: Django

Description

An issue was discovered in 6.0 before 6.0.2, 5.2 before 5.2.11, and 4.2 before 4.2.28. `FilteredRelation` is subject to SQL injection in column aliases via control characters, using a suitably crafted dictionary, with dictionary expansion, as the `**kwargs` passed to `QuerySet` methods `annotate()`, `aggregate()`, `extra()`, `values()`, `values_list()`, and `alias()`. Earlier, unsupported Django series (such as 5.0.x, 4.1.x, and 3.2.x) were not evaluated and may also be affected. Django would like to thank Solomon Kebede for reporting this issue.

AI-Powered Analysis

AILast updated: 02/03/2026, 15:15:08 UTC

Technical Analysis

CVE-2026-1287 is a SQL injection vulnerability identified in Django, a widely used Python web framework, specifically affecting versions 4.2 prior to 4.2.28, 5.2 prior to 5.2.11, and 6.0 prior to 6.0.2. The issue stems from the FilteredRelation feature, which is used to create filtered joins in Django ORM queries. The vulnerability occurs when column aliases are constructed using control characters embedded in dictionary keys passed as **kwargs to QuerySet methods such as annotate(), aggregate(), extra(), values(), values_list(), and alias(). This improper neutralization of special elements (CWE-89) allows an attacker to inject arbitrary SQL commands by manipulating these dictionary keys, which are expanded into SQL column aliases without sufficient sanitization. This can lead to unauthorized data access, data modification, or denial of service through crafted queries. Although earlier unsupported Django versions (5.0.x, 4.1.x, 3.2.x) were not evaluated, they may also be vulnerable. The vulnerability was responsibly disclosed by Solomon Kebede and no public exploits are known at this time. The lack of a CVSS score necessitates an independent severity assessment based on the potential impact and exploitability.

Potential Impact

For European organizations, this vulnerability poses a significant risk due to Django's widespread use in web applications, including e-commerce, government portals, and enterprise systems. Exploitation could lead to unauthorized data disclosure, data corruption, or complete compromise of backend databases, impacting confidentiality, integrity, and availability. This could result in regulatory non-compliance under GDPR, financial losses, reputational damage, and operational disruptions. Attackers could exploit this vulnerability remotely without authentication or user interaction, increasing the threat surface. Organizations relying on vulnerable Django versions must consider the risk of targeted attacks, especially in sectors handling sensitive personal or financial data. The impact is amplified in environments where dynamic query generation is common and input validation is insufficient.

Mitigation Recommendations

The primary mitigation is to upgrade Django installations to versions 4.2.28, 5.2.11, or 6.0.2 or later, where the vulnerability is patched. Organizations should audit their codebases for usage of FilteredRelation and related QuerySet methods with dynamic dictionary expansions and refactor to avoid passing untrusted input as dictionary keys. Implement strict input validation and sanitization on any user-controllable data used in query construction. Employ database-level protections such as least privilege access controls and query logging to detect suspicious activity. Conduct thorough security testing, including static code analysis and dynamic testing focused on ORM query generation. Additionally, monitor security advisories for any emerging exploits and apply patches promptly. For legacy systems where immediate upgrade is not feasible, consider isolating vulnerable applications and restricting access to trusted users only.

Need more detailed analysis?Upgrade to Pro Console

Technical Details

Data Version
5.2
Assigner Short Name
DSF
Date Reserved
2026-01-21T14:04:43.515Z
Cvss Version
null
State
PUBLISHED

Threat ID: 69820d79f9fa50a62fcd604a

Added to database: 2/3/2026, 3:00:09 PM

Last enriched: 2/3/2026, 3:15:08 PM

Last updated: 2/3/2026, 5:24:56 PM

Views: 4

Community Reviews

0 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Actions

PRO

Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.

Please log in to the Console to use AI analysis features.

Need more coverage?

Upgrade to Pro Console in Console -> Billing for AI refresh and higher limits.

For incident response and remediation, OffSeq services can help resolve threats faster.

Latest Threats