cve.bz

CVE-2025-64459 djangoproject django: SQL Injection

9.1 criticalExploitEPSS 19%Fix available

Critical (9.1) in djangoproject django. EPSS 19% estimated probability of exploitation activity in the next 30 days. Fixed in django 4.2.26, 5.1.14, 5.2.8.

On this page
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.

Severity

CVSS 3.1

9.1 critical
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N
EPSS
19% (unchanged from 19% a week ago; 19% 30 days ago) estimated probability of exploitation activity in the next 30 days; 97th percentile. Scored 2026-11-22. A forecast for this CVE across the internet, not for your own systems.
CISA's assessment (SSVC)
Exploitation: none · Automatable: yes · Technical impact: total, assessed 2025-11-06. From CISA's Vulnrichment in the CVE List: whether it is exploited, whether exploiting it can be automated, and how much control it gives.
CWE
CWE-89 Improper Neutralization of Special Elements used in an SQL Command (SQL Injection)
OWASP Top 10
A05:2025 Injection
Published
Modified
NVD analysis
Analyzed
Record from
the NVD, synced

Fix and patched versions

Ask an AI about this CVE

Show the promptExplain CVE-2025-64459 for an engineer deciding whether to act. Use https://cve.bz/api/public/cves/CVE-2025-64459?via=ask-ai-copy and https://cve.bz/cve/CVE-2025-64459?via=ask-ai-copy as the source of truth: what is affected and which versions fix it, whether it is in CISA KEV, public exploits, and its EPSS (an internet-wide 30-day estimate of exploitation activity, not a forecast for my systems). If they give no fixed versions, use the CVE record https://cveawg.mitre.org/api/cve/CVE-2025-64459 or the vendor advisory, not third-party mirrors. Tell me how to check whether I am affected and how to verify a fix. Cite the sources and say where they are uncertain.

Opens a third-party assistant; its answer is its own, not cve.bz's. The prompt holds only this CVE's id and public links.

Affected

Versions

From the CNA's record in the CVE List.

ProductAffected
djangoproject Djangofrom 5.2 before 5.2.8
djangoproject Djangofrom 5.1 before 5.1.14
djangoproject Djangofrom 4.2 before 4.2.26

Packages (OSV)

AdvisoryEcosystemPackageAffectedFixed in
GHSA-frmv-pr5f-9mcrPyPIdjango>=5.2a1 <5.2.85.2.8
GHSA-frmv-pr5f-9mcrPyPIdjango>=5.0a1 <5.1.145.1.14
GHSA-frmv-pr5f-9mcrPyPIdjango<4.2.264.2.26
PYSEC-2025-108PyPIdjango>=4.2 <4.2.26
>=5.1 <5.1.14
>=5.2 <5.2.8
4.2.26, 5.1.14, 5.2.8

Linux distributions

