CVE-2025-59681
An issue was discovered in Django 4.2 before 4.2.25, 5.1 before 5.1.13, and 5.2 before 5.2.7. QuerySet.annotate(), QuerySet.alias(), QuerySet.aggregate(), and QuerySet.extra() are subject to SQL injection in column aliases, when using a suitably crafted dictionary, with dictionary expansion, as the **kwargs passed to these methods (on MySQL and MariaDB).
- CVSS 3.1
- 9.8
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H - EPSS
- 0.6% chance of exploitation in the next 30 days; higher than 50% of CVEs (scores of 2026-10-25)
- CWE
- CWE-89
- Published
- Modified
- Record from
- the NVD, synced
Affected
- djangoproject:django
Packages (OSV)
| Advisory | Ecosystem | Package | Affected | Fixed in |
|---|---|---|---|---|
| GHSA-hpr9-3m2g-3j9p | PyPI | django | >=4.2 <4.2.25 | 4.2.25 |
| GHSA-hpr9-3m2g-3j9p | PyPI | django | >=5.1 <5.1.13 | 5.1.13 |
| GHSA-hpr9-3m2g-3j9p | PyPI | django | >=5.2 <5.2.7 | 5.2.7 |
| PYSEC-2025-106 | PyPI | django | >=4.2 <4.2.25 >=5.1 <5.1.13 >=5.2 <5.2.7 | 4.2.25, 5.1.13, 5.2.7 |