CVE-2025-59681

django: Potential SQL injection in QuerySet.annotate(), alias(), aggregate(), and extra() on MySQL and MariaDB1

Published Oct 1, 2025 CVSS 3.1 · 7.1 High EPSS < 1% KEV · Not listed
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).

Remediation

No solution or workaround provided in the CVE record

Tracking

Sign in to view the affected projects.

Advisories

Source ID Title
Debian DLA Debian DLA DLA-4324-1 python-django security update
Debian DSA Debian DSA DSA-6117-1 python-django security update
Debian DSA Debian DSA DSA-6136-1 python-django security update
EUVD EUVD EUVD-2025-32048 Django vulnerable to SQL injection in column aliases
Github GHSA Github GHSA GHSA-hpr9-3m2g-3j9p Django vulnerable to SQL injection in column aliases
Ubuntu USN Ubuntu USN USN-7794-1 Django vulnerabilities
History
Type Values Removed Values Added
CPEs cpe:2.3:a:djangoproject:django:*:*:*:*:*:*:*:*
Type Values Removed Values Added
Title django: Potential SQL injection in QuerySet.annotate(), alias(), aggregate(), and extra() on MySQL and MariaDB1
References
Metrics threat_severity

None

threat_severity

Important

Type Values Removed Values Added
First Time appeared Djangoproject
Djangoproject django
Vendors & Products Djangoproject
Djangoproject django
Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'none', 'Technical Impact': 'partial'}, 'version': '2.0.3'}

Type Values Removed Values Added
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).
Weaknesses CWE-89
References
Metrics cvssV3_1

{'score': 7.1, 'vector': 'CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:C/C:H/I:L/A:N'}

Weaknesses

Sources

Status
PUBLISHED
Assigner
mitre
Published
Updated
Nov 4, 2025, 9:13 PM
Reserved
Sep 18, 2025, 12:00 AM
Status
Modified
Published
Oct 1, 2025, 7:15 PM
Modified
Oct 12, 2026, 3:10 PM
Severity
Important
Public date
Oct 1, 2025, 12:00 AM