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

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

缺陷编号:wooyun-2014-051054

漏洞标题:Thinksaas v2.1 Sql Injection

相关厂商:thinksaas.cn

漏洞作者: ′雨。

提交时间:2014-02-19 14:00

修复时间:2014-05-20 14:01

公开时间:2014-05-20 14:01

漏洞类型:SQL注射漏洞

危害等级:高

自评Rank:20

漏洞状态:厂商已经确认

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

Tags标签:

4人收藏 收藏
分享漏洞:


漏洞详情

披露状态:

2014-02-19: 细节已通知厂商并且等待厂商处理中
2014-02-20: 厂商已经确认,细节仅向厂商公开
2014-02-23: 细节向第三方安全合作伙伴开放
2014-04-16: 细节向核心白帽子及相关领域专家公开
2014-04-26: 细节向普通白帽子公开
2014-05-06: 细节向实习白帽子公开
2014-05-20: 细节向公众公开

简要描述:

今天看到发布了2.1就去下载了个看看。
但是还是有洞没补。

详细说明:

\app\article\action\admin\cate.php
这文件在admin目录下 是为了让是管理才能访问的?
但是我自己在前台注册了一个用户, 可以直接访问到。
难道这是传说中的越权?

case "edit_do":
$cateid = intval($_POST['cateid']);
$catename = tsClean($_POST['catename']);

$new['article']->update('article_cate',array(
'cateid'=>$cateid,
),array(
'catename'=>$catename,
'orderid'=>intval($_POST['orderid']),
));

header("Location: ".SITE_URL."index.php?app=article&ac=admin&mg=cate&ts=list");

break;
}


function tsClean($text) {
$text = cleanJs ( $text );
return $text;
}


function cleanJs($text) {
$text = trim ( $text );
$text = stripslashes ( $text );
// 完全过滤注释
$text = preg_replace ( '/<!--?.*-->/', '', $text );
// 完全过滤动态代码
$text = preg_replace ( '/<\?|\?>/', '', $text );
// 完全过滤js
$text = preg_replace ( '/<script?.*\/script>/', '', $text );
// 过滤多余html
$text = preg_replace ( '/<\/?(html|head|meta|link|base|body|title|style|script|form|iframe|frame|frameset)[^><]*>/i', '', $text );
// 过滤on事件lang js
while ( preg_match ( '/(<[^><]+)(lang|data|onfinish|onmouse|onexit|onerror|onclick|onkey|onload|onchange|onfocus|onblur)[^><]+/i', $text, $mat ) ) {
$text = str_replace ( $mat [0], $mat [1], $text );
}
while ( preg_match ( '/(<[^><]+)(window\.|javascript:|js:|about:|file:|document\.|vbs:|cookie)([^><]*)/i', $text, $mat ) ) {
$text = str_replace ( $mat [0], $mat [1] . $mat [3], $text );
}
return $text;
}


正如这函数的名称, 只是cleanjs
然后带入update。row未过滤。

漏洞证明:

首先先新建一个分类。用于回显。

case "add_do":

$new['article']->create('article_cate',array(

'catename'=>tsClean($_POST['catename']),
'orderid'=>intval($_POST['orderid']),

));


header("Location: ".SITE_URL."index.php?app=article&ac=admin&mg=cate&ts=list");

break;


然后

1.jpg


然后再访问 http://127.0.0.1/thinksaas/index.php?app=article&ac=admin/cate&ts=list

2.jpg


成功 有图 有真相。

修复方案:

过滤。

版权声明:转载请注明来源 ′雨。@乌云


漏洞回应

厂商回应:

危害等级:高

漏洞Rank:15

确认时间:2014-02-20 09:55

厂商回复:

感谢反馈,已经修复。

最新状态:

暂无