Vulnerability · Published Feb 3, 2026 · Assigned by DSF
CVE-2026-1312Potential SQL injection via QuerySet.order_by and FilteredRelation
Medium 5.4
In plain English
A medium-severity SQL injection in Django from djangoproject. There are no confirmed reports of exploitation so far. The chance it is exploited in the next 30 days is estimated at 0.9% (higher than 60% of all known vulnerabilities). Ready-made attack tooling exists: public proof-of-concept code. Fixed versions are available - upgrade the affected package.
Official 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.
Affected packages & fixed versions
| Ecosystem | Package | Fixed in | Advisory |
|---|---|---|---|
| Alpine:v3.23 | py3-django | 4.2.28-r0 | ALPINE-CVE-2026-1312 |
| Alpine:v3.24 | py3-django | 4.2.28-r0 | ALPINE-CVE-2026-1312 |
| Debian:12 | python-django | 3:3.2.25-0+deb12u2 | DEBIAN-CVE-2026-1312 |
| Debian:12 | python-django | 3:3.2.25-0+deb12u2 | DSA-6150-1 |
| Debian:13 | python-django | 3:4.2.28-0+deb13u1 | DEBIAN-CVE-2026-1312 |
| Debian:13 | python-django | 3:4.2.28-0+deb13u1 | DSA-6150-1 |
| Debian:14 | python-django | 3:4.2.28-1 | DEBIAN-CVE-2026-1312 |
| PyPI | django | 5.2.11 | GHSA-6426-9fv3-65x8 |
| PyPI | django | 6.0.2 | GHSA-6426-9fv3-65x8 |
| PyPI | django | 4.2.28 | GHSA-6426-9fv3-65x8 |
| PyPI | django | 4.2.28, 5.2.11, 6.0.2 | PYSEC-2026-47 |
| Ubuntu:22.04:LTS | python-django | no fix listed | UBUNTU-CVE-2026-1312 |
| Ubuntu:24.04:LTS | python-django | 3:4.2.11-1ubuntu1.14 | UBUNTU-CVE-2026-1312 |
| Ubuntu:25.10 | python-django | 3:5.2.4-1ubuntu2.3 | UBUNTU-CVE-2026-1312 |
Affected products (as reported)
| Vendor | Product | Versions |
|---|---|---|
| djangoproject | Django | 6.0 – before 6.0.25.2 – before 5.2.114.2 – before 4.2.28 |
Weakness: CWE-89 · Vector: CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:N
References
- Django security archive vendor-advisory
- Django releases announcements mailing-list
- Django security releases issued: 6.0.2, 5.2.11, and 4.2.28 vendor-advisory
- https://access.redhat.com/security/cve/CVE-2026-1312 vdb-entry, x_refsource_REDHAT
- RHBZ#2436342 issue-tracking, x_refsource_REDHAT
- https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-1312.json x_sadp-csaf-vex
- https://access.redhat.com/errata/RHSA-2026:3959 vendor-advisory, x_refsource_REDHAT
- https://access.redhat.com/errata/RHSA-2026:5971 vendor-advisory, x_refsource_REDHAT
- https://access.redhat.com/errata/RHSA-2026:3958 vendor-advisory, x_refsource_REDHAT
- https://access.redhat.com/errata/RHSA-2026:5970 vendor-advisory, x_refsource_REDHAT
- https://access.redhat.com/errata/RHSA-2026:14835 vendor-advisory, x_refsource_REDHAT
- https://access.redhat.com/errata/RHSA-2026:3962 vendor-advisory, x_refsource_REDHAT
- https://access.redhat.com/errata/RHSA-2026:3960 vendor-advisory, x_refsource_REDHAT
- https://access.redhat.com/errata/RHSA-2026:2694 vendor-advisory, x_refsource_REDHAT
- https://access.redhat.com/errata/RHSA-2026:6291 vendor-advisory, x_refsource_REDHAT