DistributionReleasePackageFixed inAdvisory
Debian11python-django2:2.2.28-1~deb11u10DLA-4425-1
Debian12python-django3:3.2.25-0+deb12u1DEBIAN-CVE-2025-64459 DSA-6136-1
Debian13python-django3:4.2.27-0+deb13u1DEBIAN-CVE-2025-64459 DSA-6117-1
Debian14python-django3:4.2.26-1DEBIAN-CVE-2025-64459
Ubuntu22.04:LTSpython-django2:3.2.12-2ubuntu1.23UBUNTU-CVE-2025-64459 USN-7859-1
Ubuntu24.04:LTSpython-django3:4.2.11-1ubuntu1.12UBUNTU-CVE-2025-64459 USN-7859-1
Ubuntu25.10python-django3:5.2.4-1ubuntu2.1UBUNTU-CVE-2025-64459 USN-7859-1
UbuntuPro:20.04:LTSpython-django2:2.2.12-1ubuntu0.29+esm5UBUNTU-CVE-2025-64459 USN-7859-1
Red Hatansible_automation_platform:2.5::el8ansible-automation-platform-installer0:2.5-20.el8apRHSA-2025:23069
Red Hatansible_automation_platform:2.5::el8automation-controller, automation-controller-ui, automation-controller-cli and 2 more0:4.6.23-1.el8apRHSA-2025:23069
Red Hatansible_automation_platform:2.5::el8automation-controller-fapolicyd0:1.0-5.el8apRHSA-2025:23069
Red Hatansible_automation_platform:2.5::el8automation-eda-controller, automation-eda-controller-base, automation-eda-controller-base-services and 2 more0:1.1.14-1.el8apRHSA-2025:23069
Red Hatansible_automation_platform:2.5::el8automation-gateway, automation-gateway-config, automation-gateway-server and 11 more0:2.5.20251210-1.el8apRHSA-2025:23069
Red Hatansible_automation_platform:2.5::el8automation-hub, python3.11-galaxy-ng0:4.10.10-1.el8apRHSA-2025:23069
Red Hatansible_automation_platform:2.5::el8python3.11-galaxy-importer0:0.4.36-2.el8apRHSA-2025:23069
Red Hatansible_automation_platform:2.5::el8receptor, receptorctl, receptor-debuginfo and 1 more0:1.6.2-1.el8apRHSA-2025:23069
Red Hatansible_automation_platform:2.5::el8, ansible_automation_platform_developer:2.5::el8ansible-dev-environment0:25.12.2-1.1.el8apRHSA-2025:23069
Red Hatansible_automation_platform:2.5::el8, ansible_automation_platform_developer:2.5::el8molecule, ansible-lint, ansible-creator and 5 more0:25.12.0-1.el8apRHSA-2025:23069
Red Hatansible_automation_platform:2.5::el8, ansible_automation_platform_developer:2.5::el8python3.11-django0:4.2.26-1.el8apRHSA-2025:23069
Red Hatansible_automation_platform:2.5::el8, ansible_automation_platform_developer:2.5::el8python3.11-execnet0:2.1.2-1.el8apRHSA-2025:23069
46 more for Red Hat in the JSON and on Red Hat's page.
SUSELinux Enterprise Module for Package Hub 15 SP6, Linux Enterprise Module for Package Hub 15 SP7python-Django4.2.11-150600.3.41.1SUSE-SU-2025:4100-1
openSUSELeap 15.6python-Django4.2.11-150600.3.41.1SUSE-SU-2025:4100-1
openSUSELeap 16.0python-Django5.2.4-bp160.4.1openSUSE-SU-2025:20153-1
openSUSETumbleweedpython-Django5.2.8-1.1openSUSE-SU-2025:15712-1
openSUSETumbleweedpython-Django44.2.26-1.1openSUSE-SU-2025:15708-1
openSUSETumbleweedpython-Django55.2.16-1.1openSUSE-SU-2026:11270-1
openSUSETumbleweedpython-Django66.0-1.1openSUSE-SU-2026:10005-1
Alpinev3.22, v3.23, v3.24py3-django4.2.26-r0ALPINE-CVE-2025-64459

From the distributions' data via OSV.dev: the Debian Security Tracker; Ubuntu Security Notices © Canonical Ltd., CC BY-SA 4.0; Red Hat Security Data © Red Hat, Inc., CC BY 4.0; SUSE security data, CC BY 4.0; the Alpine secdb, CC BY-SA 4.0. Modified: reformatted and linked to CVE records. Credits. On the distributions' own pages: Debian · Ubuntu · Red Hat · SUSE · openSUSE · Alpine.

Red Hat

Red Hat rates this Important.

Red Hat's statement

The impact of this vulnerability on Red Hat products is limited to the effective user scope of the running process.

Red Hat's mitigation

Mitigation for this issue is either not available or the currently available options do not meet the Red Hat Product Security criteria comprising ease of use and deployment, applicability to widespread installation base or stability.

