Description
An issue was discovered in 5.1 before 5.1.14, 4.2 before 4.2.26, and 5.2 before 5.2.8.
The methods `QuerySet.filter()`, `QuerySet.exclude()`, and `QuerySet.get()`, and the class `Q()`, are subject to SQL injection when using a suitably crafted dictionary, with dictionary expansion, as the `_connector` argument.
Earlier, unsupported Django series (such as 5.0.x, 4.1.x, and 3.2.x) were not evaluated and may also be affected.
Django would like to thank cyberstan for reporting this issue.
Affected products
| Vendor | Product | Affected | Fixed |
|---|---|---|---|
| djangoproject | Django | 5.2 – < 5.2.8, 5.1 – < 5.1.14, 4.2 – < 4.2.26 | 5.2.8 |
Fixed in Linux distributions
Distributions backport fixes, so the version that fixes this vulnerability differs per release — upgrade to at least the version shown. From the distributions' security trackers and advisories.
Debian
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Debian 14 | python-django | 3:4.2.26-1 | — |
| Debian 13 | python-django | 3:4.2.27-0+deb13u1 | DSA-6117-1 |
| Debian 12 | python-django | 3:3.2.25-0+deb12u1 | DSA-6136-1 |
| Debian 11 | python-django | 2:2.2.28-1~deb11u10 | DLA-4425-1 |
Ubuntu
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Ubuntu 25.10 | python-django | 3:5.2.4-1ubuntu2.1 | USN-7859-1 |
| Ubuntu 24.04 LTS | python-django | 3:4.2.11-1ubuntu1.12 | USN-7859-1 |
| Ubuntu 22.04 LTS | python-django | 2:3.2.12-2ubuntu1.23 | USN-7859-1 |
Show 1 more (older releases, extended support, other products)Fewer releases
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Ubuntu Pro 20.04 LTS | python-django | 2:2.2.12-1ubuntu0.29+esm5 | USN-7859-1 |
Red Hat
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Red Hat Ansible Automation Platform Inside 2 | ansible-builder | 3.1.1-1.el8ap | RHSA-2025:23069 |
| Red Hat Ansible Automation Platform Inside 2 | ansible-lint +2 | 25.12.0-1.el8ap | RHSA-2025:23069 |
| Red Hat Ansible Automation Platform Inside 2 | ansible-runner +1 | 2.4.2-1.el8ap | RHSA-2025:23069 |
| Red Hat Ansible Automation Platform Inside 2 | ansible-sign | 0.1.4-1.el8ap | RHSA-2025:23069 |
| Red Hat Ansible Automation Platform Inside 2 | bindep | 2.13.0-1.el8ap | RHSA-2025:23069 |
| Red Hat Ansible Automation Platform Inside 2 | python3.11-distlib | 0.4.0-1.el8ap | RHSA-2025:23069 |
| Red Hat Ansible Automation Platform Inside 2 | python3.11-ruamel-yaml-clib | 0.2.15-1.el8ap | RHSA-2025:23069 |
| Red Hat Ansible Automation Platform Inside 2 | python3.11-subprocess-tee | 0.4.2-1.el8ap | RHSA-2025:23069 |
| Red Hat Ansible Automation Platform Inside 2 | python3.11-typing-extensions | 4.15.0-1.el8ap | RHSA-2025:23069 |
| Red Hat Ansible Automation Platform Inside 2 | receptor +1 | 1.6.2-1.el8ap | RHSA-2025:23069 |
| Red Hat Ansible Automation Platform Developer 2 | ansible-builder | 3.1.1-1.el8ap | RHSA-2025:23069 |
| Red Hat Ansible Automation Platform Developer 2 | ansible-dev-environment | 25.12.2-1.1.el8ap | RHSA-2025:23069 |
| Red Hat Ansible Automation Platform Developer 2 | ansible-runner +1 | 2.4.2-1.el8ap | RHSA-2025:23069 |
| Red Hat Ansible Automation Platform Developer 2 | ansible-sign | 0.1.4-1.el8ap | RHSA-2025:23069 |
| Red Hat Ansible Automation Platform Developer 2 | automation-controller +1 | 4.6.23-1.el8ap | RHSA-2025:23069 |
| Red Hat Ansible Automation Platform Developer 2 | bindep | 2.13.0-1.el8ap | RHSA-2025:23069 |
| Red Hat Ansible Automation Platform Developer 2 | molecule +7 | 25.12.0-1.el8ap | RHSA-2025:23069 |
| Red Hat Ansible Automation Platform Developer 2 | python3.11-distlib | 0.4.0-1.el8ap | RHSA-2025:23069 |
| Red Hat Ansible Automation Platform Developer 2 | python3.11-django | 4.2.26-1.el8ap | RHSA-2025:23070, RHSA-2025:23069 |
| Red Hat Ansible Automation Platform Developer 2 | python3.11-execnet | 2.1.2-1.el8ap | RHSA-2025:23069 |
| Red Hat Ansible Automation Platform Developer 2 | python3.11-gunicorn | 23.0.0-1.el8ap | RHSA-2025:23069 |
| Red Hat Ansible Automation Platform Developer 2 | python3.11-pluggy | 1.6.0-1.el8ap | RHSA-2025:23069 |
| Red Hat Ansible Automation Platform Developer 2 | python3.11-pytest | 9.0.1-1.el8ap | RHSA-2025:23069 |
| Red Hat Ansible Automation Platform Developer 2 | python3.11-pytest-xdist | 3.8.0-1.el8ap | RHSA-2025:23069 |
| Red Hat Ansible Automation Platform Developer 2 | python3.11-ruamel-yaml-clib | 0.2.15-1.el8ap | RHSA-2025:23069 |
| Red Hat Ansible Automation Platform Developer 2 | python3.11-subprocess-tee | 0.4.2-1.el8ap | RHSA-2025:23069 |
| Red Hat Ansible Automation Platform Developer 2 | python3.11-tox-ansible | 25.12.0-1.2.el8ap | RHSA-2025:23069 |
| Red Hat Ansible Automation Platform Developer 2 | python3.11-typing-extensions | 4.15.0-1.el8ap | RHSA-2025:23069 |
| Red Hat Ansible Automation Platform Developer 2 | receptor +1 | 1.6.2-1.el8ap | RHSA-2025:23069 |
| Red Hat Ansible Automation Platform 2 | ansible-automation-platform-installer | 2.5-20.el8ap | RHSA-2025:23069 |
| Red Hat Ansible Automation Platform 2 | ansible-builder | 3.1.1-1.el8ap | RHSA-2025:23069 |
| Red Hat Ansible Automation Platform 2 | ansible-dev-environment | 25.12.2-1.1.el8ap | RHSA-2025:23069 |
| Red Hat Ansible Automation Platform 2 | ansible-runner +1 | 2.4.2-1.el8ap | RHSA-2025:23069 |
| Red Hat Ansible Automation Platform 2 | ansible-sign | 0.1.4-1.el8ap | RHSA-2025:23069 |
| Red Hat Ansible Automation Platform 2 | automation-controller +4 | 4.6.23-1.el8ap | RHSA-2025:23070, RHSA-2025:23069 |
| Red Hat Ansible Automation Platform 2 | automation-controller-fapolicyd | 1.0-5.el8ap | RHSA-2025:23069 |
| Red Hat Ansible Automation Platform 2 | automation-eda-controller +4 | 1.1.14-1.el8ap | RHSA-2025:23069 |
| Red Hat Ansible Automation Platform 2 | automation-gateway +13 | 2.5.20251210-1.el8ap | RHSA-2025:23069 |
| Red Hat Ansible Automation Platform 2 | automation-hub +1 | 4.10.10-1.el8ap | RHSA-2025:23069 |
| Red Hat Ansible Automation Platform 2 | bindep | 2.13.0-1.el8ap | RHSA-2025:23069 |
| Red Hat Ansible Automation Platform 2 | molecule +7 | 25.12.0-1.el8ap | RHSA-2025:23069 |
| Red Hat Ansible Automation Platform 2 | python3.11-distlib | 0.4.0-1.el8ap | RHSA-2025:23069 |
| Red Hat Ansible Automation Platform 2 | python3.11-django | 4.2.26-1.el8ap | RHSA-2025:23070, RHSA-2025:23069 |
| Red Hat Ansible Automation Platform 2 | python3.11-execnet | 2.1.2-1.el8ap | RHSA-2025:23069 |
| Red Hat Ansible Automation Platform 2 | python3.11-galaxy-importer | 0.4.36-2.el8ap | RHSA-2025:23069 |
| Red Hat Ansible Automation Platform 2 | python3.11-gunicorn | 23.0.0-1.el8ap | RHSA-2025:23069 |
| Red Hat Ansible Automation Platform 2 | python3.11-pluggy | 1.6.0-1.el8ap | RHSA-2025:23069 |
| Red Hat Ansible Automation Platform 2 | python3.11-pytest | 9.0.1-1.el8ap | RHSA-2025:23069 |
| Red Hat Ansible Automation Platform 2 | python3.11-pytest-xdist | 3.8.0-1.el8ap | RHSA-2025:23069 |
| Red Hat Ansible Automation Platform 2 | python3.11-ruamel-yaml-clib | 0.2.15-1.el8ap | RHSA-2025:23069 |
| Red Hat Ansible Automation Platform 2 | python3.11-subprocess-tee | 0.4.2-1.el8ap | RHSA-2025:23069 |
| Red Hat Ansible Automation Platform 2 | python3.11-tox-ansible | 25.12.0-1.2.el8ap | RHSA-2025:23069 |
| Red Hat Ansible Automation Platform 2 | python3.11-typing-extensions | 4.15.0-1.el8ap | RHSA-2025:23069 |
| Red Hat Ansible Automation Platform 2 | receptor +1 | 1.6.2-1.el8ap | RHSA-2025:23069 |
SUSE
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| SLES 15 SP7 | python-Django | 4.2.11-150600.3.41.1 | SUSE-SU-2025:4100-1 |
| SLES 15 SP6 | python-Django | 4.2.11-150600.3.41.1 | SUSE-SU-2025:4100-1 |
openSUSE
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| openSUSE Tumbleweed | python-Django | 5.2.8-1.1 | openSUSE-SU-2025:15712-1 |
| openSUSE Tumbleweed | python-Django4 | 4.2.26-1.1 | openSUSE-SU-2025:15708-1 |
| openSUSE Tumbleweed | python-Django5 | 5.2.16-1.1 | openSUSE-SU-2026:11270-1 |
| openSUSE Tumbleweed | python-Django6 | 6.0-1.1 | openSUSE-SU-2026:10005-1 |
| openSUSE Leap 16.0 | python-Django | 5.2.4-bp160.4.1 | openSUSE-SU-2025:20153-1 |
| openSUSE Leap 15.6 | python-Django | 4.2.11-150600.3.41.1 | SUSE-SU-2025:4100-1 |
Alpine
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Alpine v3.24 | py3-django | 4.2.26-r0 | — |
| Alpine v3.23 | py3-django | 4.2.26-r0 | — |
| Alpine v3.22 | py3-django | 4.2.26-r0 | — |
Public exploits
Exploit or proof-of-concept code for this vulnerability is publicly available, which lowers the bar for attackers. Treat it as a reason to patch sooner.
Exploit-DB 1
- Django 5.1.13 - SQL Injection EDB-52456 · webapps · Dec 3, 2025
GitHub 10 repositories
-
0xCyberstan/CVE-2025-64459-Poc ★ 2 · Dec 1, 2025
Vulnerability: SQL Injection via QuerySet and Q() keyword argument unpacking. CVE ID: CVE-2025-64459 Severity: Critical (CVSS 9.1) Affected Versions: Django 5.1 < 5.1.14, 4.2 < 4.2.26, and 5.2 < 5.2.…
-
omarkurt/django-connector-CVE-2025-64459-testbed ★ 2 · Nov 21, 2025
A self-contained testbed for Django CVE-2025-64459. Demonstrates QuerySet.filter() parameter injection via dictionary expansion using Docker.
-
nunpa/CVE-2025-64459 ★ 1 · Nov 10, 2025
check if vulnerable python-django version to CVE-2025-64459 bug
-
YouGina/CVE-2025-64459 ★ 0 · Aug 11, 2026
CVE-2025-64459 vulnerable by design app
-
rafaelchriss/RedTeamBrasil-CVE-2025-64459 ★ 0 · Jul 7, 2026
NEO-SQLi — exploit Django _connector SQL Injection (CVE-2025-64459) | canal RedTeam Brasil
-
joshualent/django-cve-2025-64459 ★ 0 · Mar 9, 2026
demo application showing off SQL Injection exploit in django 5.2.7
-
purehate/CVE-2025-64459-hunter ★ 0 · Jan 14, 2026
CVE-2025-64459-hunter
-
alxsourin/Helpdesk-Telecom-CVE-2025-64459 ★ 0 · Jan 8, 2026
-
Z3YR0xX/CVE-2025-64459 ★ 0 · Dec 5, 2025
-
rockmelodies/django_sqli_target_CVE-2025-64459 ★ 0 · Nov 6, 2025
Sources: PoC-in-GitHub, Metasploit Framework, Exploit-DB — updated daily. Only links are listed; no exploit code is hosted here.
Affected packages
| Ecosystem | Package | Affected | Fixed | Record |
|---|---|---|---|---|
| PyPI | django | >= 5.2a1, < 5.2.8 | 5.2.8 | GHSA-frmv-pr5f-9mcr |
| PyPI | django | >= 5.0a1, < 5.1.14 | 5.1.14 | GHSA-frmv-pr5f-9mcr |
| PyPI | django | < 4.2.26 | 4.2.26 | GHSA-frmv-pr5f-9mcr |
| PyPI | django | >= 4.2, < 4.2.26 · >= 5.1, < 5.1.14 · >= 5.2, < 5.2.8 | 4.2.26, 5.1.14, 5.2.8 | PYSEC-2025-108 |
Advisories 13
- RHSA-2025:23069 Red Hat Security Advisory: Red Hat Ansible Automation Platform 2.5 Product Security and Bug Fix Update Red Hat Security Advisories (RHSA) · Oct 9, 2026
- openSUSE-SU-2026:11270-1 python313-Django5-5.2.16-1.1 on GA media SUSE / openSUSE Security Updates · Jul 15, 2026
- RHSA-2025:23070 Red Hat Security Advisory: Red Hat Ansible Automation Platform 2.6 Product Security and Bug Fix Update Red Hat Security Advisories (RHSA) · Jun 29, 2026
- openSUSE-SU-2026:10005-1 python312-Django6-6.0-1.1 on GA media SUSE / openSUSE Security Updates · Mar 23, 2026
- openSUSE-SU-2025:20153-1 Security update for python-Django SUSE / openSUSE Security Updates · Mar 23, 2026
- openSUSE-SU-2025:15708-1 python311-Django4-4.2.26-1.1 on GA media SUSE / openSUSE Security Updates · Mar 23, 2026
- openSUSE-SU-2025:15712-1 python311-Django-5.2.8-1.1 on GA media SUSE / openSUSE Security Updates · Mar 23, 2026
- SUSE-SU-2025:4100-1 Security update for python-Django SUSE / openSUSE Security Updates · Mar 23, 2026
- DSA-6136-1 python-django - security update Debian Security (DSA / DLA) · Feb 15, 2026
- USN-7859-1 python-django vulnerabilities Ubuntu Security Notices (USN) · Feb 10, 2026
- WID-SEC-2025-2495 Django: Mehrere Schwachstellen ermöglichen Denial of Service und SQL-Injection BSI CERT-Bund (WID) · Feb 1, 2026
- DSA-6117-1 python-django - security update Debian Security (DSA / DLA) · Jan 31, 2026
- DLA-4425-1 python-django - security update Debian Security (DSA / DLA) · Dec 29, 2025
References
- Django security archive vendor-advisory
- Django releases announcements mailing-list
- Django security releases issued: 5.2.8, 5.1.14, and 4.2.26 vendor-advisory