CVE-2025-59681
published high CVSS 3.1 · 7.1django: Potential SQL injection in QuerySet.annotate(), alias(), aggregate(), and extra() on MySQL and MariaDB1
Package status and fixes
| Distro / vendor | Release | Package / product | Publisher status | Fixed build | Source |
|---|---|---|---|---|---|
| djangoproject | — | Django4.2 to < 4.2.25 · 5.1 to < 5.1.13 · 5.2 to < 5.2.7 · Other versions: unknown | Affected | Not stated | mitre |
| Alpine Linux | edge | py3-django | Fixed | 4.2.25-r0 | Package fix record |
| Debian | bookworm | python-django | Advisory build | 3:3.2.25-0+deb12u1 | DSA-6136-1 |
| SUSE / openSUSE | SLE-15-SP6 | python311-Djangonoarch | Advisory build | 4.2.11-150600.3.33.1 | SUSE-SU-2025:03446-1 |
| Ubuntu | bionic | python-django | Advisory build | 1:1.11.11-1ubuntu1.21+esm12 | USN-7794-1 |
| Alpine Linux | v3.22 | py3-django | Fixed | 4.2.25-r0 | Package fix record |
| Alpine Linux | v3.23 | py3-django | Fixed | 4.2.25-r0 | Package fix record |
| Alpine Linux | v3.24 | py3-django | Fixed | 4.2.25-r0 | Package fix record |
Show 57 more entries
| Distro / vendor | Release | Package / product | Publisher status | Fixed build | Source |
|---|---|---|---|---|---|
| Debian | bullseye | python-django | Advisory build | 2:2.2.28-1~deb11u9 | DLA-4324-1 |
| Debian | trixie | python-django | Advisory build | 3:4.2.27-0+deb13u1 | DSA-6117-1 |
| SUSE / openSUSE | SLE-15-SP7 | python311-Djangonoarch | Advisory build | 4.2.11-150600.3.33.1 | SUSE-SU-2025:03446-1 |
| SUSE / openSUSE | openSUSE-Leap-15.6 | python311-Djangonoarch | Advisory build | 4.2.11-150600.3.33.1 | SUSE-SU-2025:03446-1 |
| SUSE / openSUSE | openSUSE-Leap-16.0 | python313-Djangonoarch | Advisory build | 5.2.4-bp160.3.1 | OPENSUSE-SU-2025:20022-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python311-Djangoaarch64 | Advisory build | 5.2.7-1.1 | OPENSUSE-SU-2025:15598-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python311-Djangoppc64le | Advisory build | 5.2.7-1.1 | OPENSUSE-SU-2025:15598-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python311-Djangos390x | Advisory build | 5.2.7-1.1 | OPENSUSE-SU-2025:15598-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python311-Djangox86_64 | Advisory build | 5.2.7-1.1 | OPENSUSE-SU-2025:15598-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python311-Django4aarch64 | Advisory build | 4.2.25-1.1 | OPENSUSE-SU-2025:15596-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python311-Django4ppc64le | Advisory build | 4.2.25-1.1 | OPENSUSE-SU-2025:15596-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python311-Django4s390x | Advisory build | 4.2.25-1.1 | OPENSUSE-SU-2025:15596-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python311-Django4x86_64 | Advisory build | 4.2.25-1.1 | OPENSUSE-SU-2025:15596-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python312-Djangoaarch64 | Advisory build | 5.2.7-1.1 | OPENSUSE-SU-2025:15598-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python312-Djangoppc64le | Advisory build | 5.2.7-1.1 | OPENSUSE-SU-2025:15598-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python312-Djangos390x | Advisory build | 5.2.7-1.1 | OPENSUSE-SU-2025:15598-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python312-Djangox86_64 | Advisory build | 5.2.7-1.1 | OPENSUSE-SU-2025:15598-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python312-Django4aarch64 | Advisory build | 4.2.25-1.1 | OPENSUSE-SU-2025:15596-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python312-Django4ppc64le | Advisory build | 4.2.25-1.1 | OPENSUSE-SU-2025:15596-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python312-Django4s390x | Advisory build | 4.2.25-1.1 | OPENSUSE-SU-2025:15596-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python312-Django4x86_64 | Advisory build | 4.2.25-1.1 | OPENSUSE-SU-2025:15596-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python312-Django6aarch64 | Advisory build | 6.0-1.1 | OPENSUSE-SU-2026:10005-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python312-Django6ppc64le | Advisory build | 6.0-1.1 | OPENSUSE-SU-2026:10005-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python312-Django6s390x | Advisory build | 6.0-1.1 | OPENSUSE-SU-2026:10005-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python312-Django6x86_64 | Advisory build | 6.0-1.1 | OPENSUSE-SU-2026:10005-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python313-Djangoaarch64 | Advisory build | 5.2.7-1.1 | OPENSUSE-SU-2025:15598-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python313-Djangoppc64le | Advisory build | 5.2.7-1.1 | OPENSUSE-SU-2025:15598-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python313-Djangos390x | Advisory build | 5.2.7-1.1 | OPENSUSE-SU-2025:15598-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python313-Djangox86_64 | Advisory build | 5.2.7-1.1 | OPENSUSE-SU-2025:15598-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python313-Django4aarch64 | Advisory build | 4.2.25-1.1 | OPENSUSE-SU-2025:15596-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python313-Django4ppc64le | Advisory build | 4.2.25-1.1 | OPENSUSE-SU-2025:15596-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python313-Django4s390x | Advisory build | 4.2.25-1.1 | OPENSUSE-SU-2025:15596-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python313-Django4x86_64 | Advisory build | 4.2.25-1.1 | OPENSUSE-SU-2025:15596-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python313-Django5aarch64 | Advisory build | 5.2.16-1.1 | OPENSUSE-SU-2026:11270-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python313-Django5ppc64le | Advisory build | 5.2.16-1.1 | OPENSUSE-SU-2026:11270-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python313-Django5s390x | Advisory build | 5.2.16-1.1 | OPENSUSE-SU-2026:11270-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python313-Django5x86_64 | Advisory build | 5.2.16-1.1 | OPENSUSE-SU-2026:11270-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python313-Django6aarch64 | Advisory build | 6.0-1.1 | OPENSUSE-SU-2026:10005-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python313-Django6ppc64le | Advisory build | 6.0-1.1 | OPENSUSE-SU-2026:10005-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python313-Django6s390x | Advisory build | 6.0-1.1 | OPENSUSE-SU-2026:10005-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python313-Django6x86_64 | Advisory build | 6.0-1.1 | OPENSUSE-SU-2026:10005-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python314-Django5aarch64 | Advisory build | 5.2.16-1.1 | OPENSUSE-SU-2026:11270-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python314-Django5ppc64le | Advisory build | 5.2.16-1.1 | OPENSUSE-SU-2026:11270-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python314-Django5s390x | Advisory build | 5.2.16-1.1 | OPENSUSE-SU-2026:11270-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python314-Django5x86_64 | Advisory build | 5.2.16-1.1 | OPENSUSE-SU-2026:11270-1 |
| Ubuntu | bionic | python-django-common | Advisory build | 1:1.11.11-1ubuntu1.21+esm12 | USN-7794-1 |
| Ubuntu | bionic | python3-django | Advisory build | 1:1.11.11-1ubuntu1.21+esm12 | USN-7794-1 |
| Ubuntu | focal | python-django | Advisory build | 2:2.2.12-1ubuntu0.29+esm4 | USN-7794-1 |
| Ubuntu | focal | python3-django | Advisory build | 2:2.2.12-1ubuntu0.29+esm4 | USN-7794-1 |
| Ubuntu | jammy | python-django | Advisory build | 2:3.2.12-2ubuntu1.22 | USN-7794-1 |
| Ubuntu | jammy | python3-django | Advisory build | 2:3.2.12-2ubuntu1.22 | USN-7794-1 |
| Ubuntu | noble | python-django | Advisory build | 3:4.2.11-1ubuntu1.11 | USN-7794-1 |
| Ubuntu | noble | python3-django | Advisory build | 3:4.2.11-1ubuntu1.11 | USN-7794-1 |
| Ubuntu | trusty | python-django | Advisory build | 1.6.11-0ubuntu1.3+esm8 | USN-7794-1 |
| Ubuntu | xenial | python-django | Advisory build | 1.8.7-1ubuntu5.15+esm9 | USN-7794-1 |
| Ubuntu | xenial | python-django-common | Advisory build | 1.8.7-1ubuntu5.15+esm9 | USN-7794-1 |
| Ubuntu | xenial | python3-django | Advisory build | 1.8.7-1ubuntu5.15+esm9 | USN-7794-1 |
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).
Related advisories
Vendor advisories explicitly linked to this CVE.
Assessment
CVSS risk assessment and additional context for this vulnerability.
- CVSS version
- 3.1
- Base score
- 7.1 / 10
- Severity
- high
- Provider
- mitre · cna
- Vector string
- CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:C/C:H/I:L/A:N
Publisher product statements
Version ranges and default statuses as reported by each provider.
| Vendor | Product | Version status | Source |
|---|---|---|---|
| djangoproject | Django | 4.2 to < 4.2.25 (affected · custom)5.1 to < 5.1.13 (affected · custom)5.2 to < 5.2.7 (affected · custom)Default: unknown | mitre · cna |
Weaknesses
1- CWE-89 CWE-89 Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')
References
4Provider assertions
3mitre · cna
CISA-ADP · adp
CISA ADP Vulnrichment
CVE · adp
CVE Program Container
Provenance
- Schema
- 5.2
- Searchable
- yes
- Content hash
- 8bda5c72617afe516272387ba96829ef09e5ae5b4cfef6f7b876d1bc4de65585
- Ingested
- 23 Sep 2026, 08:54:20 UTC
- Source record
- Official CVE record