Skip to main content
EPSS 0.8%top 44%

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

0
Medium
VulnerabilityCVE-2026-1312cvecve-2026-1312cwe-89
Published: 02/03/2026 (02/03/2026, 14:36:23 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. `.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

Attack Vector
Network
Attack Complexity
Low
Privileges Required
Low
User Interaction
None
Scope
Unchanged
Confidentiality
Low
Integrity
Low
Availability
None
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:N

Affected software

django
pkg:pypi/django
Affected versions
<6.0.2<5.2.11<4.2.28

Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.

AI-Powered Analysis

Machine-generated threat intelligence

AILast updated: 07/15/2026, 08:28:31 UTC

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.

Pro Console: star threats, build custom feeds, automate alerts via Slack, email & webhooks.Upgrade to Pro

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 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 for AI refresh and higher limits.

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

Latest Threats

Breach by OffSeqOFFSEQFRIENDS — 25% OFF

Check if your credentials are on the dark web

Instant breach scanning across billions of leaked records. Free tier available.

Scan now
OffSeq TrainingCredly Certified

Lead Pen Test Professional

Technical5-day eLearningPECB Accredited
View courses