### 简要描述:
EasyTalk处理用户上传头像的代码有问题,若判断用户上传的头像不合法,则根据参数$_POST['imgpath']的路径删除用户上传的非法头像文件。漏洞出在EasyTalk对$_POST['imgpath']处理不当上,没有对用户提交的参数进行判断就直接删除imgpath指向的文件。
### 详细说明:
在SettingAction.class.php 101行的函数doface2中:
```
public function doface2() {
$ysw=$_POST[ 'ysw'];
if ($ysw>460) {
$zoom=intval($ysw)/460;
} else {
$zoom=1;
}
$x=$_POST[ 'x']*$zoom;
$y=$_POST[ 'y']*$zoom;
$w=$_POST[ 'w']*$zoom;
$h=$_POST[ 'h']*$zoom;
$imgpath=ET_ROOT.$_POST[ 'imgpath'];//与ET_ROOT连结成为imgpath
$ext=strtolower( getExtensionName($imgpath));//提取后缀
import( "@.ORG.IoHandler");
$IoHandler = new IoHandler();
if($ext!='jpg' && $ext!='jpeg' && $ext!= 'gif' && $ext!='png' ) {
//若后缀是非法后缀,就删除刚上传的文件
$IoHandler->DeleteFile($imgpath);
Cookie:: set('setok','face2');
header( 'location:'.SITE_URL.'/Setting/face' );
exit;
}
........
}
```
### 漏洞证明:
[<img src="https://images.seebug.org/upload/201206/2415203762aac1ac228ac5c8f46545fdde5edeee.png" alt="" width="600" onerror="javascript:errimg(this);">](https://images.seebug.org/upload/201206/2415203762aac1ac228ac5c8f46545fdde5edeee.png)
删除index.php
[<img src="https://images.seebug.org/upload/201206/241520510ecfbc3d1fd0eafb26abc90f8e88e502.png" alt="" width="600" onerror="javascript:errimg(this);">](https://images.seebug.org/upload/201206/241520510ecfbc3d1fd0eafb26abc90f8e88e502.png)
[<img src="https://images.seebug.org/upload/201206/241520585fc1bc206f15b07b92d5f93b4fd6b791.png" alt="" width="600" onerror="javascript:errimg(this);">](https://images.seebug.org/upload/201206/241520585fc1bc206f15b07b92d5f93b4fd6b791.png)
暂无评论