Skip to content
OpenAdvisories
Critical · 9.1 Public exploit CVE-2025-64459 BIT-django-2025-64459EUVD-2025-37763GHSA-frmv-pr5f-9mcrPYSEC-2025-108

Potential SQL injection via _connector keyword argument in QuerySet and Q objects

Published Nov 5, 2025 · Updated Feb 26, 2026 · Assigned by DSF

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

VendorProductAffectedFixed
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.

ReleasePackageFixed inAdvisory
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
ReleasePackageFixed inAdvisory
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)
ReleasePackageFixed inAdvisory
Ubuntu Pro 20.04 LTS python-django 2:2.2.12-1ubuntu0.29+esm5 USN-7859-1
ReleasePackageFixed inAdvisory
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
ReleasePackageFixed inAdvisory
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
ReleasePackageFixed inAdvisory
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
ReleasePackageFixed inAdvisory
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.

Third-party code, not reviewed by us. Public PoCs are sometimes fake or contain malware. Read the code first and run it only in an isolated lab, against systems you are authorised to test.

Exploit-DB 1

GitHub 10 repositories

Sources: PoC-in-GitHub, Metasploit Framework, Exploit-DB — updated daily. Only links are listed; no exploit code is hosted here.

Affected packages

EcosystemPackageAffectedFixedRecord
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

References