CVE-2025-57833: djangoproject Django · SQL Injection
Affects djangoproject DjangoSource CVE Database V5
Not known to be exploited · 26% EPSS · CVSS 7.1 High.
Data as of 25 Oct 2026, 19:02 UTC
- EPSS
- 26.1% chance of exploitation in 30 days – higher than 97% of CVEsExploit Prediction Scoring System: the likelihood attackers will use this flaw soon.
CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:C/C:H/I:L/A:NExploitation evidence
Disclosed: evidence found.
CVE published 3 Sep 2025
Detectable: no evidence on record.
No public nuclei template indexed
Weaponised: no evidence on record.
No public exploit code indexed in Metasploit or Exploit-DB
Exploited in the wildExploited: no evidence on record.
Not in CISA KEV and no source reports exploitation
Observed by OffSeq MirageSeen by Mirage: no evidence on record.
No attack traffic recorded by OffSeq Mirage sensors
A missing step is not evidence of safety. Sources: cve.org (opens in a new tab), the Metasploit, Exploit-DB and nuclei-templates index as of 2026-10-25.
What to do
Affected software
| Product | Affected | Fixed in |
|---|---|---|
| djangoproject Django | Affected
| Fixed in– |
AI-suggested
European organizations should immediately upgrade Django to versions 4.2.24, 5.1.12, or 5.2.6 or later, where the vulnerability is patched. Conduct a thorough code review focusing on the use of QuerySet.annotate() and QuerySet.alias() with dictionary expansions, especially involving FilteredRelation, to identify unsafe dynamic SQL constructions. Implement strict input validation and sanitization for any user-controllable data used in query annotations or aliases. Employ Web Application Firewalls (WAFs) with custom rules to detect and block suspicious SQL injection patterns targeting Django ORM queries. Monitor application logs for anomalous query patterns or unexpected database errors that could indicate exploitation attempts. Enforce the principle of least privilege on database accounts used by Django applications to limit data exposure in case of compromise. Additionally, integrate runtime application self-protection (RASP) tools to detect and prevent injection attacks in real time. Finally, ensure incident response plans include procedures for SQL injection incidents and data breach notifications compliant with GDPR.
Description
An issue was discovered in Django 4.2 before 4.2.24, 5.1 before 5.1.12, and 5.2 before 5.2.6. FilteredRelation is subject to SQL injection in column aliases, using a suitably crafted dictionary, with dictionary expansion, as the **kwargs passed QuerySet.annotate() or QuerySet.alias().
References
- docs.djangoproject.com/en/dev/releases/security/ (opens in a new tab)
- groups.google.com/g/django-announce (opens in a new tab)
- djangoproject.com/weblog/2025/sep/03/security-releases/ (opens in a new tab)
- medium.com/@EyalSec/django-unauthenticated-0-click-rce-and-sql-injection-using-default-configuration-059964f3f898 (opens in a new tab)
- lists.debian.org/debian-lts-announce/2025/09/msg00017.html (opens in a new tab)
- openwall.com/lists/oss-security/2025/09/03/3 (opens in a new tab)