CVE-2025-13372
Potential SQL injection in FilteredRelation column aliases on PostgreSQL
4.3
MEDIUM
CVSS 3.1
EPSS 0.01%
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.
How to fix CVE-2025-13372
To remediate CVE-2025-13372, upgrade the affected package to a fixed version below.
- —upgrade to 4.2.27 or later
- —upgrade to 3:3.2.25-0+deb12u1 or later
- —upgrade to 3:4.2.27-0+deb13u1 or later
- —upgrade to 5.2.9 or later
- —upgrade to 4.2.27 or later
Is CVE-2025-13372 being exploited?
Low — EPSS is 0.0%, meaning exploitation activity has not been observed at scale.
Affected packages (5)
- >= 4.2.0, < 4.2.27, >= 5.1.0, < 5.1.15, >= 5.2.0, < 5.2.9
- from 0, < 3:3.2.25-0+deb12u1
- from 0, < 3:4.2.27-0+deb13u1
- >= 5.2a1, < 5.2.9
- >= 4.2, < 4.2.27, >= 5.1, < 5.1.15, >= 5.2, < 5.2.9
CVSS scores
| Source | Version | Severity | Vector |
|---|---|---|---|
| osv | CVSS 3.1 | MEDIUM4.3 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:N/A:N |