CVE-2025-59681
October 01, 2025
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).
Affected Packages
https://github.com/django/django.git (GITHUB):
Affected version(s) >=5.1 <5.1.13Fix Suggestion:
Update to version 5.1.13https://github.com/django/django.git (GITHUB):
Affected version(s) >=5.2 <5.2.7Fix Suggestion:
Update to version 5.2.7https://github.com/django/django.git (GITHUB):
Affected version(s) >=4.2 <4.2.25Fix Suggestion:
Update to version 4.2.25django (PYTHON):
Affected version(s) >=4.2 <4.2.25Fix Suggestion:
Update to version 4.2.25django (PYTHON):
Affected version(s) >=5.1 <5.1.13Fix Suggestion:
Update to version 5.1.13django (PYTHON):
Affected version(s) >=5.2 <5.2.7Fix Suggestion:
Update to version 5.2.7Related ResourcesĀ (10)
Do you need more information?
Contact UsCVSS v4
Base Score:
7.1
Attack Vector
NETWORK
Attack Complexity
HIGH
Attack Requirements
NONE
Privileges Required
LOW
User Interaction
NONE
Vulnerable System Confidentiality
HIGH
Vulnerable System Integrity
LOW
Vulnerable System Availability
NONE
Subsequent System Confidentiality
HIGH
Subsequent System Integrity
LOW
Subsequent System Availability
NONE
CVSS v3
Base Score:
7.1
Attack Vector
NETWORK
Attack Complexity
HIGH
Privileges Required
LOW
User Interaction
NONE
Scope
CHANGED
Confidentiality
HIGH
Integrity
LOW
Availability
NONE
Weakness Type (CWE)
Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')
EPSS
Base Score:
0.02