DEDECMS Session variable overwrite causes SQL injection Vulnerability Patching scenario

Source: Internet
Author: User

Tag: Get BSP ALS Operation search color causes database connection Webshell

Dedecms/plus/advancedsearch.php, directly from $_session[$sqlhash] get the value as $query into the SQL query, the exploit premise is Session.auto_start = 1 The automatic session is started.

Harm:

1. Hackers can use this vulnerability to redefine a database connection.

2. Through this vulnerability to a variety of ultra-vires operation construction vulnerabilities directly written to the Webshell backdoor.

The Cloud Shield team has a universal unified defense in the DEDEMCS variable registration portal, which prohibits the entry of session variables, and fixes the following methods:

Open/mnt/www/xiaoshuo/include/common.inc.php file with a text editor

First, search the following string

(cfg_| Globals|_get|_post| _cookie)  To be replaced by (Cfg_| globals|_get|_post|_cookie| _session)  

There are two places ' can be replaced '

Second, search the following code:

    foreach(Array ('_get','_post','_cookie') as$_request) {        foreach($_request as$_k =$_v) {                        if($_k = ='Nvarname') ${$_k} =$_v; Else${$_k} =_runmagicquotes ($_V); }

To be replaced by:

foreach(Array ('_get','_post','_cookie') as$_request) {         foreach($_request as$_k =$_v) {                    if(strlen ($_k) >0&& eregi ('^ (cfg_| GLOBALS)', $_k)) {Exit ('Request var not allow!'); } ${$_k}=_runmagicquotes ($_V); }}

Such a session variable overwrite causes the SQL injection vulnerability to be resolved!

DEDECMS Session variable overwrite causes SQL injection Vulnerability Patching scenario

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.