CVE-2026-1287: CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection') in djangoproject Django
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 Analysis
Technical Summary
The vulnerability CVE-2026-1287 in Django involves SQL injection via the FilteredRelation feature's handling of column aliases. Specifically, when dictionary expansion (**kwargs) is used in QuerySet methods like annotate(), aggregate(), extra(), values(), values_list(), and alias(), specially crafted input containing control characters can lead to SQL injection. This affects Django versions 6.0 prior to 6.0.2, 5.2 prior to 5.2.11, and 4.2 prior to 4.2.28. Earlier unsupported versions may also be affected but were not evaluated. Red Hat has published multiple advisories and errata providing patches and updates for affected products that include Django. The CVSS v3.1 base score is 5.4 (medium severity), reflecting network attack vector, low attack complexity, low privileges required, no user interaction, and limited confidentiality and integrity impact without availability impact.
Potential Impact
Successful exploitation of this vulnerability could allow an attacker with low privileges to perform SQL injection attacks via crafted column aliases in Django QuerySet methods, potentially leading to unauthorized disclosure or modification of data. The impact is limited to confidentiality and integrity with no availability impact. There are no known exploits in the wild at this time.
Mitigation Recommendations
Official patches are available for Django versions 6.0.2 and later, 5.2.11 and later, and 4.2.28 and later. Users should upgrade to these fixed versions to remediate the vulnerability. Red Hat has released security advisories and errata with updated packages addressing this issue. Users of affected Red Hat products should apply the relevant updates as per the vendor guidance. There is no indication that no action is required or that the issue is already mitigated without patching. Patch status is confirmed by vendor advisories.
CVE-2026-1287: CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection') in djangoproject 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.
CVSS v3.1
Score 5.4medium
Affected software
Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
Weaknesses
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
The vulnerability CVE-2026-1287 in Django involves SQL injection via the FilteredRelation feature's handling of column aliases. Specifically, when dictionary expansion (**kwargs) is used in QuerySet methods like annotate(), aggregate(), extra(), values(), values_list(), and alias(), specially crafted input containing control characters can lead to SQL injection. This affects Django versions 6.0 prior to 6.0.2, 5.2 prior to 5.2.11, and 4.2 prior to 4.2.28. Earlier unsupported versions may also be affected but were not evaluated. Red Hat has published multiple advisories and errata providing patches and updates for affected products that include Django. The CVSS v3.1 base score is 5.4 (medium severity), reflecting network attack vector, low attack complexity, low privileges required, no user interaction, and limited confidentiality and integrity impact without availability impact.
Potential Impact
Successful exploitation of this vulnerability could allow an attacker with low privileges to perform SQL injection attacks via crafted column aliases in Django QuerySet methods, potentially leading to unauthorized disclosure or modification of data. The impact is limited to confidentiality and integrity with no availability impact. There are no known exploits in the wild at this time.
Mitigation Recommendations
Official patches are available for Django versions 6.0.2 and later, 5.2.11 and later, and 4.2.28 and later. Users should upgrade to these fixed versions to remediate the vulnerability. Red Hat has released security advisories and errata with updated packages addressing this issue. Users of affected Red Hat products should apply the relevant updates as per the vendor guidance. There is no indication that no action is required or that the issue is already mitigated without patching. Patch status is confirmed by vendor advisories.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- DSF
- Date Reserved
- 2026-01-21T14:04:43.515Z
- State
- PUBLISHED
- Vendor Advisory Urls
- [{"url":"https://access.redhat.com/security/cve/CVE-2026-1287","vendor":"Red Hat"},{"url":"https://access.redhat.com/errata/RHSA-2026:3959","vendor":"Red Hat"},{"url":"https://access.redhat.com/errata/RHSA-2026:5971","vendor":"Red Hat"},{"url":"https://access.redhat.com/errata/RHSA-2026:3958","vendor":"Red Hat"},{"url":"https://access.redhat.com/errata/RHSA-2026:5970","vendor":"Red Hat"},{"url":"https://access.redhat.com/errata/RHSA-2026:14835","vendor":"Red Hat"},{"url":"https://access.redhat.com/errata/RHSA-2026:3962","vendor":"Red Hat"},{"url":"https://access.redhat.com/errata/RHSA-2026:3960","vendor":"Red Hat"},{"url":"https://access.redhat.com/errata/RHSA-2026:2694","vendor":"Red Hat"},{"url":"https://access.redhat.com/errata/RHSA-2026:6291","vendor":"Red Hat"}]
Threat ID: 69820d79f9fa50a62fcd604a
Added to database: 02/03/2026, 15:00:09 UTC
Last enriched: 07/15/2026, 13:33:53 UTC
Last updated: 09/10/2026, 19:36:52 UTC
Views: 236
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.