CVE
CVE-2025-59681
CVE-2025-59681CRIT 9.8EPSS 53%
CNA 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).
Affected versions
- django≥ 5.2, < 5.2.7Fixed in 5.2.7
- django≥ 5.1, < 5.1.13Fixed in 5.1.13
- django≥ 4.2, < 4.2.25Fixed in 4.2.25
Distribution packages (Debian, Ubuntu, Red Hat…) backport fixes without changing the upstream version: check your distribution’s advisory as well.
Advisories and patches
- docs.djangoproject.com/en/dev/releases/security/ · Vendor Advisory
- www.djangoproject.com/weblog/2025/oct/01/security-releases/ · Release Notes, Vendor Advisory
- github.com/advisories/GHSA-hpr9-3m2g-3j9p · Third Party Advisory
- osv.dev/vulnerability/GHSA-hpr9-3m2g-3j9p · Third Party Advisory
- github.com/django/django/commit/41b43c74bda19753c757036673ea9db74acf49 · Vendor Advisory
- github.com/django/django/commit/43d84aef04a9e71164c21a74885996981857e6 · Vendor Advisory
- docs.djangoproject.com/en/dev/releases/security · Vendor Advisory
- www.djangoproject.com/weblog/2025/oct/01/security-releases · Vendor Advisory
- osv.dev/vulnerability/PYSEC-2025-106 · Third Party Advisory
Data: NVD (public domain), CISA KEV (CC0), FIRST EPSS, OSV.dev / GitHub Advisory Database (CC-BY 4.0) · This database lists affected versions and fixes only. It never hosts or links exploit code.