当前位置:WooYun >> 漏洞信息

漏洞概要 关注数(24) 关注此漏洞

缺陷编号:wooyun-2014-087071

漏洞标题:ROCBOSS微社区V1.1某处平行权限

相关厂商:rocboss.com

漏洞作者: bey0nd

提交时间:2014-12-16 11:57

修复时间:2015-03-16 11:58

公开时间:2015-03-16 11:58

漏洞类型:设计不当

危害等级:高

自评Rank:20

漏洞状态:厂商已经修复

漏洞来源: http://www.wooyun.org,如有疑问或需要帮助请联系 [email protected]

Tags标签:

4人收藏 收藏
分享漏洞:


漏洞详情

披露状态:

2014-12-16: 细节已通知厂商并且等待厂商处理中
2014-12-16: 厂商已经确认,细节仅向厂商公开
2015-02-09: 细节向核心白帽子及相关领域专家公开
2015-02-19: 细节向普通白帽子公开
2015-03-01: 细节向实习白帽子公开
2015-03-16: 厂商已经修复漏洞并主动公开,细节向公众公开

简要描述:

最近也在自己写bbs,借鉴了一下ROCBOSS的风格,比较不错哦

详细说明:

在帖子编辑的地方存在越权操作
具体分析如下
#1.首先看编辑帖子所请求的代码。
rocboss\module\index.module.class.php

public function createNewTopic()
{
$this->checkPrivate(TRUE);
if (isset($_POST['cid'], $_POST['msg'])) {
$postArray = array(
"uid" => $this->loginInfo['uid'],
"cid" => intval($_POST['cid']),
"pictures" => Common::text_in($_POST['pictures']),
"message" => Common::text_in($_POST['msg']),
"client" => Common::getClient(),
"posttime" => time(),
"lasttime" => time()
);
if(isset($_POST['tempTid']) && Common::getTopicTid($this->db, intval($_POST['tempTid'])) > 0) {
$updateArray = array(
'cid' => $postArray['cid'],
'message' => $postArray['message']." [p][ ".date('Y年n月j日 H:i:s', $postArray['posttime'])."最后修改 ]"
);
$this->db->query($this->db->update("`". PRE ."topic`", $updateArray, "`tid`=" . intval($_POST['tempTid'])));
die('{"result":"success","message":"帖子修改成功"}');
}
if( Common::checkClubCid($this->db, $postArray['cid']) == 0 ) {
die('{"result":"error","message":"您尚未选择分类"}');
}
if( $postArray['message'] == '') {
die('{"result":"error","message":"内容不能为空"}');
}
if( $postArray['posttime'] - Common::getUserLasttime($this->db, $this->loginInfo['uid']) < 30 ) {
die('{"result":"error","message":"防水策略生效中,您发的太快了"}');
}
$this->db->query($this->db->insert("`". PRE ."topic`", $postArray));
$postResult = $this->db->lastInsertId();
if (isset($postResult) && $postResult > 0) {
setcookie("tmp_picture", "", 0, "/");
Common::updateUserMoney($this->db, $this->loginInfo['uid'], $GLOBALS['balance_config']['change']['topic'], 3);
Common::updateLogintime($this->db, $this->loginInfo['uid']);
die('{"result":"success","message":"发布成功,正在刷新..."}');
} else {
die('{"result":"error","message":"发布失败"}');
}
} else {
echo '{"result":"error","message":"发布失败"}';
}
}


通过上面代码可以看出,在新建帖子和编辑帖子都是请求到这里来的。新建帖子没什么说的,重点是编辑的地方。
代码

if(isset($_POST['tempTid']) && Common::getTopicTid($this->db, intval($_POST['tempTid'])) > 0) {
$updateArray = array(
'cid' => $postArray['cid'],
'message' => $postArray['message']." [p][ ".date('Y年n月j日 H:i:s', $postArray['posttime'])."最后修改 ]"
);
$this->db->query($this->db->update("`". PRE ."topic`", $updateArray, "`tid`=" . intval($_POST['tempTid'])));
die('{"result":"success","message":"帖子修改成功"}');
}


这段代码验证是编辑帖子的话调用。
如果是编辑则把更新数据message存在$updateArray
然后通过

$this->db->query($this->db->update("`". PRE ."topic`", $updateArray, "`tid`=" . intval($_POST['tempTid'])));


执行SQL语句,但是并没有验证帖子的权限,是否有权限编辑。导致可编辑任意用户的帖子。
----------------------------------------------------------------------
分析完,演示一下,直接在官网吧
https://www.rocboss.com/index.php
自己创建的帖子

MY.png


别人的帖子

other.png


其中https://www.rocboss.com/say-860.html 的860为id
修改的时候抓包改ID,改成另外一个人的
试一下。
把860改成715

1.png


再去看别人的帖子

2.png


END

漏洞证明:

1.png


2.png


修复方案:

验证权限

版权声明:转载请注明来源 bey0nd@乌云


漏洞回应

厂商回应:

危害等级:低

漏洞Rank:1

确认时间:2014-12-16 12:08

厂商回复:

感谢提醒,1.1版本目前已经停止维护,其逻辑设计也相对比较老,建议你届时参考2.0。我比较好奇你是什么浏览器,为何你那边提示有证书风险?

最新状态:

2014-12-16:1.1版本已停止维护