Vulnerability · Published Nov 5, 2025 · Assigned by DSF

CVE-2025-64459Potential SQL injection via _connector keyword argument in QuerySet and Q objects

Critical 9.1

In plain English

A critical-severity SQL injection in Django from djangoproject. There are no confirmed reports of exploitation so far. The chance it is exploited in the next 30 days is estimated at 19.3% (higher than 97% of all known vulnerabilities). Ready-made attack tooling exists: public proof-of-concept code. Fixed versions are available - upgrade the affected package.

Severity (CVSS 3.1)9.1Critical
Exploit odds (30 days)19.3%top 2.7% of all CVEs
Exploited in the wildNo reportsCISA SSVC: none
Attack tooling1Public PoC

Official 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 packages & fixed versions

EcosystemPackageFixed inAdvisory
Alpine:v3.22py3-django4.2.26-r0ALPINE-CVE-2025-64459
Alpine:v3.23py3-django4.2.26-r0ALPINE-CVE-2025-64459
Alpine:v3.24py3-django4.2.26-r0ALPINE-CVE-2025-64459
Debian:12python-django3:3.2.25-0+deb12u1DEBIAN-CVE-2025-64459
Debian:12python-django3:3.2.25-0+deb12u1DSA-6136-1
Debian:13python-django3:4.2.27-0+deb13u1DEBIAN-CVE-2025-64459
Debian:13python-django3:4.2.27-0+deb13u1DSA-6117-1
Debian:14python-django3:4.2.26-1DEBIAN-CVE-2025-64459
PyPIdjango5.2.8GHSA-frmv-pr5f-9mcr
PyPIdjango5.1.14GHSA-frmv-pr5f-9mcr
PyPIdjango4.2.26GHSA-frmv-pr5f-9mcr
PyPIdjango4.2.26, 5.1.14, 5.2.8PYSEC-2025-108
Ubuntu:22.04:LTSpython-django2:3.2.12-2ubuntu1.23UBUNTU-CVE-2025-64459
Ubuntu:22.04:LTSpython-django2:3.2.12-2ubuntu1.23USN-7859-1
Ubuntu:24.04:LTSpython-django3:4.2.11-1ubuntu1.12UBUNTU-CVE-2025-64459
Ubuntu:24.04:LTSpython-django3:4.2.11-1ubuntu1.12USN-7859-1
Ubuntu:25.10python-django3:5.2.4-1ubuntu2.1USN-7859-1
Ubuntu:25.10python-django3:5.2.4-1ubuntu2.1UBUNTU-CVE-2025-64459

Affected products (as reported)

VendorProductVersions
djangoproject Django 5.2 – before 5.2.85.1 – before 5.1.144.2 – before 4.2.26

Weakness: CWE-89 · Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N

References