CVE-2025-13372 Details
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.
A SQL injection vulnerability has been identified in Django's QuerySet `FilteredRelation` feature, specifically in versions 5.2 prior to 5.2.9, 5.1 prior to 5.1.15, and 4.2 prior to 4.2.27. The issue arises from improper handling of column aliases, allowing attackers to inject malicious SQL through a crafted dictionary. This vulnerability is exploited by using dictionary expansion to pass harmful `**kwargs` to `QuerySet.annotate()` or `QuerySet.alias()` methods on PostgreSQL databases.
Users can upgrade to Django versions 5.2.9, 5.1.15, or 4.2.27, all of which include the necessary patch. Instructions for downloading these versions are available on the Django website.
Metrics
CVSS 4.0 Severity and Vector Strings:
No CVSS 4.0 data is available for this CVE.
CVSS 3.x Severity and Vector Strings:
No data available for CVSS Version 2.0 on this CVE.
CISA-ADP
Assessed Dec 2, 2025References to Advisories, Solutions, and Tools
By selecting these links, you will be leaving this site. These are references gathered from the official CVE record and are not endorsed by Volerion.
| URL | Source(s) | Tag(s) |
|---|---|---|
| https://docs.djangoproject.com/en/dev/releases/security/ | Django Software Foundation | PatchVendor Advisory |
| https://groups.google.com/g/django-announce | Django Software Foundation | Mailing ListRelease Notes |
| https://www.djangoproject.com/weblog/2025/dec/02/security-releases/ | Django Software Foundation | PatchVendor Advisory |
Weakness Enumeration
| CWE-ID | CWE Name | Source |
|---|---|---|
| CWE-89 | Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection') | Django Software Foundation |
Affected Products
| Product | Versions |
|---|---|
| djangoproject django | >= 4.2, < 4.2.27 >= 5.1, < 5.1.15 >= 5.2, < 5.2.9 |
CPE
Remediation
| |
Change History
6 change records found show changes
| Date | Action | Recorded By |
|---|---|---|
| Oct 18, 2026 | CVE Translated | [email protected] |
| Jun 17, 2026 | CVE Modified | Django Software Foundation |
| Jun 17, 2026 | CVE Modified | CISA-ADP |
| Dec 12, 2025 | Initial Analysis | [email protected] |
| Dec 2, 2025 | New CVE Received | Django Software Foundation |
| Dec 2, 2025 | CVE Modified | CISA-ADP |