CVE-2025-13372
Unknown Unknown - Not Provided
BaseFortify

Publication date: 2025-12-02

Last updated on: 2025-12-12

Assigner: Django Software Foundation

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.
CVSS Scores
EPSS Scores
Probability:
Percentile:
Meta Information
Published
2025-12-02
Last Modified
2025-12-12
Generated
2026-05-07
AI Q&A
2025-12-02
EPSS Evaluated
2026-05-05
NVD
Affected Vendors & Products
Showing 3 associated CPEs
Vendor Product Version / Range
djangoproject django From 4.2 (inc) to 4.2.27 (exc)
djangoproject django From 5.1 (inc) to 5.1.15 (exc)
djangoproject django From 5.2 (inc) to 5.2.9 (exc)
Helpful Resources
Exploitability
CWE
CWE Icon
KEV
KEV Icon
CWE ID Description
CWE-89 The product constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component. Without sufficient removal or quoting of SQL syntax in user-controllable inputs, the generated SQL query can cause those inputs to be interpreted as SQL instead of ordinary user data.
Attack-Flow Graph
AI Powered Q&A
Can you explain this vulnerability to me?

This vulnerability is a SQL injection issue in Django's FilteredRelation feature affecting versions before 5.2.9, 5.1.15, and 4.2.27. It occurs when column aliases are created using a specially crafted dictionary passed as keyword arguments to QuerySet.annotate() or QuerySet.alias() on PostgreSQL databases, allowing an attacker to inject malicious SQL code.


How can this vulnerability impact me? :

The vulnerability can allow an attacker to perform SQL injection attacks, potentially leading to unauthorized access to or manipulation of database data. However, the CVSS score indicates a low severity impact with limited confidentiality impact and no integrity or availability impact, requiring network access and user interaction.


What immediate steps should I take to mitigate this vulnerability?

Upgrade Django to a fixed version: 5.2.9 or later, 5.1.15 or later, or 4.2.27 or later. Avoid using unsupported Django series such as 5.0.x, 4.1.x, and 3.2.x which may also be affected.


Ask Our AI Assistant
Need more information? Ask your question to get an AI reply (Powered by our expertise)
0/70
EPSS Chart