### 简要描述:
rt
### 详细说明:
看到 /framework/lib/util/filter_class.php
```
......
public static function sql($str)
{
if (get_magic_quotes_gpc()){
$str = stripslashes($str);
}else{
//不使用主要是因为,先有mysql的连接
//$str = mysql_real_escape_string($str);
$str = addslashes($str);
}
return $str;
}.....
```
当php为低版本或者 gpc开启(php默认是开启的吧)时。
$str = stripslashes($str);
去掉 转义符, 跳出转义。
找一个调用 Filter::sql的。
例如 index.php
```
public function js()
{
$id = Filter::sql(Req::args("id"));
$model = new Model("ad");
$time = date('Y-m-d');
$ad = $model->where("number = '$id' and start_time<='$time' and end_time >='$time'")->find();
if($ad==null) return;
if($ad['is_open']==0) return;
```
百度搜索到某个使用 tinyshop的站,just a test~
[<img src="https://images.seebug.org/upload/201407/18042214515de97c369339257be8d8d2ac0d16f8.jpg" alt="0.jpg" width="600" onerror="javascript:errimg(this);">](https://images.seebug.org/upload/201407/18042214515de97c369339257be8d8d2ac0d16f8.jpg)
调用该函数的 还有 /protected/controllers/simple.php
```
public function reset_password()
{
$safecode = Filter::sql(Req::args('safecode'));
if($safecode!=null && strlen($safecode)==32)
{
$model = $this->model->table('reset_password');
$obj = $model->where("safecode='".$safecode."'")->find();
$this->assign('status','fail');
$this->assign('safecode',$safecode);
if(!empty($obj)) $this->assign('status','success');
$this->redirect();
}
else
{
$this->redirect('index/index');
}
}
```
/protected/controllers/ucenter.php
/protected/controllers/payment.php
。。。。就不贴代码一一举例了。
### 漏洞证明:
[<img src="https://images.seebug.org/upload/201407/18042214515de97c369339257be8d8d2ac0d16f8.jpg" alt="0.jpg" width="600" onerror="javascript:errimg(this);">](https://images.seebug.org/upload/201407/18042214515de97c369339257be8d8d2ac0d16f8.jpg)
暂无评论