vBulletin 5.6.1 SQL注入漏洞
字数 1153 2025-08-25 22:58:46
vBulletin 5.6.1 SQL注入漏洞分析与利用
漏洞概述
vBulletin 5.6.1及之前版本存在一个严重的SQL注入漏洞(CVE-2020-12720),该漏洞源于对nodeId参数的不当处理,导致攻击者可以构造恶意SQL语句进行未授权注入攻击。
受影响版本
- vBulletin 5.5.6pl1之前的所有版本
- vBulletin 5.6.0pl1之前的5.6.0版本
- vBulletin 5.6.1pl1之前的5.6.1版本
环境搭建
系统要求
- PHP版本:7.2.10
安装步骤
- 将
config.php.bkp重命名为config.phpren config.php.bkp config.php - 进入
/upload/core/includes目录 - 将
config.php.new重命名为config.phpren config.php.new config.php - 编辑
config.php并修改以下配置项:$config['Database']['dbname'] = '数据库名称'; $config['Database']['technicalemail'] = 'dbmaster@example.com'; $config['MasterServer']['servername'] = 'localhost'; // 可以是主机名 $config['MasterServer']['port'] = 3306; $config['MasterServer']['username'] = '用户名'; $config['MasterServer']['password'] = '密码'; - 将
htaccess.txt重命名为.htaccess - 按照系统引导完成安装
- 安装成功后删除
/upload/core/install目录
漏洞复现
攻击Payload
nodeId[nodeid]=1 AND text.nodeid = 1 UNION SELECT 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,user(),19,20,21,22,23,24,25,26--
或更详细的注入语句:
nodeId[nodeid]=1 UNION SELECT 26,25,24,23,22,21,20,19,20,17,16,15,14,13,12,11,10,"cve-2020-12720",8,7,6,5,4,3,2,1;--
技术分析
漏洞原理
-
漏洞位于
/core/vb/api/实现的ajax API调用中 -
vB_Api_Content_Infraction类继承自vB_Api_Content_Text,后者又继承自vB_Api_Content -
调用链如下:
vB_Api_Content->getIndexableContent()vB_Library_Content->getIndexableContent()fillContentTableData()getRow()getContentTablesData()cleanArray()
-
关键问题:
- 数据清洗函数
cleanArray()最终调用TYPE_NOCLEAN类型处理 - 输入参数未经充分过滤直接拼接进SQL语句
- 导致SQL注入漏洞
- 数据清洗函数
类继承关系
vB_Api_Content_Infraction → vB_Api_Content_Text → vB_Api_Content
vB_Library_Content_Infraction → vB_Library_Content_Text → vB_Library_Content
修复建议
- 官方已发布安全补丁,建议立即更新至最新版本
- 补丁下载地址:
https://forum.vbulletin.com/forum/vbulletin-announcements/vbulletin-announcements_aa/4440032-vbulletin-5-6-1-security-patch-level-1
参考资源
总结
该漏洞是一个高危的未授权SQL注入漏洞,攻击者可以利用此漏洞直接操作数据库,获取敏感信息或控制系统。建议所有使用受影响版本的用户立即应用官方补丁。