Potential SQL injection via QuerySet.order_by and FilteredRelation
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.
2. Django: Django: SQL injection via crafted column aliases in QuerySet.order_by()
A flaw was found in Django. A remote attacker could exploit a SQL injection vulnerability in the `.QuerySet.order_by()` method. This occurs when column aliases containing periods are used, and the same alias is also present in `FilteredRelation` via a specially crafted dictionary. Successful exploitation could lead to unauthorized information disclosure or arbitrary code execution within the database.
RHSA-2026:3959: Red Hat Ansible Automation Platform 2.5 for RHEL 8, Red Hat Ansible Automation Platform 2.5 for RHEL 9
RHSA-2026:5971: Red Hat Satellite 6.16 for RHEL 8, Red Hat Satellite 6.16 for RHEL 9
RHSA-2026:3958: Red Hat Ansible Automation Platform 2.6 for RHEL 9
RHSA-2026:5970: Red Hat Satellite 6.17 for RHEL 9
RHSA-2026:14835: Red Hat Satellite 6.18 for RHEL 9
RHSA-2026:3962: Red Hat Ansible Automation Platform 2.5
RHSA-2026:3960: Red Hat Ansible Automation Platform 2.6
RHSA-2026:2694: Red Hat Discovery 2
RHSA-2026:6291: Red Hat Satellite 6.18
Configurations
Workarounds
Mitigation for this issue is either not available or the currently available options do not meet the Red Hat Product Security criteria comprising ease of use and deployment, applicability to widespread installation base, or stability.