CVE-2026-1312
JSON

5.4medium

Potential SQL injection via QuerySet.order_by and FilteredRelation

Severity
5.4medium CVSS:3.1 by CISA-ADP
Exploit likelihood
0.64% (higher than 46% of CVEs)
Published
Last changed
Assigned by
DSF
Also known as
GHSA-6426-9fv3-65x8BIT-DJANGO-2026-1312PYSEC-2026-47

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

Product or packageVersionsReported by
djangofrom 6.0 before 6.0.2, from 5.2 before 5.2.11, from 4.2 before 4.2.28
Not affected: 6.0.2, 5.2.11, 4.2.28
CVE List
python3.12-djangoNot specified
Not affected: from 0:4.2.28-1.el8ap before *, from 0:4.2.28-1.el9ap before *, from 0:4.2.30-1.el9pc before *
CVE List
python-djangoNot specified
Not affected: from 0:4.2.28-0.1.el8pc before *, from 0:4.2.28-0.1.el9pc before *
CVE List
foremanNot specified
Not affected: from 0:3.14.0.14-1.el9sat before *
CVE List
libcompsNot specified
Not affected: from 0:0.1.23-0.3.el9pc before *
CVE List
python-brotliNot specified
Not affected: from 0:1.2.0-0.1.el9pc before *
CVE List
python-pulp-containerNot specified
Not affected: from 0:2.22.3-1.el9pc before *
CVE List
python-pulp-rpmNot specified
Not affected: from 0:3.27.10-2.el9pc before *
CVE List
rubygem-fog-kubevirtNot specified
Not affected: from 0:1.5.1-1.el9sat before *
CVE List
rubygem-foreman_kubevirtNot specified
Not affected: from 0:0.4.3-1.el9sat before *
CVE List
rubygem-katelloNot specified
Not affected: from 0:4.16.0.14-1.el9sat before *
CVE List
rubygem-rubyipmiNot specified
Not affected: from 0:0.13.0-1.el9sat before *
CVE List

All scores

CISA-ADP5.4medium CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:N
redhat-SADP8.5high CVSS:3.1CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:C/C:H/I:H/A:H
GitHub5.4medium CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:N
PyPA Advisory Database5.4medium CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:N
Bitnami Vulnerability Databasehigh rating

Classification

CWE-89

SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial.

What each source says

CVE List

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.

NVD (es)

Se descubrió un problema en 6.0 anterior a 6.0.2, 5.2 anterior a 5.2.11 y 4.2 anterior a 4.2.28. .QuerySet.order_by() está sujeto a inyección SQL en alias de columna que contienen puntos cuando el mismo alias es, utilizando un diccionario adecuadamente diseñado, con expansión de diccionario, usado en FilteredRelation. Series de Django anteriores y no compatibles (como 5.0.x, 4.1.x y 3.2.x) no fueron evaluadas y también pueden verse afectadas. Django desea agradecer a Solomon Kebede por informar de este problema.

References

https://docs.djangoproject.com/en/dev/releases/security/advisory, fix, patch, vendor-advisory
https://groups.google.com/g/django-announceadvisory, article, mailing-list, release-notes, web
https://www.djangoproject.com/weblog/2026/feb/03/security-releases/advisory, fix, patch, vendor-advisory
https://access.redhat.com/security/cve/CVE-2026-1312vdb-entry, web
https://bugzilla.redhat.com/show_bug.cgi?id=2436342issue-tracking, web
https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-1312.jsonweb
https://access.redhat.com/errata/RHSA-2026:3959vendor-advisory, web
https://access.redhat.com/errata/RHSA-2026:5971vendor-advisory, web
https://access.redhat.com/errata/RHSA-2026:3958vendor-advisory, web
https://access.redhat.com/errata/RHSA-2026:5970vendor-advisory, web
https://access.redhat.com/errata/RHSA-2026:14835vendor-advisory, web
https://access.redhat.com/errata/RHSA-2026:3962vendor-advisory, web

Sources

SourceRecordLicence
CVE ListCVE-2026-1312 changed 2026-07-15CVE Terms of Use
GitHub Advisory DatabaseGHSA-6426-9fv3-65x8 changed 2026-09-10CC-BY-4.0
NVDCVE-2026-1312 changed 2026-07-15Public domain
PyPA Advisory DatabasePYSEC-2026-47 changed 2026-06-10CC-BY-4.0
Bitnami Vulnerability DatabaseBIT-DJANGO-2026-1312 changed 2026-09-10Apache-2.0