Skip to main content
CVE-2025-13372VulnerabilityPublished

CVE-2025-13372: djangoproject Django · SQL Injection

Affects djangoproject DjangoSource CVE Database V5

0

Not known to be exploited · CVSS 4.3 Medium.

Data as of 25 Oct 2026, 19:02 UTC

CVSS 3.1 base score
4.3Medium
How severe the flaw is on the 0–10 CVSS scale.
EPSS
0.9% chance of exploitation in 30 days – higher than 60% of CVEsExploit Prediction Scoring System: the likelihood attackers will use this flaw soon.
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:N/A:N

Exploitation evidence

  1. Disclosed: evidence found.

    CVE published 2 Dec 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
PyPIdjangopkg:pypi/djangoOther threatsAffected
  • =5.2
  • =5.1
  • =4.2
Fixed in–

Check your own hosts for these packages with threat-finder (opens in a new tab), our free open-source scanner.

AI-suggested

To mitigate CVE-2025-13372, organizations should immediately upgrade Django to versions 5.2.9 or later, 5.1.15 or later, or 4.2.27 or later where the vulnerability is patched. If upgrading is not immediately feasible, developers should avoid using dictionary expansion (**kwargs) with QuerySet.annotate() or QuerySet.alias() when working with FilteredRelation on PostgreSQL. Implement strict input validation and sanitization on any user-supplied data that could influence ORM query parameters. Employ Web Application Firewalls (WAFs) with rules targeting SQL injection patterns specific to Django ORM queries. Conduct thorough code reviews focusing on ORM query construction to detect unsafe usage patterns. Monitor application logs for unusual query patterns or errors indicative of attempted injection. Additionally, restrict database user permissions to the minimum necessary to limit data exposure in case of exploitation. Finally, maintain an incident response plan to quickly address any detected exploitation attempts.

Description

An issue was discovered in 5.2 before 5.2.9, 5.1 before 5.1.15, and 4.2 before 4.2.27. `FilteredRelation` is subject to SQL injection in column aliases, using a suitably crafted dictionary, with dictionary expansion, as the `**kwargs` passed to `QuerySet.annotate()` or `QuerySet.alias()` on PostgreSQL. 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 Stackered for reporting this issue.

References

Community reviews

Loading reviews…