Potential SQL injection in FilteredRelation column aliases on PostgreSQL
Key facts
- Attack vector
- Network
- Privileges required
- None
- User interaction
- Required
- Attack complexity
- Low
- Impact type
- SQL injection
- Confidentiality · integrity · availability
- Low · None · None
- Fix status
- Partial Red Hat: 9 without a fix
Attack profile from CVSS 3.1 · CISA ADP. Fix status from CNA, GitHub and Red Hat. Impact type from CWE-89.
Summary
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.
Why it matters now
SSVC decision points
CISA ADP · SSVC 2.0.3
- Exploitation
- None
- Automatable
- No
- Technical impact
- Partial
The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| djangoproject | Django | 5.2 to before 5.2.9; 5.1 to before 5.1.15; 4.2 to before 4.2.27 | 5.2.9, 5.1.15, 4.2.27 | Patch available | CNA |
| — | Django (PyPI) | 5.2a1 to before 5.2.9 | 5.2.9 | Patch available | GHSA-rqw2-ghq9-44m7 |
| — | Django (PyPI) | 5.1a1 to before 5.1.15 | 5.1.15 | Patch available | GHSA-rqw2-ghq9-44m7 |
| — | Django (PyPI) | 4.2a1 to before 4.2.27 | 4.2.27 | Patch available | GHSA-rqw2-ghq9-44m7 |
- Django Vendordjangoproject Affected 5.2 to before 5.2.9; 5.1 to before 5.1.15; 4.2 to before 4.2.27 Fixed in 5.2.9, 5.1.15, 4.2.27 Patch available CNA
- Django (PyPI) Vendor— Affected 5.2a1 to before 5.2.9 Fixed in 5.2.9 Patch available GHSA-rqw2-ghq9-44m7
- Django (PyPI) Vendor— Affected 5.1a1 to before 5.1.15 Fixed in 5.1.15 Patch available GHSA-rqw2-ghq9-44m7
- Django (PyPI) Vendor— Affected 4.2a1 to before 4.2.27 Fixed in 4.2.27 Patch available GHSA-rqw2-ghq9-44m7
CPE configurations NVD · 1
| CPE | Versions | Role | Vendor |
|---|---|---|---|
| cpe:2.3:a:djangoproject:django:*:*:*:*:*:*:*:* | 4.2 to before 4.2.27; 5.1 to before 5.1.15; 5.2 to before 5.2.9 | Vulnerable | djangoproject |
- cpe:2.3:a:djangoproject:django:*:*:*:*:*:*:*:* Versions 4.2 to before 4.2.27; 5.1 to before 5.1.15; 5.2 to before 5.2.9 Vulnerable ·djangoproject
Remediation
- Fix · CNA Django (djangoproject) Fixed in 5.2.9, 5.1.15, 4.2.27
- Fix · GHSA-rqw2-ghq9-44m7 Django (PyPI) Fixed in 5.2.9 Advisory →
- Fix · GHSA-rqw2-ghq9-44m7 Django (PyPI) Fixed in 5.1.15 Advisory →
- Fix · GHSA-rqw2-ghq9-44m7 Django (PyPI) Fixed in 4.2.27 Advisory →
Fixed in the same release
Records fixed by the same vendor advisory or release, as the CNA lists them.
- Advisory ·
djangoproject Django — Django security releases issued: 5.2.9, 5.1.15, and 4.2.27
2 records Highest priority Priority LOW 2 LOW
Other records, highest priority first
- TI-2025-39862 Potential denial-of-service vulnerability in XML serializer text extractionPriority LOW 37
Vendor assessments
Red Hat
Red Hat rating: Moderate. Red Hat's page for this CVE →
| Product | Status | Plan or fix |
|---|---|---|
| OpenShift Service Mesh 2 | Affected | No fix yet: Fix deferred |
| OpenShift Service Mesh 3 | Affected | No fix yet: Fix deferred |
| Red Hat Ansible Automation Platform 2 | Affected | No fix yet: Fix deferred |
| Red Hat Discovery 2 | Affected | No fix yet: Fix deferred |
| Red Hat OpenStack Platform 13 (Queens) | Affected | No fix yet: Fix deferred |
| Red Hat OpenStack Platform 16.2 | Affected | No fix yet: Fix deferred |
| Red Hat OpenStack Platform 17.1 | Affected | No fix yet: Fix deferred |
| Red Hat OpenStack Platform 18.0 | Affected | No fix yet: Fix deferred |
| Red Hat Satellite 6 | Affected | No fix yet: Fix deferred |
Timeline
- 2026-10-02 Threatist record created from CVE-2025-13372
- 2026-10-03 Alias added: GHSA-rqw2-ghq9-44m7
References
Other 10
- Django releases announcements
- https://github.com/django/django/commit/479415ce5249bcdebeb6570c72df2a87f45a7bbf
- https://github.com/django/django/commit/56aea00c3c5e1aacf4ed05f8ee06c2e78f02cea0
- https://github.com/django/django/commit/5b90ca1e7591fa36fccf2d6dad67cf1477e6293e
- https://github.com/django/django/commit/9c6a5bde24240382807d13bc3748d08444709355
- https://github.com/django/django/commit/f997037b235f6b5c9e7c4a501491ec45f3400f3d
- https://docs.djangoproject.com/en/dev/releases/security
- https://github.com/django/django
- https://github.com/pypa/advisory-database/tree/main/vulns/django/PYSEC-2025-104.yaml
- https://www.djangoproject.com/weblog/2025/dec/02/security-releases
More djangoproject Django vulnerabilities
- TI-2022-15177 An issue was discovered in Django 3.2 before 3.2.14 and 4.0 before 4.0.6. CVSS 3.1CRITICAL 9.8
- TI-2020-05994 Django 1.11 before 1.11.28, 2.2 before 2.2.10, and 3.0 before 3.0.3 allows SQL Injection… CVSS 3.1CRITICAL 9.8
- TI-2023-10198 An issue was discovered in the Multipart Request Parser in Django 3.2 before 3.2.18, 4.0… CVSS 3.1HIGH 7.5
- TI-2019-14306 Django before 1.11.27, 2.x before 2.2.9, and 3.x before 3.0.1 allows account takeover. CVSS 3.1CRITICAL 9.8
- TI-2019-10595 An issue was discovered in Django 1.11.x before 1.11.23, 2.1.x before 2.1.11, and 2.2.x… CVSS 3.0CRITICAL 9.8
- TI-2021-14006 Django 3.1.x before 3.1.13 and 3.2.x before 3.2.5 allows QuerySet.order_by SQL injection… CVSS 3.1CRITICAL 9.8
Sources
- CVE-2025-13372 · CVE Program
- CVE-2025-13372 · NVD
- FIRST EPSS
- GHSA-rqw2-ghq9-44m7 · GitHub Advisory Database · CC BY 4.0
- CVE-2025-13372 · Red Hat security data · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences