CVE-2025-59681 Details
Description
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).
A SQL injection vulnerability has been identified in Django versions 4.2 prior to 4.2.25, 5.1 prior to 5.1.13, and 5.2 prior to 5.2.7. The issue arises in the QuerySet methods annotate(), alias(), aggregate(), and extra(), when a crafted dictionary is used with dictionary expansion as keyword arguments. This vulnerability allows attackers to manipulate column aliases, leading to SQL injection on MySQL and MariaDB databases.
Users can upgrade to Django versions 4.2.25, 5.1.13, or 5.2.7, where this vulnerability has been patched.
Metrics
CVSS 4.0 Severity and Vector Strings:
No CVSS 4.0 data is available for this CVE.
CVSS 3.x Severity and Vector Strings:
No data available for CVSS Version 2.0 on this CVE.
CISA-ADP
Assessed Oct 1, 2025References to Advisories, Solutions, and Tools
By selecting these links, you will be leaving this site. These are references gathered from the official CVE record and are not endorsed by Volerion.
| URL | Source(s) | Tag(s) |
|---|---|---|
| http://www.openwall.com/lists/oss-security/2025/10/01/3 | CVE | |
| https://docs.djangoproject.com/en/dev/releases/security/ | [email protected] | Vendor Advisory |
| https://groups.google.com/g/django-announce | [email protected] | Release NotesVendor Advisory |
| https://www.djangoproject.com/weblog/2025/oct/01/security-releases/ | [email protected] | Release NotesVendor Advisory |
Weakness Enumeration
| CWE-ID | CWE Name | Source |
|---|---|---|
| CWE-89 | Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection') | [email protected] |
Affected Products
| Product | Versions |
|---|---|
| djangoproject django | >= 4.2, < 4.2.25 >= 5.1, < 5.1.13 >= 5.2, < 5.2.7 |
CPE
Remediation
| |
Change History
6 change records found show changes
| Date | Action | Recorded By |
|---|---|---|
| Oct 12, 2026 | CVE Translated | [email protected] |
| Jun 17, 2026 | CVE Modified | [email protected] |
| Jun 17, 2026 | CVE Modified | CISA-ADP |
| Nov 4, 2025 | CVE Modified | CVE |
| Oct 7, 2025 | Initial Analysis | [email protected] |
| Oct 1, 2025 | New CVE Received | [email protected] |