# CVE-2026-1312: Potential SQL injection via QuerySet.order_by and FilteredRelation

- Severity: Medium 5.4 (CVSS:3.1, scored by CISA-ADP) `CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:N`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.64%, higher than 46% of CVEs (2026-11-30)
- Published: 2026-02-03T14:36:23.257Z
- Modified: 2026-09-10T16:01:31.335Z
- Also known as: GHSA-6426-9fv3-65x8, BIT-DJANGO-2026-1312, PYSEC-2026-47
- Weaknesses: CWE-89
- SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial
- Assigned by: DSF

## 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.

(As written by CVE List.)

## Affected

- django: from 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)
- python3.12-django: no versions given (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 *)
- python-django: no versions given (not affected: from 0:4.2.28-0.1.el8pc before *; from 0:4.2.28-0.1.el9pc before *)
- foreman: no versions given (not affected: from 0:3.14.0.14-1.el9sat before *)
- libcomps: no versions given (not affected: from 0:0.1.23-0.3.el9pc before *)
- python-brotli: no versions given (not affected: from 0:1.2.0-0.1.el9pc before *)
- python-pulp-container: no versions given (not affected: from 0:2.22.3-1.el9pc before *)
- python-pulp-rpm: no versions given (not affected: from 0:3.27.10-2.el9pc before *)
- rubygem-fog-kubevirt: no versions given (not affected: from 0:1.5.1-1.el9sat before *)
- rubygem-foreman_kubevirt: no versions given (not affected: from 0:0.4.3-1.el9sat before *)
- rubygem-katello: no versions given (not affected: from 0:4.16.0.14-1.el9sat before *)
- rubygem-rubyipmi: no versions given (not affected: from 0:0.13.0-1.el9sat before *)
- satellite: no versions given (not affected: from 0:6.17.7-1.el9sat before *)
- yggdrasil-worker-forwarder: no versions given (not affected: from 0:0.0.3-4.el9sat before *)
- ansible-automation-platform-25/lightspeed-rhel8: no versions given (not affected: from 1772214630 before *)
- ansible-automation-platform-26/lightspeed-rhel9: no versions given (not affected: from 1772552788 before *)
- discovery/discovery-server-rhel9: no versions given (not affected: from 1770913597 before *)
- satellite/iop-advisor-backend-rhel9: no versions given (not affected: from 1773451075 before *)
- ansible-automation-platform-24/de-minimal-rhel8: no versions given
- ansible-automation-platform-24/de-minimal-rhel9: no versions given
- ansible-automation-platform-25/de-minimal-rhel8: no versions given
- ansible-automation-platform-25/de-minimal-rhel9: no versions given
- ansible-automation-platform-26/de-minimal-rhel9: no versions given
- automation-controller: no versions given
- python-django20: no versions given
- satellite-capsule:el8/python-django: no versions given
- django (PyPI): from 6.0a1 before 6.0.2; from 5.2a1 before 5.2.11; from 4.2a1 before 4.2.28; from 4.2 before 4.2.28; from 5.2 before 5.2.11; from 6.0 before 6.0.2
- djangoproject django: from 4.2 before 4.2.28; from 5.2 before 5.2.11; from 6.0 before 6.0.2
- django (Bitnami): from 4.2.0 before 4.2.28; from 5.2.0 before 5.2.11; from 6.0.0 before 6.0.2

## Every score

- CISA-ADP: CVSS:3.1 5.4 Medium `CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:N`
- redhat-SADP: CVSS:3.1 8.5 High `CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:C/C:H/I:H/A:H`
- GitHub: CVSS:3.1 5.4 Medium `CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:N`
- PyPA Advisory Database: CVSS:3.1 5.4 Medium `CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:N`
- Bitnami Vulnerability Database: rating High

## References

- <https://docs.djangoproject.com/en/dev/releases/security/> (advisory, fix, patch, vendor-advisory)
- <https://groups.google.com/g/django-announce> (advisory, 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-1312> (vdb-entry, web)
- <https://bugzilla.redhat.com/show_bug.cgi?id=2436342> (issue-tracking, web)
- <https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-1312.json> (web)
- <https://access.redhat.com/errata/RHSA-2026:3959> (vendor-advisory, web)
- <https://access.redhat.com/errata/RHSA-2026:5971> (vendor-advisory, web)
- <https://access.redhat.com/errata/RHSA-2026:3958> (vendor-advisory, web)
- <https://access.redhat.com/errata/RHSA-2026:5970> (vendor-advisory, web)
- <https://access.redhat.com/errata/RHSA-2026:14835> (vendor-advisory, web)
- <https://access.redhat.com/errata/RHSA-2026:3962> (vendor-advisory, web)
- <https://access.redhat.com/errata/RHSA-2026:3960> (vendor-advisory, web)
- <https://access.redhat.com/errata/RHSA-2026:2694> (vendor-advisory, web)
- <https://access.redhat.com/errata/RHSA-2026:6291> (vendor-advisory, web)
- <https://nvd.nist.gov/vuln/detail/CVE-2026-1312> (advisory, web)
- <https://github.com/django/django/commit/005d60d97c4dfb117503bdb6f2facfcaf9315d84> (web)
- <https://github.com/django/django/commit/69065ca869b0970dff8fdd8fafb390bf8b3bf222> (web)
- <https://docs.djangoproject.com/en/dev/releases/security> (web)
- <https://github.com/django/django> (package)
- <https://github.com/pypa/advisory-database/tree/main/vulns/django/PYSEC-2026-47.yaml> (web)
- <https://www.djangoproject.com/weblog/2026/feb/03/security-releases> (web)
- <https://github.com/advisories/GHSA-6426-9fv3-65x8> (advisory)

## Sources

- CVE List: [CVE-2026-1312](https://www.cve.org/CVERecord?id=CVE-2026-1312), CVE Terms of Use, modified 2026-07-15
- GitHub Advisory Database: [GHSA-6426-9fv3-65x8](https://github.com/advisories/GHSA-6426-9fv3-65x8), CC-BY-4.0, modified 2026-09-10
- NVD: [CVE-2026-1312](https://nvd.nist.gov/vuln/detail/CVE-2026-1312), Public domain, modified 2026-07-15
- PyPA Advisory Database: [PYSEC-2026-47](https://osv.dev/vulnerability/PYSEC-2026-47), CC-BY-4.0, modified 2026-06-10
- Bitnami Vulnerability Database: [BIT-DJANGO-2026-1312](https://osv.dev/vulnerability/BIT-DJANGO-2026-1312), Apache-2.0, modified 2026-09-10

---

Page: https://cve.day/CVE-2026-1312 · Whole record: https://cve.day/CVE-2026-1312.json · Rebuilt by cve.day 2026-11-25T22:59:13.393Z
