标题:dedecms上传漏洞
描述:dedecms过滤逻辑不严导致上传漏洞
文件:/include/uploadsafe.inc.php
漏洞修复方法:
找到该行代码:
${$_key.'_size'} = @filesize($$_key);
将该段代码修改为:
${$_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($image_dd == false){ continue; } if (!is_array($image_dd)) { exit(‘Upload filetype not allow !’); } }
评论回复