# _queryset中_connector参数 SQL注入漏洞
## 概述
Django 中存在 SQL 注入漏洞,影响多个版本。攻击者可利用精心构造的字典参数,通过 `_connector` 参数对 `QuerySet.filter()`、`QuerySet.exclude()` 和 `QuerySet.get()` 方法及 `Q()` 类进行攻击。
## 影响版本
- Django 5.1 < 5.1.14
- Django 4.2 < 4.2.26
- Django 5.2 < 5.2.8
其他非受支持的版本(如 5.0.x、4.1.x 和 3.2.x)可能也受影响,但未被官方评估。
## 细节
当使用带有字典扩展的字典作为参数,并将其传递给支持 `_connector` 参数的查询方法时,攻击者可以构造特殊输入,绕过预期的参数化查询机制,导致 SQL 注入。
## 影响
此漏洞可能导致攻击者执行任意 SQL 代码,进而造成数据泄露、篡改或破坏,威胁应用的安全性和完整性。
是否为 Web 类漏洞: 是
判断理由:
| # | POC 描述 | 源链接 | 神龙链接 |
|---|---|---|---|
| 1 | None | https://github.com/rockmelodies/django_sqli_target_CVE-2025-64459 | POC详情 |
| 2 | check if vulnerable python-django version to CVE-2025-64459 bug | https://github.com/nunpa/CVE-2025-64459 | POC详情 |
| 3 | CVE-2025-64459 | https://github.com/B1ack4sh/Blackash-CVE-2025-64459 | POC详情 |
| 4 | A self-contained testbed for Django CVE-2025-64459. Demonstrates QuerySet.filter() parameter injection via dictionary expansion using Docker. | https://github.com/omarkurt/django-connector-CVE-2025-64459-testbed | POC详情 |
| 5 | CVE-2025-64459 | https://github.com/Ashwesker/Blackash-CVE-2025-64459 | POC详情 |
| 6 | 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.8. Researcher: Cyberstan (University of Warwick) | https://github.com/stanly363/CVE-2025-64459-Poc | POC详情 |
| 7 | None | https://github.com/ZeYrOXxXxXxX/CVE-2025-64459 | POC详情 |
| 8 | CVE-2025-64459-Exploit-Fix | https://github.com/ALPYAHYA/CVE-2025-64459-Exploit-Fix | POC详情 |
| 9 | CVE-2025-64459-Exploit-PoC | https://github.com/ALPYAHYA/CVE-2025-64459-Exploit-PoC | POC详情 |
| 10 | None | https://github.com/Z3YR0xX/CVE-2025-64459 | POC详情 |
| 11 | CVE-2025-64459 | https://github.com/Ashwesker/Ashwesker-CVE-2025-64459 | POC详情 |
| 12 | None | https://github.com/alxsourin/Helpdesk-Telecom-CVE-2025-64459 | POC详情 |
| 13 | CVE-2025-64459-hunter | https://github.com/purehate/CVE-2025-64459-hunter | POC详情 |
标题: Archive of security issues | Django documentation | Django -- 🔗来源链接
标签:vendor-advisory
标题: django-announce - Google Groups -- 🔗来源链接
标签:mailing-list
标题: Django security releases issued: 5.2.8, 5.1.14, and 4.2.26 | Weblog | Django -- 🔗来源链接
标签:vendor-advisory
神龙速读:
### 漏洞关键信息
#### 受影响的版本
- Django 主分支(main)
- Django 6.0(目前处于 beta 状态)
- Django 5.2
- Django 5.1
- Django 4.2
#### 发布的补丁版本
- Django 5.2.8
- Django 5.1.14
- Django 4.2.26
#### 漏洞详情
- **CVE-2025-64458**:
- 漏洞类型: 潜在的拒绝服务漏洞
- 影响模块: `HttpResponseRedirect` 和 `HttpResponsePermanentRedirect` 在 Windows 上
- 漏洞原因: `NFKC normalization` 在 Python 上处理大量 Unicode 字符时性能较差,通过特定输入触发拒绝服务攻击。
- 报告者: Seokchan Yoon
- 严重程度: 中等
- **CVE-2025-64459**:
- 漏洞类型: 潜在的 SQL 注入
- 影响模块: `QuerySet` 和 `Q` 对象的 `_connector` 关键字参数
- 漏洞原因: 当传入特制字典时,会发生 SQL 注入。
- 报告者: cyberstan
- 严重程度: 高
#### 修复情况
- 补丁已应用于 Django 主分枝、6.0、5.2、5.1 和 4.2 分枝。
- 提供了对应分支的变更集链接。
#### 安全报告提交注意事项
- 安全漏洞应通过私电邮提交至 `security@djangoproject.com`,而非通过 Trac 或论坛公开报告。
暂无评论