### 简要描述:
打了补丁试试。
### 详细说明:
在app/message.app.php中
```
function drop()
{
$msg_ids = isset($_GET['msg_id']) ? trim($_GET['msg_id']) : '';
if (!$msg_ids)
{
$this->show_warning('no_such_message');
return;
}
$msg_ids = explode(',',$msg_ids);
$mod_message = &m('message');
foreach ($msg_ids as $key=>$msg_id){
$message = $mod_message->find(intval($msg_id));
$message = current($message);
if(!$message || $message['parent_id']!=0)
{
unset($msg_ids[$key]); //过滤掉回复的和数据库没有的短信的msg_id
}
}
if (!$msg_ids)
{
$this->show_warning('no_such_message');
return;
}
if (!$mod_message->msg_drop($msg_ids, $this->visitor->get('user_id'))) //删除
{
$this->show_warning($mod_message->get_error());
return;
}
```
```
$msg_ids = isset($_GET['msg_id']) ? trim($_GET['msg_id']) : '';
```
这里没有过滤 跟进一下函数
```
function msg_drop($msg_id, $user_id)
{
$msg_ids = is_array($msg_id) ? $msg_id : explode(',', $msg_id);
if (!$msg_ids)
{
$this->_error('no_such_message');
return false;
}
if (!$user_id)
{
$this->_error('no_such_user');
return false;
}
foreach ($msg_ids as $msg_id)
{
$message = $this->get_info($msg_id);
if ($user_id==$message['to_id']) //收件箱
{
if ($message['status']==2 || $message['status']==3)
{
$this->edit($msg_id, array('status' => 2));
}else
{
$drop_ids[] = $msg_id; //记录需要删除记录的msg_id
}
}
```
没过滤 再跟
```
function edit($conditions, $edit_data)
{
if (empty($edit_data))
{
return false;
}
$edit_data = $this->_valid($edit_data);
if (!$edit_data)
{
return false;
}
$edit_fields = $this->_getSetFields($edit_data);
$conditions = $this->_getConditions($conditions, false);
$this->db->query("UPDATE {$this->table} SET {$edit_fields}{$conditions}");
return $this->db->affected_rows();
```
带入到update中。
来注入把。
### 漏洞证明:
首先注册两个号 用一个号给另外一个号发短消息
然后另外一个号查看的时候抓个包。
[<img src="https://images.seebug.org/upload/201406/21150853ec1c6396a042f769affbc765d1169353.jpg" alt="e1.jpg" width="600" onerror="javascript:errimg(this);">](https://images.seebug.org/upload/201406/21150853ec1c6396a042f769affbc765d1169353.jpg)
[<img src="https://images.seebug.org/upload/201406/21150902d9424c9aff017cf4dae3ee321fcab271.jpg" alt="e2.jpg" width="600" onerror="javascript:errimg(this);">](https://images.seebug.org/upload/201406/21150902d9424c9aff017cf4dae3ee321fcab271.jpg)
可以报错注入。
暂无评论