dedecms安全漏洞

dedecms安全漏洞之/include/common.inc.php漏洞解决办法

Submitted by phifans on Tue, 12/20/2022 - 10:26

 在 /include/common.inc.php  中
找到注册变量的代码

foreach(Array('_GET','_POST','_COOKIE') as $_request)
{
         foreach($$_request as $_k => $_v) ${$_k} = _RunMagicQuotes($_v);
}

修改为:

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);
    }
}