dedecms/member/flink_main.php SQL Injection Vul

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.