织梦member/reg_new.php SQL注入漏洞修复
如遇下载链接蓝奏网盘打不开lanzous替换成lanzoux尝试! 广告
![](/linkpic/xianzhuifeng.jpg)
1. 漏洞描述
Dedecms会员中心注入漏洞
2. 漏洞触发条件
/member/reg_new.php?dopost=regbase&step=1&mtype=%B8%F6%C8%CB&mtype=%B8%F6%C8%CB&userid=123asd123&uname=12asd13123&userpwd=123123&userpwdok=123123&email=1213asd123%40QQ.COM&safequestion=1′,’1111111111111′,’1389701121′,’127.0.0.1′,’1389701121′,’127.0.0.1′),(‘个人’,user(),’4297f44b13955235245b2497399d7a93′,’12as11111111111111111d13123′,”,’10’,’0′,’1213asd11111111111123@QQ.COM’,’100′, ‘0’,’-10′,”,’1&safeanswer=1111111111111&sex=&vdcode=slum&agree=
//把vdcode=slum改成当前的验证码
3. 漏洞影响范围
4. 漏洞代码分析
/member/reg_new.php
..
$jointime = time();
$logintime = time();
$joinip = GetIP();
$loginip = GetIP();
$pwd = md5($userpwd);
$spaceSta = ($cfg_mb_spacesta < 0 ? $cfg_mb_spacesta : 0);
//未对$mtype、$safeanswer、$safequestion进行有效过滤就带入SQL查询
$inQuery = “INSERT INTO dede_member (mtype ,userid ,pwd ,uname ,sex ,rank ,money ,email ,scores ,
matt, spacesta ,face,safequestion,safeanswer ,jointime ,joinip ,logintime ,loginip )
VALUES (‘$mtype’,’$userid’,’$pwd’,’$uname’,’$sex’,’10’,’$dfmoney’,’$email’,’$dfscores’,
‘0’,’$spaceSta’,”,’$safequestion’,’$safeanswer’,’$jointime’,’$joinip’,’$logintime’,’$loginip’); “;
if($dsql->ExecuteNoneQuery($inQuery))
..
5. 防御方法
/member/reg_new.php
..
$jointime = time();
$logintime = time();
$joinip = GetIP();
$loginip = GetIP();
$pwd = md5($userpwd);
/* 对$mtype、$safeanswer、$safequestion进行有效过滤 */
$mtype = HtmlReplace($mtype,1);
$safeanswer = HtmlReplace($safeanswer);
$safequestion = HtmlReplace($safequestion);
/* */
$spaceSta = ($cfg_mb_spacesta < 0 ? $cfg_mb_spacesta : 0);
$inQuery = “INSERT INTO dede_member (mtype ,userid ,pwd ,uname ,sex ,rank ,money ,email ,scores ,
matt, spacesta ,face,safequestion,safeanswer ,jointime ,joinip ,logintime ,loginip )
VALUES (‘$mtype’,’$userid’,’$pwd’,’$uname’,’$sex’,’10’,’$dfmoney’,’$email’,’$dfscores’,
‘0’,’$spaceSta’,”,’$safequestion’,’$safeanswer’,’$jointime’,’$joinip’,’$logintime’,’$loginip’); “;
if($dsql->ExecuteNoneQuery($inQuery))
{
..
红色部分是添加的代码
NOTICE:【咨询风格酷】客服微信:wwwxmamnet
NOTICE:【风格酷模板网②群】QQ群:288678775
☉免责声明:本站所有模板均来自用户分享和网络收集,仅供学习与参考,请勿用于商业用途,如果损害了您的权利,请联系网站客服,我们核实后会立即删除。
☉如果源码网盘地址失效!或有其他问题,请点我报错,谢谢合作!
☉人民币与积分汇率为1比10,即1元=10积分.有任何疑问请联系客服!
☉如有其他问题,请加网站客服QQ(1131734965)进行交流。
☉本站提供的源码、模板、软件工具等其他资源,都不包含技术服务,请大家谅解!
☉源码、模板等资源会随着技术、环境的升级而存在部分问题,还请慎重选择。