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

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

缺陷编号:wooyun-2015-0164562

漏洞标题:ThinkSAAS最新版2.4 Xss漏洞

相关厂商:thinksaas.cn

漏洞作者: 麦兜

提交时间:2015-12-28 10:44

修复时间:2016-02-09 23:29

公开时间:2016-02-09 23:29

漏洞类型:XSS 跨站脚本攻击

危害等级:高

自评Rank:10

漏洞状态:厂商已经确认

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

Tags标签:

4人收藏 收藏
分享漏洞:


漏洞详情

披露状态:

2015-12-28: 细节已通知厂商并且等待厂商处理中
2015-12-28: 厂商已经确认,细节仅向厂商公开
2016-01-07: 细节向核心白帽子及相关领域专家公开
2016-01-17: 细节向普通白帽子公开
2016-01-27: 细节向实习白帽子公开
2016-02-09: 细节向公众公开

简要描述:

未过滤

详细说明:

先看写入代码:
/var/www/html/thinksaas/app/my/action/setting.php

case "citydo":

$province = trim($_POST['province']);
$city = trim($_POST['city']);//只过滤两处空白

//这里就直接写入数据库了
$new['my']->update('user_info',array(
'userid'=>$userid,
),array(

'province'=>$province,
'city'=>$city,

));
tsNotice("常居地更新成功!");

break;


Update:

public function update($table, $conditions, $row) {
$where = "";
if (empty ( $row ))
return FALSE;
if (is_array ( $conditions )) {
$join = array ();
foreach ( $conditions as $key => $condition ) {
$condition = $this->escape ( $condition );
$join [] = "`{$key}` = {$condition}";
}
$where = "WHERE " . join ( " AND ", $join );
} else {
if (null != $conditions)
$where = "WHERE " . $conditions;
}
foreach ( $row as $key => $value ) {
$value = $this->escape ( $value ); //只做了转义
//$vals [] = "`$key` = $value";
$vals [] = "{$key} = {$value}";
}
$values = join ( ", ", $vals );
$sql = "UPDATE " . dbprefix . "{$table} SET {$values} {$where}";

return $this->db->query ( $sql );
}


再来看取出:
/var/www/html/thinksaas/app/user/class.user.php

//获取一个用户的信息
function getOneUser($userid){

$strUser = $this->find('user_info',array(
'userid'=>$userid,
));

if($strUser){

$strUser['username'] = tsTitle($strUser['username']);

if($strUser['face'] && $strUser['path']){
$strUser['face'] = tsXimg($strUser['face'],'user',120,120,$strUser['path'],1);
}elseif($strUser['face'] && $strUser['path']==''){
$strUser['face'] = SITE_URL.'public/images/'.$strUser['face'];
}else{
//没有头像
$strUser['face'] = SITE_URL.'public/images/user_large.jpg';
}
}else{
$strUser = '';
}

return $strUser; //没任何过滤
}

漏洞证明:

thi1.png


thi2.png

修复方案:

过滤并编码

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


漏洞回应

厂商回应:

危害等级:中

漏洞Rank:10

确认时间:2015-12-28 23:02

厂商回复:

感谢反馈,已经修复。

最新状态:

暂无