CVE编号
N/A利用情况
暂无补丁情况
N/A披露时间
2013-11-07漏洞描述
XDcms是一套完全开源的网上订餐系统。xdcms存在注入漏洞。攻击者可以利用漏洞操作数据库。解决建议
1).system\function\fun.inc.php1.将system\function\fun.inc.php中的:unction safe_html($str){if(empty($str)){return;}$str=preg_replace('/select|insert | update | and | in | on | left | joins | delete|\%|\=|\/\*|\*|\.\.\/|\.\/| union | from | where | group | into |load_file//|outfile/','',$str);return htmlspecialchars($str, ENT_COMPAT ,'GB2312');}修改为:function safe_html($str){if(empty($str)){return;}$str=preg_replace("/select|'|insert | update | and | in | on | left | joins | delete|\%|\=|\/\*|\*|\.\.\/|\.\/| union | from | where | group | into |load_file|outfile/i",'',$str);return htmlspecialchars($str, ENT_COMPAT ,'GB2312');}即过滤单引号,直接防止宽字节闭合单引号的情况。2. 然后将system\modules\xdcms\login.php中的:$password = safe_html($_POST['password']);修改为:$password = $_POST['password'];也可自行编写一个通用的防注入函数进行调用,过滤为空的方式不可取。而密码没有经过数据库处理,无需使用 safe_html 函数过滤,防止密码存在相应关键字直接exit(); .而对于宽字节注入的问题可以将单引号过滤掉(做严格的过滤处理,推荐),或者在数据库连接的时候执行:mysql_query("SET character_set_client=binary");
参考链接 |
|
---|---|
https://www.cnvd.org.cn/flaw/show/CNVD-2013-14285 |
- 攻击路径 网络
- 攻击复杂度 低
- 权限要求 无
- 影响范围 N/A
- 用户交互 N/A
- 可用性 部分地
- 保密性 完全地
- 完整性 部分地
还没有评论,来说两句吧...