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

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

缺陷编号:wooyun-2014-073319

漏洞标题:php云人才系统存储型跨站多处

相关厂商:php云人才系统

漏洞作者: linadmin

提交时间:2014-08-21 16:50

修复时间:2014-11-19 16:52

公开时间:2014-11-19 16:52

漏洞类型:xss跨站脚本攻击

危害等级:中

自评Rank:10

漏洞状态:厂商已经确认

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

Tags标签:

4人收藏 收藏
分享漏洞:


漏洞详情

披露状态:

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

简要描述:

前台过滤不严,绕过防护跨站

详细说明:

再次发现phpyunCMS存储型跨站2枚,可能存在多处
漏洞代码位于
/phpyun/friend/model/index.class.php
第一处是:
function save_action()//xss
{
if($this->uid=='')
{
$this->obj->ACT_layer_msg( "请先登录!", 8);
}
if(trim($_POST['title'])=="")
{
$this->obj->ACT_layer_msg( "标题不能为空!", 8);
}
$data['title']=$_POST['title'];
$data['cid']=(int)$_POST['cid'];
$data['content']=str_replace("&","&",html_entity_decode($_POST['content'],ENT_QUOTES,"GB2312"));
$data['uid']=$this->uid;
$data['add_time']=time();
$n_ids=$this->obj->insert_into("question",$data);
if($n_ids)
{
$nickname=$this->obj->DB_select_once("firend_info","`uid`='".$this->uid."'","`nickname`");
$gourl= $this->aurl(array("url"=>"c:content,id:".$n_ids));
$sql['uid']=$this->uid;
$sql['content']="发布了问答《<a href=\"".$gourl."\" target=\"_blank\">".$_POST['title']."</a>》。";
$sql['ctime']=time();
$this->obj->insert_into("friend_state",$sql);
$gourl= $this->aurl(array("url"=>"c:index"));
$this->obj->ACT_layer_msg( "提问成功!",9,$gourl);
}else{
$this->obj->ACT_layer_msg( "提问失败!", 8);
}
}
第二处:
function answer_action()//xsssss
{
$gourl= $this->aurl(array("url"=>"c:content,id:".$_GET['id']));
if($_POST['content'])
{
$q_title=$this->obj->DB_select_once("question","`id`='".(int)$_GET['id']."'","`uid`,`title`,`content`");
if($q_title['uid']==$this->uid)
{
$content = str_replace("&amp;","&",html_entity_decode("<br/>追加内容:<br/>".$_POST['content'],ENT_QUOTES,"GB2312"));
$content=$q_title['content'].$content;
$id=$this->obj->update_once("question",array("content"=>$content),array("id"=>(int)$_GET['id']));
if($id)
{
$this->obj->ACT_layer_msg( "提问追加成功!",9,$gourl);
}else{
$this->obj->ACT_layer_msg( "提问追加失败!",8,$gourl);
}
}else{
$data['qid']=(int)$_GET['id'];
$data['content']=str_replace("&amp;","&",html_entity_decode($_POST['content'],ENT_QUOTES,"GB2312"));
$data['uid']=$this->uid;
$data['comment']=0;
$data['support']=0;
$data['oppose']=0;
$data['add_time']=time();
$id=$this->obj->insert_into("answer",$data);
if($id)
{
$this->obj->DB_update_all("question","`answer_num`=`answer_num`+1","id='".(int)$_GET['id']."'");
$state_content = "回答了问答《<a href=\"".$gourl."\" target=\"_blank\">".$q_title['title']."</a>》。";
$this->addstate($state_content);
$this->obj->ACT_layer_msg( "回答成功!", 9,$gourl);
}else{
$this->obj->ACT_layer_msg( "回答失败!", 8);
}
}
}else{
$this->obj->ACT_layer_msg( "内容不能为空!", 2);
}
}
两处代码的漏洞都在于$_POST['content']变量并没有进行良好的过滤,直接写入数据库中,虽然phpyun有其他的防护拦截,但是依旧可以绕过,绕过代码
<a href="data:text/html;base64,PHNjcmlwdD5hbGVydCgiWFNTIik8L3NjcmlwdD4=">test<a>
或者<iframe src=”http://www.baidu.com”>tt</iframe>
验证:
第一处代码对应的功能是“我要提问”
如图:

1.png


然后查看“我的问题”

2.png


点击test触发弹框
第二处在追加(回答)问题处

3.png


提交后可见

4.png


验证完毕。
经过我对代码的粗略阅读,phpyunCMS中大量存在类似的缺陷代码,对应的功能我没有详细挖掘,肯定的是存储型跨站绝对不止这两处,希望厂商能对代码整体进行修复。

漏洞证明:

详见说明

修复方案:

过滤

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


漏洞回应

厂商回应:

危害等级:中

漏洞Rank:10

确认时间:2014-08-21 21:16

厂商回复:

感谢您的提供,针对此处,我们会进行排查并修复!

最新状态:

暂无