CVE-2025-59681
Django vulnerability analysis and mitigation

Overview

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. The vulnerability affects QuerySet.annotate(), QuerySet.alias(), QuerySet.aggregate(), and QuerySet.extra() methods when using MySQL and MariaDB databases. The vulnerability was discovered by sw0rd1ight and publicly disclosed on October 1, 2025 (Django Weblog).

Technical details

The vulnerability allows SQL injection attacks through column aliases when using a specially crafted dictionary with dictionary expansion as **kwargs passed to the affected QuerySet methods (annotate(), alias(), aggregate(), and extra()) specifically on MySQL and MariaDB backends. The issue has been rated as 'High' severity according to Django's security policy. The vulnerability has been assigned a CVSS v3.1 base score of 7.1 (High) with the vector string CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:C/C:H/I:L/A:N (NVD).

Impact

The SQL injection vulnerability could allow attackers to manipulate SQL queries, potentially leading to unauthorized data access or data manipulation in Django applications running on MySQL and MariaDB databases. The CVSS score indicates high confidentiality impact and low integrity impact, with no availability impact (Security Online).

Mitigation and workarounds

The Django team has released patched versions to address this vulnerability: Django 5.2.7, Django 5.1.13, and Django 4.2.25. Users are strongly encouraged to upgrade to these versions immediately. The fixes have been applied to Django's main, 6.0 (alpha), 5.2, 5.1, and 4.2 branches (Django Weblog).

Additional resources


SourceThis report was generated using AI

Related Django vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2025-59681HIGH7.1
  • DjangoDjango
  • python-django
NoYesOct 01, 2025
CVE-2025-57833HIGH7.1
  • DjangoDjango
  • django
NoYesSep 03, 2025
CVE-2025-32873MEDIUM5.3
  • DjangoDjango
  • python-django4.2
NoYesMay 08, 2025
CVE-2025-48432MEDIUM4
  • DjangoDjango
  • python-django4.2
NoYesJun 05, 2025
CVE-2025-59682LOW3.1
  • DjangoDjango
  • django
NoYesOct 01, 2025

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management