CVE-2025-59681
CRITICAL 9.8CVSS 3.1Django vulnerable to SQL injection in column aliases
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).
- Published
- 1 Oct 2025
- Last modified
- 12 Oct 2026
- Assigned by
- cve@mitre.org
- NVD status
- Modified
- Weakness
- CWE-89
- Also known as
- BIT-django-2025-59681GHSA-hpr9-3m2g-3j9pPYSEC-2025-106
- Sources
- NVDJSONOSV GHSA-hpr9-3m2g-3j9pJSONOSV PYSEC-2025-106JSON
Scores
| Source | Scored by | Version | Score | Vector / decision |
|---|---|---|---|---|
| NVD | nvd@nist.gov (Primary) | CVSS 3.1 | CRITICAL 9.8 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
| OSV | PyPA | CVSS 3.1 | CRITICAL 9.8 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
| NVD | cve@mitre.org (Secondary) | CVSS 3.1 | HIGH 7.1 | CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:C/C:H/I:L/A:N |
| OSV | GitHub | CVSS 3.1 | HIGH 7.1 | CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:C/C:H/I:L/A:N |
Affected
| Source | Vendor / ecosystem | Product / package | Affected versions | Fixed in |
|---|---|---|---|---|
| NVD | djangoproject | djangocpe:2.3:a:djangoproject:django:*:*:*:*:*:*:*:* |
>= 4.2, < 4.2.25 | 4.2.25 |
| NVD | djangoproject | djangocpe:2.3:a:djangoproject:django:*:*:*:*:*:*:*:* |
>= 5.1, < 5.1.13 | 5.1.13 |
| NVD | djangoproject | djangocpe:2.3:a:djangoproject:django:*:*:*:*:*:*:*:* |
>= 5.2, < 5.2.7 | 5.2.7 |
| OSV | PyPI | django | >= 4.2, < 4.2.25 | 4.2.25 |
| OSV | PyPI | django | >= 5.1, < 5.1.13 | 5.1.13 |
| OSV | PyPI | django | >= 5.2, < 5.2.7 | 5.2.7 |
| OSV | 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 |
References
- https://docs.djangoproject.com/en/dev/releases/security/ · Vendor Advisory, WEB, ADVISORY
- https://groups.google.com/g/django-announce · Release Notes, Vendor Advisory, WEB, ADVISORY
- https://www.djangoproject.com/weblog/2025/oct/01/security-releases/ · Release Notes, Vendor Advisory, WEB, ADVISORY
- http://www.openwall.com/lists/oss-security/2025/10/01/3 · WEB
- https://nvd.nist.gov/vuln/detail/CVE-2025-59681 · ADVISORY
- https://github.com/django/django/commit/41b43c74bda19753c757036673ea9db74acf494a · WEB
- https://github.com/django/django/commit/43d84aef04a9e71164c21a74885996981857e66e · WEB
- https://github.com/django/django · PACKAGE
- https://github.com/pypa/advisory-database/tree/main/vulns/django/PYSEC-2025-106.yaml · WEB
- https://github.com/advisories/GHSA-hpr9-3m2g-3j9p · ADVISORY
History
- 25 Nov 2026 20:59 UTC · NVD: first stored (published 1 Oct 2025)
- 25 Nov 2026 20:12 UTC · OSV: first stored (published 1 Oct 2025)
- 25 Nov 2026 20:11 UTC · OSV: first stored (published 1 Oct 2025)