abraxaslabs.tech · github.com/abraxas · @abraxas_null · CVE-2026-87902
WordPress — WordPress Core 7.1.1 — WordPress
WordPress Core 在多个版本(包括 7.1.1 及之前版本)中,其 locate_template() 函数存在本地文件包含漏洞。
| CVE | CVE-2026-87902 · CVE.org |
| CWE | CWE-98 |
| CVSS | 高危:8.1 CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H |
| 产品 | WordPress Core |
| 受影响版本 | 所有 至 7.1.1(含) 的版本 |
| 已修复版本 | 7.1.2 及更高版本 |
| 认证 | 无需认证(见源码映射) |
| 许可证 | GNU Affero GPL v3.0 |
| 实验环境 | 仅限 127.0.0.1 · 供应商/客户披露包,非扫描器 |
wp-includes/template.php 中 7.1.1 版本的 get_page_template + locate_template。7.1.2 补丁增加了 _wp_is_template_path_allowed 并对解码后的 pagename 执行 validate_file。
GET/?page_id={id}&pagename=templates%252F%252e%252e%252F%252e%252e%252F%252e%252e%252Fuploads%252Fghsa7hp8-witnessGET /?page_id=<已发布页面>&pagename=<双重编码的 templates/../../../uploads/ghsa7hp8-witness>WP_Query parse_query is_page 来自 page_id;get_posts 将 WHERE 替换为 ID=page_idget_page_template 对 pagename 进行 URL 解码,然后拼接 page-{$pagename}.phplocate_template file_exists(stylesheet_path + '/' + template_name) 无路径限制template-loader realpath + include未认证的 200 响应体包含 GHSA7HP8-WITNESS 和 wp_version=7.1.1。对照请求 GET /?page_id=N 则不会。
首先执行: 将 WordPress Core 更新至 7.1.2 或更高版本。
升级后验证
CVE-2026-87902-Abraxas-Labs.py:映射的见证不应出现。若无法立即更新
仅针对 http://127.0.0.1:8088(或你绑定的回环地址)。切勿将此脚本指向互联网。
python3 CVE-2026-87902-Abraxas-Labs.py
成功标志是响应体中包含上述见证。普通的 200 HTML 响应不算。
用于复现的回环栈。除非此文件夹中的 Dockerfile 从源码构建,否则使用官方镜像。
cd lab
docker compose up --force-recreate
如果 YAML 挂载了本地目录(来自版本表的插件 zip / 源码标签),请将存在漏洞的产品目录绑定到 Compose 旁边。除 127.0.0.1 外不发布任何内容。
# CVE-2026-87902 / GHSA-7hp8-65ch-5whp
CWE: CWE-98
CVSS: High 8.1 CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H (Wordfence). GitHub advisory: Critical.
## Description
An unauthenticated attacker can make `get_page_template()` page-template resolution include a chosen readable local `.php` file outside the active theme directories. `locate_template()` in WordPress <= 7.1.1 concatenates the caller-supplied template name onto the theme path and does not verify the result stays inside the theme. The core-reachable vector is the url-decoded `pagename` query variable. WordPress 7.1.2 adds `_wp_is_template_path_allowed()`.
## Product
WordPress 7.1.1 (fixed in 7.1.2, backported through 4.7.37). Lab oracle is LFI of a witness PHP file, not RCE.
本披露包采用 GNU Affero General Public License v3.0 许可。参见 LICENSE。
本包仅供供应商、站点所有者及授权实验室使用。脚本仅与 127.0.0.1 通信。Abraxas Labs 未授权将其用于你并不拥有的系统。不提供任何担保。