dedecms變量覆蓋漏洞導(dǎo)致任意文件上傳,dedecms任意文件上傳漏洞 include/dialog/select_soft_post.php 修復(fù)。
打開文件: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("秀站網(wǎng)提醒您文件名被系統(tǒng)禁止!",'javascript:;'); exit(); } $fullfilename = $cfg_basedir.$activepath.'/'.$filename;; |
效果如下: