# doorGets CMS 5.2 sql注入漏洞
虽然标题是5.2版本的,但厂商在漏洞公布后就修复了并且没有更新版本,
所以漏洞其实存在于5.1版本(下载了不同版本,实验证实)
漏洞存在于/doorgets/core/doorgetsFunctions.php文件中
```
--------省略部分代码
507: $id = $this->Controller->form['_position_down']->i['id'];
$type = $this->Controller->form['_position_down']->i['type'];
$pos = $this->Controller->form['_position_down']->i['position'];
$posPlus = $pos + 1;
$posMoins = $pos - 1;
if($pos < $max){
$this->dbQL("UPDATE $table SET ordre = ordre - 1 WHERE ordre = $posPlus LIMIT 1");
//echo ':table:'.$table;
//echo ':posplus:'.$posPlus;
//echo ':id:'.$id;
520: $this->dbQL("UPDATE $table SET ordre = $posPlus WHERE id = $id LIMIT 1");
FlashInfo::set($this->l("La position a bien été mise à jour."));
header('Location:'.$_SERVER['REQUEST_URI']);
exit();
}
--------省略部分代码
```
从第507和520行代码可以看出,最后_position_down_id没有过滤就拼接成了sql语句,
从而造成注入。
全部评论 (1)