dedecmsV5.7 任意文件上传漏洞修复

问题文件:在/include/dialog/select_soft_post.php文件

解决方法:

先找到这个文件/include/dialog/select_soft_post.php,找到大概72,73行的

$fullfilename = $cfg_basedir.$activepath.'/'.$filename;      

在这行代码之前增加:

//任意文件上传漏洞修复----start-----
if (preg_match('#.(php|pl|cgi|asp|aspx|jsp|php5|php4|php3|shtm|shtml)[^a-zA-Z0-9]+$#i', trim($filename))){
    ShowMsg("你指定的文件名被系统禁止!",'javascript:;'); exit();
}
//任意文件上传漏洞修复-----end-----

然后保存上传服务器就OK了!

原文地址:https://www.cnblogs.com/apolloren/p/13695411.html