dedecms上传漏洞uploadsafe.inc.php修复方法(dedecms 5.3)
今天分享的漏洞是一个关于织梦dedecms上传漏洞修复方法,主要是文件/include/uploadsafe.inc.php。
有2个地方:
1、搜索 ${$_key.'_size'} = @filesize($$_key); }(大概在42,43行左右)
替换成
${$_key.'_size'} = @filesize($$_key);
} $imtypes = array("image/pjpeg", "image/jpeg", "image/gif", "image/png", "image/xpng", "image/wbmp", "image/bmp"); if(in_array(strtolower(trim(${$_key.'_type'})), $imtypes)) { $image_dd = @getimagesize($$_key); if($image_dd == false){ continue; } if (!is_array($image_dd)) { exit('Upload filetype not allow !'); } }