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

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

缺陷编号:wooyun-2015-0103343

漏洞标题:EduSoho SQL注入漏洞通杀众多版本

相关厂商:edusoho.com

漏洞作者: Comer

提交时间:2015-03-24 16:32

修复时间:2015-06-22 17:18

公开时间:2015-06-22 17:18

漏洞类型:SQL注射漏洞

危害等级:高

自评Rank:20

漏洞状态:厂商已经确认

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

Tags标签:

4人收藏 收藏
分享漏洞:


漏洞详情

披露状态:

2015-03-24: 细节已通知厂商并且等待厂商处理中
2015-03-24: 厂商已经确认,细节仅向厂商公开
2015-03-27: 细节向第三方安全合作伙伴开放
2015-05-18: 细节向核心白帽子及相关领域专家公开
2015-05-28: 细节向普通白帽子公开
2015-06-07: 细节向实习白帽子公开
2015-06-22: 细节向公众公开

简要描述:

版本4以上通杀吧~

详细说明:

down了源码,定位之
src/Topxia/WebBundle/Controller/SearchController.php 36行的categoryIds参数存在注入

<?php
namespace Topxia\WebBundle\Controller;
use Symfony\Component\HttpFoundation\Request;
use Topxia\Common\Paginator;
use Topxia\Common\ArrayToolkit;
class SearchController extends BaseController
{
public function indexAction(Request $request)
{
$courses = $paginator = null;
$code = 'Vip';
$currentUser = $this->getCurrentUser();
$keywords = $request->query->get('q');
$keywords=trim($keywords);

$vip = $this->getAppService()->findInstallApp($code);
$isShowVipSearch = $vip && version_compare($vip['version'], "1.0.7", ">=");

$currentUserVipLevel = "";
$vipLevelIds = "";
if($isShowVipSearch){
$currentUserVip = $this->getVipService()->getMemberByUserId($currentUser['id']);
$currentUserVipLevel = $this->getLevelService()->getLevel($currentUserVip['levelId']);
$vipLevels = $this->getLevelService()->findAllLevelsLessThanSeq($currentUserVipLevel['seq']);
$vipLevelIds = ArrayToolkit::column($vipLevels, "id");
}
$parentId = 0;
$categories = $this->getCategoryService()->findAllCategoriesByParentId($parentId);

$categoryIds=array();
for($i=0;$i<count($categories);$i++){
$id = $categories[$i]['id'];
$name = $categories[$i]['name'];
$categoryIds[$id] = $name;
}
$categoryId = $request->query->get('categoryIds');
$coursesTypeChoices = $request->query->get('coursesTypeChoices');
if (!$keywords) {
goto response;
}
if($coursesTypeChoices == 'vipCourses'){
$conditions = array(
'status' => 'published',
'title' => $keywords,
'categoryId' => $categoryId,
'vipLevelIds' => $vipLevelIds
);
}elseif($coursesTypeChoices == 'liveCourses'){
$conditions = array(
'status' => 'published',
'title' => $keywords,
'categoryId' => $categoryId,
'type' => 'live'
);
}else{
$conditions = array(
'status' => 'published',
'title' => $keywords,
'categoryId' => $categoryId
);
}
$paginator = new Paginator(
$this->get('request'),
$this->getCourseService()->searchCourseCount($conditions)
, 10
);
$courses = $this->getCourseService()->searchCourses(
$conditions,
'latest',
$paginator->getOffsetCount(),
$paginator->getPerPageCount()
);
response:
return $this->render('TopxiaWebBundle:Search:index.html.twig', array(
'courses' => $courses,
'paginator' => $paginator,
'keywords' => $keywords,
'isShowVipSearch' => $isShowVipSearch,
'currentUserVipLevel' => $currentUserVipLevel,
'categoryIds' => $categoryIds,
'coursesTypeChoices' => $coursesTypeChoices
));
}
...

本来打算回溯到具体的SQL查询,但发现是用了Symfony框架加上code审计能力有限....AdminBundle貌似后台也在调

1.png


漏洞证明:

localhost

2.png

官网demo.edusoho.com

web server operating system: Linux Ubuntu
web application technology: Nginx, PHP 5.5.9
back-end DBMS: MySQL >= 5.0.0
database management system users [1]:
[*] 'demoedusohouser'@'localhost'
available databases [2]:
[*] `demo.edusoho.com`
[*] information_schema

官网说是不少厂商在用,度娘谷大哥收录情况

5.png

4.png


测了4~5均存在该注入包括最新的5.1.4,低版本的试了1-2好像没这个函数的相关功能,3的就不知了夜深了就酱~

修复方案:

注入这个必须懂...

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


漏洞回应

厂商回应:

危害等级:高

漏洞Rank:10

确认时间:2015-03-24 17:17

厂商回复:

感谢@Comer

最新状态:

2015-03-25:已修复