CVE-2025-59681
Last modified
CVE-2025-59681 is a critical-severity vulnerability rated 9.8/10 on the CVSS scale. 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).. EPSS estimates a 0.59% chance of exploitation in the next 30 days.
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).
Metrics
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Weakness Enumeration
Affected Software
| Vendor | Product | Versions |
|---|---|---|
| Djangoproject | Django | >= 4.2, < 4.2.25 |
| Djangoproject | Django | >= 5.1, < 5.1.13 |
| Djangoproject | Django | >= 5.2, < 5.2.7 |
References
- https://docs.djangoproject.com/en/dev/releases/security/Vendor Advisory
- https://groups.google.com/g/django-announceRelease Notes, Vendor Advisory
- https://www.djangoproject.com/weblog/2025/oct/01/security-releases/Release Notes, Vendor Advisory
Timeline
- Published
- Last Modified
- Status
- Modified
Frequently Asked Questions
What is CVE-2025-59681?
How severe is CVE-2025-59681?
How do I fix CVE-2025-59681?
Are you affected by CVE-2025-59681?
Run a free Strix scan to check your systems for this vulnerability.
Scan your code nowSource: NVD / NIST
