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).
{
"osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2025/59xxx/CVE-2025-59681.json",
"cwe_ids": [
"CWE-89"
],
"cna_assigner": "mitre",
"unresolved_ranges": [
{
"extracted_events": [
{
"introduced": "4.2"
},
{
"fixed": "4.2.25"
},
{
"introduced": "5.1"
},
{
"fixed": "5.1.13"
},
{
"introduced": "5.2"
},
{
"fixed": "5.2.7"
}
],
"source": "AFFECTED_FIELD"
},
{
"extracted_events": [
{
"introduced": "4.2"
},
{
"fixed": "4.2.25"
},
{
"introduced": "5.1"
},
{
"fixed": "5.1.13"
},
{
"introduced": "5.2"
},
{
"fixed": "5.2.7"
}
],
"source": "CPE_FIELD"
},
{
"extracted_events": [
{
"introduced": "4.2"
},
{
"fixed": "4.2.25"
},
{
"introduced": "5.1"
},
{
"fixed": "5.1.13"
},
{
"introduced": "5.2"
},
{
"fixed": "5.2.7"
}
],
"source": "DESCRIPTION"
}
]
}{
"extracted_events": [
{
"introduced": "4.2"
},
{
"fixed": "4.2.25"
},
{
"introduced": "5.1"
},
{
"fixed": "5.1.13"
},
{
"introduced": "5.2"
},
{
"fixed": "5.2.7"
}
],
"source": "CPE_FIELD",
"cpe": "cpe:2.3:a:djangoproject:django:*:*:*:*:*:*:*:*"
}