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

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

缺陷编号:wooyun-2012-09475

漏洞标题:Stcms sql injection Vulnerabilities

相关厂商:Stcms

漏洞作者: 路人甲

提交时间:2012-07-11 12:07

修复时间:2012-08-25 12:08

公开时间:2012-08-25 12:08

漏洞类型:SQL注射漏洞

危害等级:高

自评Rank:10

漏洞状态:未联系到厂商或者厂商积极忽略

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

Tags标签:

4人收藏 收藏
分享漏洞:


漏洞详情

披露状态:

2012-07-11: 积极联系厂商并且等待厂商认领中,细节不对外公开
2012-08-25: 厂商已经主动忽略漏洞,细节向公众公开

简要描述:

任意sql语句执行

详细说明:

case 'list':

$totalNum = $mysql->numTable("member", $where);
$pageNum = 20;
$totalPage = intval($totalNum/$pageNum) == $totalNum/$pageNum ? $totalNum/$pageNum : intval($totalNum/$pageNum)+1;
$page = $page ? $page : 1;
$page = $page>$totalPage ? $totalPage : $page;
$page = $page<1 ? 1 : $page;
$members = $mysql->select("member","id,name,time,money,provience,city,picture",$where,array("id DESC"),array(($page-1)*$pageNum,$pageNum));
require(INCLUDE_PATH."page.class.php");
$pageClass = new page($page,$totalNum,$pageNum, WEB_URL."member/u.php?action=list", true);
$pageCode = $pageClass->getCode();
$smarty->assign("webTitle","会员列表");
$smarty->assign("uList", $members);
$smarty->assign("pageCode", $pageCode);
$smarty->display("member/m_u_list.html");
function numTable($table='',$wheres=false)
{
$table = $this->dbPrefix.$table;
$sql = "SELECT COUNT(*) AS num FROM `$table`";
if($wheres)
{
$sql .= " WHERE ";
if(is_array($wheres))
{
foreach($wheres as $key => $val)
{
$whr[] = "`$key`='".$val."'";
}
$sql .= implode(" AND ",$whr);
}
elseif(is_string($wheres))
{
$sql .= $wheres;
}
}
$result = $this->fetch($this->query($sql));
return $result['num'];
}


Where 没初始化 导致可执行任意sql语句

漏洞证明:

http://localhost/stcms_html/member/u.php?action=list&where={sql}

修复方案:

你懂的吧

版权声明:转载请注明来源 路人甲@乌云


漏洞回应

厂商回应:

未能联系到厂商或者厂商积极拒绝