dedecms任意文件上传漏洞 include/dialog/select_soft_post.php 修复

dedecms变量覆盖漏洞导致任意文件上传,dedecms任意文件上传漏洞 include/dialog/select_soft_post.php 修复。

打开文件:include/dialog/select_soft_post.php

找到代码:$fullfilename = $cfg_basedir.$activepath.'/'.$filename;  大概72行

在其上面加入如下代码:

if (preg_match('#.(php|pl|cgi|asp|aspx|jsp|php5|php4|php3|shtm|shtml)[^a-zA-Z0-9]+$#i', trim($filename))) { ShowMsg("做啦提醒您文件名被系统禁止!",'javascript:;'); exit(); } $fullfilename = $cfg_basedir.$activepath.'/'.$filename;;

效果如下: