当前位置:WooYun >> 漏洞信息

漏洞概要 关注数(24) 关注此漏洞

缺陷编号:wooyun-2016-0170021

漏洞标题:天融信TopScanner两处任意文件下载删除漏洞(无需登录)

相关厂商:天融信

漏洞作者: xfkxfk

提交时间:2016-01-15 10:15

修复时间:2016-04-11 16:08

公开时间:2016-04-11 16:08

漏洞类型:任意文件遍历/下载

危害等级:高

自评Rank:15

漏洞状态:厂商已经确认

漏洞来源: http://www.wooyun.org,如有疑问或需要帮助请联系 [email protected]

Tags标签:

4人收藏 收藏
分享漏洞:


漏洞详情

披露状态:

2016-01-15: 细节已通知厂商并且等待厂商处理中
2016-01-15: 厂商已经确认,细节仅向厂商公开
2016-01-18: 细节向第三方安全合作伙伴开放(绿盟科技唐朝安全巡航无声信息
2016-03-10: 细节向核心白帽子及相关领域专家公开
2016-03-20: 细节向普通白帽子公开
2016-03-30: 细节向实习白帽子公开
2016-04-11: 细节向公众公开

简要描述:

天融信TopScanner两处任意文件下载删除漏洞(无需登录)

详细说明:

第一处任意文件下载几删除:
文件/task/saveTaskIpList.php

<?
$fileName = $_GET['fileName'];
if(!$fileName){
header("Content-type: text/html; charset=utf-8");
echo "<script language='javascript'>";
echo "alert('保存过程发生错误!')";
echo "</script>";
exit();
}
$handler = fopen("$fileName",'r');
if(!$handler){
header("Content-type: text/html; charset='utf-8'");
echo "<script language='javascript'>";
echo "alert('保存过程中发生错误,打开文件失败!')";
echo "</script>";
exit();
}
$length = filesize($fileName);
if($length === false){
header("Content-type: text/html; charset='utf-8'");
echo "<script language='javascript'>";
echo "alert('保存过程发生错误,读取文件长度失败!')";
echo "</script>";
exit();
}
$outputFile = 'Devices';
header("Cache-Control:");
header("Cache-Control: public");
header("Content-Type: application/force-download");
header("Content-Disposition: attachment; filename=\"$outputFile\"");
header("Accept-Ranges: bytes");
$size=filesize($fileName);
$fp=fopen("$fileName","rb");
fseek($fp,$range);
while(!feof($fp)){
print(fread($fp,1024*8));
}
fclose($fp);
unlink($fileName);
?>


$fileName = $_GET['fileName'];直接进入fopen,fread导致任意文件读取
而且$fileName还进入了unlink函数,导致任意文件删除
第二处任意文件下载:
文件/task/downloadFile.php

<?
include_once 'policy/CTaskManager.php';
session_start();
$fileName=$_GET['fileName'];
$fileTar="report/".$fileName;

header("Content-Description: File Transfer");
header("Content-Type: application/octet-stream");
header("Content-Disposition: attachment; filename=".basename($fileTar));
header("Content-Transfer-Encoding: binary");
header("Expires:0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Pragma: public");
header("Content-Length: " . filesize($fileTar));
ob_clean();
flush();
readfile($fileTar);
exit();
?>


显而易见$fileName进入readfile函数导致任意文件读取

漏洞证明:

漏洞验证链接见测试代码

5.png


6.png

修复方案:

登录验证

版权声明:转载请注明来源 xfkxfk@乌云


漏洞回应

厂商回应:

危害等级:中

漏洞Rank:7

确认时间:2016-01-15 14:14

厂商回复:

已确认,感谢提交!

最新状态:

暂无