CVE-2025-57833: SQL injection in Django FilteredRelation column aliases
- Vendor
- Djangoproject
CVE-2025-57833 is an SQL injection vulnerability in Django affecting FilteredRelation handling in Django 4.2 before 4.2.24, 5.1 before 5.1.12, and 5.2 before 5.2.6. The flaw occurs when a suitably crafted dictionary is expanded as **kwargs into QuerySet.annotate() or QuerySet.alias(), allowing attacker-influenced column alias data associated with FilteredRelation to be incorporated into generated SQL without sufficient validation. The issue affects structural SQL elements such as aliases rather than ordinary query parameters, which allows the vulnerability to bypass Django’s usual parameterization protections in the vulnerable code path.
Impact, mitigation & remediation
What it means and what to do now: patch path, interim mitigations, and the assume-compromise checklist.
Impact
What an attacker gets, and what they’ve been doing with it.
Successful exploitation allows SQL injection in affected Django applications. Impact depends on the application’s query construction and the privileges of the database account used by Django, but can include unauthorized query manipulation, disclosure of sensitive data, modification of application data, bypass of application logic enforced through ORM queries, and potentially more severe database-level effects where the backend and privileges permit dangerous SQL capabilities.
Mitigation
If you can’t patch tonight, do this now.
No broadly accepted vendor mitigation is available short of patching. Where immediate upgrade is not possible, reduce exposure by eliminating or tightly constraining dynamic alias construction, forbidding untrusted input from influencing dictionary keys expanded into QuerySet.annotate() or QuerySet.alias(), and using strict allowlists for any user-selectable alias or field metadata. Additional compensating controls such as query anomaly monitoring, least-privilege database accounts, and request filtering may reduce impact but do not fully remediate the vulnerability.
Remediation
Patch, then assume compromise.
Upgrade Django to a fixed supported release: 4.2.24 or later on the 4.2 branch, 5.1.12 or later on the 5.1 branch, or 5.2.6 or later on the 5.2 branch. Apply vendor security errata for downstream packaged products that embed vulnerable Django versions. After upgrading, review application code that dynamically constructs dictionaries passed via **kwargs to QuerySet.annotate() or QuerySet.alias(), especially where FilteredRelation is used, to ensure alias names cannot be influenced by untrusted input.
Exploits
6 exploits validated by Mallory's analysis. Hidden: 1 rejected by Mallory's analysis as not a working exploit.
Affected products & vendors
Products and vendors Mallory has correlated with this vulnerability. Open in Mallory to drill down to specific CPE configurations and version ranges.
References
Frequently asked questions
- Is CVE-2025-57833 exploited in the wild?
- As of Sep 25, 2026, Mallory has no reports of CVE-2025-57833 being exploited in the wild. It is not listed in CISA KEV.
- Is there a public exploit for CVE-2025-57833?
- Yes. Mallory tracks 6 public exploits or proofs of concept for CVE-2025-57833, the earliest disclosed Sep 5, 2025.
- Is there a patch for CVE-2025-57833?
- Upgrade Django to a fixed supported release: 4.2.24 or later on the 4.2 branch, 5.1.12 or later on the 5.1 branch, or 5.2.6 or later on the 5.2 branch. Apply vendor security errata for downstream packaged products that embed vulnerable Django versions.
- What products are affected by CVE-2025-57833?
- Djangoproject Django.
- How severe is CVE-2025-57833?
- CVE-2025-57833 has a CVSS v3.1 score of 8.1 (High) and an EPSS score of 27.1% (98th percentile) as of Sep 25, 2026.
Recent activity
27 sources tracked across advisories, community write-ups, and news. New activity surfaces here as Mallory finds it.