Catalog
1 . Vulnerability Description 2 . Vulnerability trigger Condition 3 . Vulnerability Impact Range 4 . Vulnerability Code Analysis 5 . Defense Methods 6. Defensive thinking
1. Vulnerability description
SQL injection present in the membership module
Relevant Link
http://www.cnseay.com/1959/
2. Vulnerability Trigger Condition
1. Open http://127.0.0.1/dedecms/member/flink_main.php#2. In the connection URL, write http:///sss2 '), (8,1,@ "), (8, (select User ()), ' 33333/* connection name arbitrarily here the 8 is your user ID To see what you have to know about your user ID, check the cookie for a dedeuserid that is your user ID* /
Relevant Link:
http://www.wooyun.org/bugs/wooyun-2014-048878
3. Vulnerability Impact Range
4. Vulnerability Code Analysis
/member/flink_main.php
if($dopost = ="AddNew") {ajaxhead (); $row= $dsql->getone ("Select Count (*) as DD from ' #@__member_flink ' where mid= '". $cfg _ml->m_id."'"); if($row ['DD']>= -) {echo"<font color= ' red ' > Add URL failed because it has reached the upper limit of 50 URLs! </font>"; Getlinklist ($dsql); Exit (); } //if there's HTTP in front, it's not filtered. if(!eregi ("^http://", $url)) {$url="/ http". Htmlreplace ($url,2); } $title=Htmlreplace ($title); //$url brought into SQL query without filtering$inquery ="INSERT into ' #@__member_flink ' (mid,title,url) VALUES (". $cfg _ml->m_id.", ' $title ', ' $url '); "; $dsql-executenonequery ($inquery); Echo"<font color= ' Red ' > successfully added a link! </font>"; Getlinklist ($dsql); Exit ();}
5. Defense Methods
/member/flink_main.php
if($dopost = ="AddNew") {ajaxhead (); $row= $dsql->getone ("Select Count (*) as DD from ' #@__member_flink ' where mid= '". $cfg _ml->m_id."'"); if($row ['DD']>= -) {echo"<font color= ' red ' > Add URL failed because it has reached the upper limit of 50 URLs! </font>"; Getlinklist ($dsql); Exit (); } //if there's HTTP in front, it's not filtered. if(!eregi ("^http://", $url)) {$url="/ http". Htmlreplace ($url,2); } $title=Htmlreplace ($title); /*$url Filtration*/$url=Htmlreplace ($url); /**/$inquery="INSERT into ' #@__member_flink ' (mid,title,url) VALUES (". $cfg _ml->m_id.", ' $title ', ' $url '); "; $dsql-executenonequery ($inquery); Echo"<font color= ' Red ' > successfully added a link! </font>"; Getlinklist ($dsql); Exit ();}
6. Defensive Thinking
Copyright (c) Littlehann All rights reserved
dedecms/member/flink_main.php SQL Injection Vul