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 package | Versions | Reported by |
|---|---|---|
| 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 | CVE List |
| python3.12-django | Not 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-django | Not specified Not affected: from 0:4.2.28-0.1.el8pc before *, from 0:4.2.28-0.1.el9pc before * | CVE List |
| foreman | Not specified Not affected: from 0:3.14.0.14-1.el9sat before * | CVE List |
| libcomps | Not specified Not affected: from 0:0.1.23-0.3.el9pc before * | CVE List |
| python-brotli | Not specified Not affected: from 0:1.2.0-0.1.el9pc before * | CVE List |
| python-pulp-container | Not specified Not affected: from 0:2.22.3-1.el9pc before * | CVE List |
| python-pulp-rpm | Not specified Not affected: from 0:3.27.10-2.el9pc before * | CVE List |
| rubygem-fog-kubevirt | Not specified Not affected: from 0:1.5.1-1.el9sat before * | CVE List |
| rubygem-foreman_kubevirt | Not specified Not affected: from 0:0.4.3-1.el9sat before * | CVE List |
| rubygem-katello | Not specified Not affected: from 0:4.16.0.14-1.el9sat before * | CVE List |
| rubygem-rubyipmi | Not specified Not affected: from 0:0.13.0-1.el9sat before * | CVE List |
| satellite | Not specified Not affected: from 0:6.17.7-1.el9sat before * | CVE List |
| yggdrasil-worker-forwarder | Not specified Not affected: from 0:0.0.3-4.el9sat before * | CVE List |
| ansible-automation-platform-25/lightspeed-rhel8 | Not specified Not affected: from 1772214630 before * | CVE List |
| ansible-automation-platform-26/lightspeed-rhel9 | Not specified Not affected: from 1772552788 before * | CVE List |
| discovery/discovery-server-rhel9 | Not specified Not affected: from 1770913597 before * | CVE List |
| satellite/iop-advisor-backend-rhel9 | Not specified Not affected: from 1773451075 before * | CVE List |
| ansible-automation-platform-24/de-minimal-rhel8 | Not specified | CVE List |
| ansible-automation-platform-24/de-minimal-rhel9 | Not specified | CVE List |
| ansible-automation-platform-25/de-minimal-rhel8 | Not specified | CVE List |
| ansible-automation-platform-25/de-minimal-rhel9 | Not specified | CVE List |
| ansible-automation-platform-26/de-minimal-rhel9 | Not specified | CVE List |
| automation-controller | Not specified | CVE List |
| python-django20 | Not specified | CVE List |
| satellite-capsule:el8/python-django | Not specified | CVE List |
| 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 | GitHub Advisory Database, PyPA Advisory Database |
| djangoproject django | from 4.2 before 4.2.28, from 5.2 before 5.2.11, from 6.0 before 6.0.2 | NVD |
| 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 | Bitnami Vulnerability Database |
All scores
| CISA-ADP | 5.4medium CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:N |
| redhat-SADP | 8.5high CVSS:3.1 | CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:C/C:H/I:H/A:H |
| GitHub | 5.4medium CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:N |
| PyPA Advisory Database | 5.4medium CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:N |
| Bitnami Vulnerability Database | high rating |
Classification
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
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2026-1312 changed 2026-07-15 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-6426-9fv3-65x8 changed 2026-09-10 | CC-BY-4.0 |
| NVD | CVE-2026-1312 changed 2026-07-15 | Public domain |
| PyPA Advisory Database | PYSEC-2026-47 changed 2026-06-10 | CC-BY-4.0 |
| Bitnami Vulnerability Database | BIT-DJANGO-2026-1312 changed 2026-09-10 | Apache-2.0 |