CVE-2026-1312: 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. `.QuerySet.order_by()` is subject to SQL injection in column aliases containing periods when the same alias is, using a suitably crafted dictionary, with dictionary expansion, used in `FilteredRelation`. 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
This vulnerability in Django involves improper neutralization of special elements used in SQL commands (CWE-89). Specifically, .QuerySet.order_by() is vulnerable to SQL injection when column aliases containing periods are used in conjunction with FilteredRelation and dictionary expansion. The affected versions are 6.0 prior to 6.0.2, 5.2 prior to 5.2.11, and 4.2 prior to 4.2.28. Unsupported earlier series such as 5.0.x, 4.1.x, and 3.2.x were not evaluated but may also be vulnerable. Red Hat advisories provide patches and updates for affected distributions.
Potential Impact
Successful exploitation could allow an attacker with limited privileges (PR:L) to inject SQL commands via crafted column aliases, potentially leading to partial confidentiality and integrity impacts (C:L, I:L) without affecting availability. This could result in unauthorized data access or modification within the database used by Django applications.
Mitigation Recommendations
Fixes are available in Django versions 6.0.2, 5.2.11, and 4.2.28. Users should upgrade to these or later versions to remediate the vulnerability. Red Hat has released security advisories and updated packages addressing this issue. Applying these official patches is the recommended mitigation. Patch status is confirmed by vendor advisories linked in the references.
CVE-2026-1312: 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. `.QuerySet.order_by()` is subject to SQL injection in column aliases containing periods when the same alias is, using a suitably crafted dictionary, with dictionary expansion, used in `FilteredRelation`. 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
This vulnerability in Django involves improper neutralization of special elements used in SQL commands (CWE-89). Specifically, .QuerySet.order_by() is vulnerable to SQL injection when column aliases containing periods are used in conjunction with FilteredRelation and dictionary expansion. The affected versions are 6.0 prior to 6.0.2, 5.2 prior to 5.2.11, and 4.2 prior to 4.2.28. Unsupported earlier series such as 5.0.x, 4.1.x, and 3.2.x were not evaluated but may also be vulnerable. Red Hat advisories provide patches and updates for affected distributions.
Potential Impact
Successful exploitation could allow an attacker with limited privileges (PR:L) to inject SQL commands via crafted column aliases, potentially leading to partial confidentiality and integrity impacts (C:L, I:L) without affecting availability. This could result in unauthorized data access or modification within the database used by Django applications.
Mitigation Recommendations
Fixes are available in Django versions 6.0.2, 5.2.11, and 4.2.28. Users should upgrade to these or later versions to remediate the vulnerability. Red Hat has released security advisories and updated packages addressing this issue. Applying these official patches is the recommended mitigation. Patch status is confirmed by vendor advisories linked in the references.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- DSF
- Date Reserved
- 2026-01-21T20:45:05.988Z
- State
- PUBLISHED
- Vendor Advisory Urls
- [{"url":"https://access.redhat.com/security/cve/CVE-2026-1312","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: 69820d79f9fa50a62fcd604f
Added to database: 02/03/2026, 15:00:09 UTC
Last enriched: 07/15/2026, 08:28:31 UTC
Last updated: 09/10/2026, 19:36:52 UTC
Views: 383
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.