漏洞概要
关注数(24 )
关注此漏洞
漏洞标题:
iSiteCMS最新版本sql注射漏洞
>
漏洞详情 披露状态:
2014-02-27: 细节已通知厂商并且等待厂商处理中 2014-02-28: 厂商已经确认,细节仅向厂商公开 2014-03-03: 细节向第三方安全合作伙伴开放 2014-04-24: 细节向核心白帽子及相关领域专家公开 2014-05-04: 细节向普通白帽子公开 2014-05-14: 细节向实习白帽子公开 2014-05-28: 细节向公众公开
简要描述: 无视GPC~~
详细说明: 在/iSite 2.0 RC1 B684/isite/core/search.cache.php第114行有这么一个函数
function loadByID($id){ $this->updateCache();//更新缓存,保证获取到的数据时最新的 $this->tag = md5($this->caller.$filterTag); if($row = $this->DBE->getRow("SELECT * FROM #__search_cache WHERE `id`=$id")){//漏洞在这里 $this->_restore($row); return true; }else{ return false; }
我们尝试跟踪上面的$id来自哪里~~/iSite 2.0 RC1 B684/isite/components/search/search.fe.php第16行
function _ACT_search($id=null){ $this->setWorkChannel(1); cAuth(AUTH_G_AUSEARCH) or authMsg(); ******************************************************//省略N代码 if(!$sc->loadByFilterTag($where)){ $ids = $this->DBE->getAll("select `id` from #__content WHERE $where limit 1000"); $sc->create($where,$ids,$keywords,$intro);
上面的$sc->loadBYFilter句柄会接受传入的tag值(根据传入的keyword值生成),如果不同,那么执行下面的$this->DBE->getAll("select `id` from #__content WHERE $where limit 1000");显示表中1000条数据的id值给$ids数组。跟进$sc->create
function create($filterTag,$ids,$keywords='',$intro='',$user_id=0,$total=null){ if(is_string($ids)){ $ids = explode(',',$ids); **********************************//省略若干 $this->tag = md5($this->caller.$filterTag); $this->ids = $ids; $this->intro = $intro; $this->keywords = $keywords; $this->user_id = $user_id; $this->total = $total; $this->ip = ISS_CLIENT_IP; $this->id = null; $this->_save();
跟进_save()函数
function _save(){ if(is_null($this->id)){ if(is_null($this->time)){ $this->setPeriod(); } $rec['tag'] = $this->tag; $rec['ids'] = $this->ids; $rec['intro'] = $this->intro; $rec['keywords'] = $this->keywords; $rec['user_id'] = $this->user_id; $rec['total'] = $this->total; $rec['time'] = $this->time; $rec['params'] = serialize($this->params); $this->DBE->insertRow('#__search_cache',$rec); $this->id = $this->DBE->getInsertID();//这个总算返回了id值,取最后插入缓存表中的id值
跟进回去/iSite 2.0 RC1 B684/isite/components/search/search.fe.php第70行
$this->flash('搜索完成','请稍候....',bu(1,'search','search',$sc->id));//这边就是刚才插入的最后的id值,返回到url中 } if($id){//从url中获取id值 if(!$sc->loadByID($id)){//这个函数就是刚开始的第一段代码 $this->flash('错误','搜索缓存失效'.$id,bu(1,'search','search')); }
这个函数的作用是获取url传入的id值然后去查找缓存表,如果缓存存在,就从缓存中读取。如果缓存id不纯正就提示缓存失效,这里的url的id可控,所以注入产生。
漏洞证明: 本地搭建环境测试,先要在http://127.0.0.1/site/index.php?igo=iss,search的搜索框中填入几个关键字搜索增加缓存表的缓存记录。然后会返回缓存的url比如http://127.0.0.1/site/index.php?igo=iss,search,search,615 我们来看mysql的log是否真的会带入查询
这里由于你们的debug是不回显错误的mysql_error被你们去掉了,蛋碎了最喜欢这个了 根据返回对错判断 http://127.0.0.1/site/index.php?igo=iss,search,search,615 and 1=1//真 http://127.0.0.1/site/index.php?igo=iss,search,search,615 and 1=2//假 根据延时判断注射http://127.0.0.1/site/index.php?igo=iss,search,search,615 and sleep(11)//读取数据延时11秒~~
修复方案:
>
漏洞回应 厂商回应: 危害等级:中
漏洞Rank:6
确认时间:2014-02-28 12:18
厂商回复: 感谢提交的漏洞信息,我们将尽快安排修复!
最新状态: 暂无