SQL Injection Flaw in Django FilteredRelation Aliases
Vulnerability Disclosure · 2 sources · Updated 3mo ago · First seen Sep 22, 2025

A disclosed vulnerability in the Django web framework, tracked as CVE-2025-57833, allows SQL injection through FilteredRelation column aliases when a suitably crafted dictionary is expanded as **kwargs into QuerySet.annotate() or QuerySet.alias(). The issue is classified as CWE-89 and affects applications that pass attacker-controlled input into those ORM methods, potentially enabling unauthorized database query manipulation.
Red Hat rated the flaw Important with a CVSS v3 score of 7.1, while noting that the NVD assigned a higher 8.1 score. Red Hat also said there was no acceptable mitigation at disclosure and identified multiple affected products and components, which were later addressed through security errata released in September and October 2025.
Why it matters
Impact assessment
CVE-2025-57833 affects Django-based applications that use FilteredRelation and pass attacker-controlled data into QuerySet.annotate() or QuerySet.alias() via expanded **kwargs. The highest risk is to internet-facing web applications and embedded Django components in enterprise platforms, including Red Hat Ansible Automation Platform and Red Hat OpenStack Platform packages listed by Red Hat.
Impact can include unauthorized database query manipulation, data disclosure, application data tampering, access-control bypass, and potentially broader compromise paths commonly associated with SQL injection. Exposure is condition-dependent rather than universal: exploitation requires unsafe application code patterns, but affected package versions should be treated as vulnerable unless explicitly fixed by vendor errata.
There is no exploitation-in-the-wild information in the provided references.
Affected entities and products
- Django web framework
- Applications using
FilteredRelationaliases with attacker-influenced**kwargs - Red Hat Ansible Automation Platform 2.4 for RHEL 8 and RHEL 9
- Red Hat Ansible Automation Platform 2.5 for RHEL 8 and RHEL 9
- Red Hat OpenStack Platform 16.2
- Red Hat OpenStack Platform 17.1 for RHEL 9
Severity and scope facts
- Vulnerability:
CVE-2025-57833 - Weakness:
CWE-89Improper Neutralization of Special Elements used in an SQL Command - Red Hat severity: Important
- Red Hat CVSS v3.1: 7.1
- NVD CVSS v3.1: 8.1
- Scope is broad across Django deployments, but practical exploitability depends on whether application code passes untrusted input into the affected ORM methods.
- Red Hat states previous package versions in listed product streams should be assumed vulnerable unless explicitly stated otherwise.


