영카트 원격 코드 실행 취약점 수정(2017-1050)

This commit is contained in:
thisgun
2018-03-15 14:20:06 +09:00
parent 7017ee2dc2
commit 91a3ca9f8a
5 changed files with 10 additions and 4 deletions

View File

@ -629,6 +629,10 @@ function it_img_upload($srcfile, $filename, $dir)
if($size[2] < 1 || $size[2] > 3)
return '';
//php파일도 getimagesize 에서 Image Type Flag 를 속일수 있다
if (!preg_match('/\.(gif|jpe?g|png)$/i', $filename))
return '';
if(!is_dir($dir)) {
@mkdir($dir, G5_DIR_PERMISSION);
@chmod($dir, G5_DIR_PERMISSION);