ProductPackageStateAdvisory
Red Hat Ansible Automation Platform 2.5 for RHEL 8ansible-automation-platform-installer-0:2.5-20.el8apFixed 2025-12-10RHSA-2025:23069
Red Hat Ansible Automation Platform 2.5 for RHEL 8ansible-builder-0:3.1.1-1.el8apFixed 2025-12-10RHSA-2025:23069
Red Hat Ansible Automation Platform 2.5 for RHEL 8ansible-creator-0:25.12.0-1.el8apFixed 2025-12-10RHSA-2025:23069
Red Hat Ansible Automation Platform 2.5 for RHEL 8ansible-dev-environment-0:25.12.2-1.1.el8apFixed 2025-12-10RHSA-2025:23069
Red Hat Ansible Automation Platform 2.5 for RHEL 8ansible-dev-tools-0:25.12.0-1.el8apFixed 2025-12-10RHSA-2025:23069
Red Hat Ansible Automation Platform 2.5 for RHEL 8ansible-lint-0:25.12.0-1.el8apFixed 2025-12-10RHSA-2025:23069
Red Hat Ansible Automation Platform 2.5 for RHEL 8ansible-navigator-0:25.12.0-1.el8apFixed 2025-12-10RHSA-2025:23069
Red Hat Ansible Automation Platform 2.5 for RHEL 8ansible-runner-0:2.4.2-1.el8apFixed 2025-12-10RHSA-2025:23069
Red Hat Ansible Automation Platform 2.5 for RHEL 8ansible-sign-0:0.1.4-1.el8apFixed 2025-12-10RHSA-2025:23069
Red Hat Ansible Automation Platform 2.5 for RHEL 8automation-controller-0:4.6.23-1.el8apFixed 2025-12-10RHSA-2025:23069
OpenShift Service Mesh 2openshift-service-mesh/grafana-rhel8Not affected
OpenShift Service Mesh 2openshift-service-mesh/istio-cni-rhel8Not affected
OpenShift Service Mesh 2openshift-service-mesh/istio-must-gather-rhel9Not affected
OpenShift Service Mesh 2openshift-service-mesh/istio-operator-bundleNot affected
OpenShift Service Mesh 2openshift-service-mesh/istio-rhel8-operatorNot affected
OpenShift Service Mesh 2openshift-service-mesh/pilot-rhel8Not affected
OpenShift Service Mesh 2openshift-service-mesh/proxyv2-rhel9Not affected
OpenShift Service Mesh 2openshift-service-mesh/ratelimit-rhel8Not affected
OpenShift Service Mesh 3openshift-service-mesh/istio-cni-rhel9Not affected
OpenShift Service Mesh 3openshift-service-mesh/istio-must-gather-rhel9Not affected
112 more in the JSON and on Red Hat's page.

Contains Red Hat Security Data © Red Hat, Inc., licensed under CC BY 4.0. Source: https://access.redhat.com/security/data. Modified: reformatted. Red Hat's page for CVE-2025-64459.

Public exploits

GitHub PoC

Repositories on GitHub named after this CVE or listed for it by the PoC-in-GitHub index. For those marked Harbor Check: matches CVE, Flawharbor read the code and found it implements this CVE's exploitation technique: read, not run, and its dependencies only checked for warning signs, so a pointer and no guarantee. The rest are unverified: some hold a working proof of concept, some nothing useful, and some malware made to look like one. Read the code before you run any of it. How Harbor Check reads them, and what it found.

  • 0xCyberstan/CVE-2025-64459-Poc Harbor Check: matches CVE 2 stars, Python, created
    Vulnerability: SQL Injection via QuerySet and Q() keyword argument unpacking. CVE ID: CVE-2025-64459 Severity: Critical (CVSS 9.1) Affected…
  • rafaelchriss/RedTeamBrasil-CVE-2025-64459 Harbor Check: matches CVE 0 stars, Python, created
    NEO-SQLi — exploit Django _connector SQL Injection (CVE-2025-64459) | canal RedTeam Brasil
  • joshualent/django-cve-2025-64459 Harbor Check: matches CVE 0 stars, Python, created
    demo application showing off SQL Injection exploit in django 5.2.7
  • omarkurt/django-connector-CVE-2025-64459-testbed 2 stars, created
    A self-contained testbed for Django CVE-2025-64459. Demonstrates QuerySet.filter() parameter injection via dictionary expansion using Docke…
  • YouGina/CVE-2025-64459 0 stars, Python, created
    CVE-2025-64459 vulnerable by design app
3 more

Detection rules

Ways to detect this CVE, not exploit code: the nuclei template that checks a system for it, and the Suricata and Snort rules that name it. A rule set may ship a rule turned off, so check yours by its sid.

  • Emerging Threats Open ET WEB_SPECIFIC_APPS Django Authentication Bypass via SQLi (CVE-2025-64459) sid 2065699
  • Emerging Threats Open ET WEB_SPECIFIC_APPS Django Data Exfiltration via SQLi (CVE-2025-64459) sid 2065700
  • Emerging Threats Open ET WEB_SPECIFIC_APPS Django Privilege Escalation via SQLi (CVE-2025-64459) sid 2065701

Attack patterns (CAPEC)

  • CAPEC-7 Blind SQL Injection Likelihood: High · Severity: High
  • CAPEC-66 SQL Injection Likelihood: High · Severity: High
  • CAPEC-108 Command Line Execution through SQL Injection Likelihood: Low · Severity: Very High
  • CAPEC-109 Object Relational Mapping Injection Likelihood: Low · Severity: High
  • CAPEC-110 SQL Injection through SOAP Parameter Tampering Likelihood: High · Severity: Very High
  • CAPEC-470 Expanding Control over the Operating System from the Database Severity: Very High

The attack patterns MITRE's CAPEC relates to this record's weaknesses, as MITRE names them. Credits.

References

Check your stackJSON