Skip to main content
CVE-2025-57833VulnerabilityPublished Updated

CVE-2025-57833: djangoproject Django · SQL Injection

Affects djangoproject DjangoSource CVE Database V5

0

Not known to be exploited · 26% EPSS · CVSS 7.1 High.

Data as of 25 Oct 2026, 19:02 UTC

CVSS 3.1 base score
7.1High
How severe the flaw is on the 0–10 CVSS scale.
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:N

Exploitation evidence

  1. Disclosed: evidence found.

    CVE published 3 Sep 2025

  2. Detectable: no evidence on record.

    No public nuclei template indexed

  3. Weaponised: no evidence on record.

    No public exploit code indexed in Metasploit or Exploit-DB

  4. Exploited in the wild: no evidence on record.

    Not in CISA KEV and no source reports exploitation

  5. Observed by OffSeq 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

ProductAffectedFixed in
djangoproject DjangoAffected
  • =4.2
  • =5.1
  • =5.2
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

Community reviews

Loading reviews…