Potential SQL injection via _connector keyword argument in QuerySet and Q objects
Key facts
- Attack vector
- Network
- Privileges required
- None
- User interaction
- None
- Attack complexity
- Low
- Impact type
- SQL injection
- Confidentiality · integrity · availability
- High · High · None
- Fix status
- Partial Red Hat: 6 fixed, 5 without a fix
Attack profile from CVSS 3.1 · CISA ADP. Fix status from CNA, GitHub and Red Hat. Impact type from CWE-89.
Summary
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.
Why it matters now
SSVC decision points
CISA ADP · SSVC 2.0.3
- Exploitation
- None
- Automatable
- Yes
- Technical impact
- Total
The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| djangoproject | Django | 5.2 to before 5.2.8; 5.1 to before 5.1.14; 4.2 to before 4.2.26 | 5.2.8, 5.1.14, 4.2.26 | Patch available | CNA |
| — | django (PyPI) | 5.2a1 to before 5.2.8 | 5.2.8 | Patch available | GHSA-frmv-pr5f-9mcr |
| — | django (PyPI) | 5.0a1 to before 5.1.14 | 5.1.14 | Patch available | GHSA-frmv-pr5f-9mcr |
| — | django (PyPI) | before 4.2.26 | 4.2.26 | Patch available | GHSA-frmv-pr5f-9mcr |
- Django Vendordjangoproject Affected 5.2 to before 5.2.8; 5.1 to before 5.1.14; 4.2 to before 4.2.26 Fixed in 5.2.8, 5.1.14, 4.2.26 Patch available CNA
- django (PyPI) Vendor— Affected 5.2a1 to before 5.2.8 Fixed in 5.2.8 Patch available GHSA-frmv-pr5f-9mcr
- django (PyPI) Vendor— Affected 5.0a1 to before 5.1.14 Fixed in 5.1.14 Patch available GHSA-frmv-pr5f-9mcr
- django (PyPI) Vendor— Affected before 4.2.26 Fixed in 4.2.26 Patch available GHSA-frmv-pr5f-9mcr
CPE configurations NVD · 1
| CPE | Versions | Role | Vendor |
|---|---|---|---|
| cpe:2.3:a:djangoproject:django:*:*:*:*:*:*:*:* | 4.2 to before 4.2.26; 5.1 to before 5.1.14; 5.2 to before 5.2.8 | Vulnerable | djangoproject |
- cpe:2.3:a:djangoproject:django:*:*:*:*:*:*:*:* Versions 4.2 to before 4.2.26; 5.1 to before 5.1.14; 5.2 to before 5.2.8 Vulnerable ·djangoproject
Remediation
- Fix · CNA Django (djangoproject) Fixed in 5.2.8, 5.1.14, 4.2.26
- Fix · GHSA-frmv-pr5f-9mcr django (PyPI) Fixed in 5.2.8 Advisory →
- Fix · GHSA-frmv-pr5f-9mcr django (PyPI) Fixed in 5.1.14 Advisory →
- Fix · GHSA-frmv-pr5f-9mcr django (PyPI) Fixed in 4.2.26 Advisory →
Red Hat 7 advisories
- RHSA-2026:1596 Released 2026-01-29 · Red Hat rating ImportantRed Hat Ansible Automation Platform 2.6 Container Release Update
- Red Hat Ansible Automation Platform 2.6 registry.redhat.io/ansible-automation-platform-26/controller-rhel9, registry.redhat.io/ansible-automation-platform-26/controller-rhel9-operator, registry.redhat.io/ansible-automation-platform-26/de-minimal-rhel9 +7
- RHSA-2025:23196 Released 2025-12-15 · Red Hat rating ImportantRed Hat Ansible Automation Platform 2.6 Ansible DevSpaces Container Release Update
- Red Hat Ansible Automation Platform 2.6 registry.redhat.io/ansible-automation-platform-tech-preview/ansible-devspaces-rhel9
- RHSA-2025:23133 Released 2025-12-11 · Red Hat rating ImportantRed Hat Ansible Automation Platform 2.6 Container Release Update
- Red Hat Ansible Automation Platform 2.6 registry.redhat.io/ansible-automation-platform-26/controller-rhel9, registry.redhat.io/ansible-automation-platform-26/eda-controller-rhel9-operator, registry.redhat.io/ansible-automation-platform-26/gateway-rhel9 +3
Show 4 more Red Hat advisories
- RHSA-2025:23131 Released 2025-12-11 · Red Hat rating ImportantRed Hat Ansible Automation Platform 2.5 Container Release Update
- Red Hat Ansible Automation Platform 2.5 registry.redhat.io/ansible-automation-platform-25/eda-controller-rhel8, registry.redhat.io/ansible-automation-platform-25/gateway-rhel8, registry.redhat.io/ansible-automation-platform-25/lightspeed-chatbot-rhel8 +2
- RHSA-2025:23130 Released 2025-12-11 · Red Hat rating ImportantRed Hat Ansible Automation Platform 2.4 Container Release Update
- Red Hat Ansible Automation Platform 2.4 registry.redhat.io/ansible-automation-platform-24/lightspeed-rhel8
- RHSA-2025:23070 Released 2025-12-10 · Red Hat rating ImportantRed Hat Ansible Automation Platform 2.6 Product Security and Bug Fix Update
- Red Hat Ansible Automation Platform 2.6 for RHEL 9 automation-controller-venv-tower-4.7.6-1.el9ap, python3.11-django-4.2.26-2.el9ap
- RHSA-2025:23069 Released 2025-12-10 · Red Hat rating ImportantRed Hat Ansible Automation Platform 2.5 Product Security and Bug Fix Update
- Red Hat Ansible Automation Platform 2.5 for RHEL 8 ansible-automation-platform-installer-2.5-20.el8ap, ansible-builder-3.1.1-1.el8ap, ansible-creator-25.12.0-1.el8ap +47
- Red Hat Ansible Automation Platform 2.5 for RHEL 9 ansible-automation-platform-installer-2.5-20.el9ap, ansible-builder-3.1.1-1.el9ap, ansible-creator-25.12.0-1.el9ap +47
Fixed in the same release
Records fixed by the same vendor advisory or release, as the CNA lists them.
- Advisory ·
djangoproject Django — Django security releases issued: 5.2.8, 5.1.14, and 4.2.26
2 records Highest priority Priority HIGH 1 HIGH, 1 MEDIUM
Other records, highest priority first
- TI-2025-39860 Potential denial-of-service vulnerability in HttpResponseRedirect and HttpResponsePermanentRedirect on WindowsPriority MEDIUM 43
Vendor assessments
Red Hat
Red Hat rating: Important. Red Hat's page for this CVE →
| Product | Status | Plan or fix |
|---|---|---|
| Red Hat Ansible Automation Platform 2 | Affected | No fix yet |
| Red Hat Discovery 1 | Affected | No fix planned: Will not fix |
| Red Hat Discovery 2 | Affected | No fix yet |
| Red Hat OpenStack Platform 13 (Queens) | Affected | No fix yet |
| Red Hat Satellite 6 | Affected | No fix yet |
| Red Hat Ansible Automation Platform 2.4 | Fixed | RHSA-2025:23130 |
| Red Hat Ansible Automation Platform 2.5 | Fixed | RHSA-2025:23131 |
| Red Hat Ansible Automation Platform 2.5 for RHEL 8 | Fixed | RHSA-2025:23069 |
| Red Hat Ansible Automation Platform 2.5 for RHEL 9 | Fixed | RHSA-2025:23069 |
| Red Hat Ansible Automation Platform 2.6 | Fixed | RHSA-2025:23133, RHSA-2025:23196, RHSA-2026:1596 |
| Red Hat Ansible Automation Platform 2.6 for RHEL 9 | Fixed | RHSA-2025:23070 |
Not affected: 12 products
- OpenShift Service Mesh 2
- OpenShift Service Mesh 3
- Red Hat Ansible Automation Platform 2
- Red Hat Ansible Automation Platform 2.4
- Red Hat Ansible Automation Platform 2.5
- Red Hat Ansible Automation Platform 2.6
- Red Hat Ansible Automation Platform 2.6 for RHEL 10
- Red Hat Ansible Automation Platform 2.6 for RHEL 9
- Red Hat OpenStack Platform 13 (Queens)
- Red Hat OpenStack Platform 16.2
- Red Hat OpenStack Platform 17.1
- Red Hat OpenStack Platform 18.0
Timeline
- 2026-10-02 Threatist record created from CVE-2025-64459
- 2026-10-03 Alias added: GHSA-frmv-pr5f-9mcr
References
Advisory 3
Other 10
- Django releases announcements
- https://github.com/django/django/commit/06dd38324ac3d60d83d9f3adabf0dcdf423d2a85
- https://github.com/django/django/commit/59ae82e67053d281ff4562a24bbba21299f0a7d4
- https://github.com/django/django/commit/6703f364d767e949c5b0e4016433ef75063b4f9b
- https://github.com/django/django/commit/72d2c87431f2ae0431d65d0ec792047f078c8241
- https://docs.djangoproject.com/en/dev/releases/security
- https://github.com/django/django
- https://github.com/omarkurt/django-connector-CVE-2025-64459-testbed
- https://github.com/pypa/advisory-database/tree/main/vulns/django/PYSEC-2025-108.yaml
- https://www.djangoproject.com/weblog/2025/nov/05/security-releases
More djangoproject Django vulnerabilities
- TI-2022-15177 An issue was discovered in Django 3.2 before 3.2.14 and 4.0 before 4.0.6. CVSS 3.1CRITICAL 9.8
- TI-2020-05994 Django 1.11 before 1.11.28, 2.2 before 2.2.10, and 3.0 before 3.0.3 allows SQL Injection… CVSS 3.1CRITICAL 9.8
- TI-2023-10198 An issue was discovered in the Multipart Request Parser in Django 3.2 before 3.2.18, 4.0… CVSS 3.1HIGH 7.5
- TI-2019-14306 Django before 1.11.27, 2.x before 2.2.9, and 3.x before 3.0.1 allows account takeover. CVSS 3.1CRITICAL 9.8
- TI-2019-10595 An issue was discovered in Django 1.11.x before 1.11.23, 2.1.x before 2.1.11, and 2.2.x… CVSS 3.0CRITICAL 9.8
- TI-2021-14006 Django 3.1.x before 3.1.13 and 3.2.x before 3.2.5 allows QuerySet.order_by SQL injection… CVSS 3.1CRITICAL 9.8
Sources
- CVE-2025-64459 · CVE Program
- CVE-2025-64459 · NVD
- FIRST EPSS
- GHSA-frmv-pr5f-9mcr · GitHub Advisory Database · CC BY 4.0
- CVE-2025-64459 · Red Hat security data · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences