### 简要描述:
大米CMS存在0元购物逻辑漏洞,当然要注册会员咯。但是可以0元购物
### 详细说明:
漏洞文件:Web/Lib/Action/MemberAction.class.php //413行
if(!is_numeric($_POST['id'][$i]) || !is_numeric($_POST['price'][$i]) || !is_numeric($_POST['qty'][$i])){continue;}
$data['gid'] = $_POST['id'][$i]; //这里把传入的商品id传给了 $data['gid']
$data['uid'] = $_SESSION['dami_uid'];
$data['price'] = (float)M('article')->where('aid='.$data['gid'])->getField('price');//必须,信任客户端表单可以改写哈$_POST['price'][$i] --这个是获取商品价格,但是商品和文章是在同一个表内,也就是说普通的文章也是存在price字段(为空)的。为空就会返回0元,再经过foatval就会变成0.0元,也就是免费了!
$data['province'] = $_POST['province'];
$data['city'] = $_POST['city'];
$data['area'] = $_POST['area'];
$data['sh_name'] = $_POST['realname'];
$data['sh_tel'] = $_POST['tel'];
$data['address'] = $_POST['address'];
$data['group_trade_no'] = $group_trade_no;
$data['out_trade_no'] = "DB".time()."-".$_SESSION['dami_uid'];
$data['servial'] = $_POST['gtype'][$i];
$data['status'] = 0;
$data['trade_type'] = 1;
$data['addtime'] = time();
$data['num'] = (int)$_POST['qty'][$i];
$total_fee += ($data['num'] * $data['price'])*1;
$total_num += $data['num'];
$trade->add($data);
if(strlen($subject)<200){$subject .= $_POST['name'][$i];}
if(strlen($title)<400){$title .= $_POST['name'][$i]." 数量:".$data['num'].' 单价:'.$data['price'].'
';}
}
这里其实就是遍历购物车内的商品,然而获取全部商品的参数。好像他们自己说的:
//必须,信任客户端表单可以改写哈$_POST['price'][$i]
呵呵,当然他们忽略了可控的id
### 漏洞证明:
[<img src="https://images.seebug.org/upload/201507/30121431d23eff967745f7065793318e555d38c8.jpg" alt="1.jpg" width="600" onerror="javascript:errimg(this);">](https://images.seebug.org/upload/201507/30121431d23eff967745f7065793318e555d38c8.jpg)
[<img src="https://images.seebug.org/upload/201507/30121445fe47e5c91b8b1289e8ccc7a37565cbac.jpg" alt="2.jpg" width="600" onerror="javascript:errimg(this);">](https://images.seebug.org/upload/201507/30121445fe47e5c91b8b1289e8ccc7a37565cbac.jpg)
[<img src="https://images.seebug.org/upload/201507/30121452aa0926e202efd798e2faac9670d971f0.jpg" alt="3.jpg" width="600" onerror="javascript:errimg(this);">](https://images.seebug.org/upload/201507/30121452aa0926e202efd798e2faac9670d971f0.jpg)
[<img src="https://images.seebug.org/upload/201507/301214580c14ef384f552ff02d7b69abb8a9e273.jpg" alt="4.jpg" width="600" onerror="javascript:errimg(this);">](https://images.seebug.org/upload/201507/301214580c14ef384f552ff02d7b69abb8a9e273.jpg)
暂无评论