Skip to content

Commit

Permalink
6월 25일 제보한 영카트 보안취약점 수정 #249
Browse files Browse the repository at this point in the history
  • Loading branch information
thisgun committed Jul 11, 2023
1 parent 8eb1d46 commit 79ce9ec
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
14 changes: 9 additions & 5 deletions shop/itemqaformupdate.php
Expand Up @@ -84,7 +84,7 @@
alert("답변이 있는 상품문의는 삭제하실 수 없습니다.");
}

// 에디터로 첨부된 이미지 삭제
// 에디터로 첨부된 썸네일 이미지만 삭제
$sql = " select iq_question, iq_answer from {$g5['g5_shop_item_qa_table']} where iq_id = '$iq_id' and md5(concat(iq_id,iq_time,iq_ip)) = '{$hash}' ";
$row = sql_fetch($sql);

Expand All @@ -101,8 +101,10 @@

$destfile = ( ! preg_match('/\w+\/\.\.\//', $data_path) ) ? G5_PATH.$data_path : '';

if($destfile && preg_match('/\/data\/editor\/[A-Za-z0-9_]{1,20}\//', $destfile) && is_file($destfile))
@unlink($destfile);
if ($destfile && preg_match('/\/data\/editor\/[A-Za-z0-9_]{1,20}\//', $destfile) && is_file($destfile)) {
delete_item_thumbnail(dirname($destfile), basename($destfile));
//@unlink($destfile);
}
}
}

Expand All @@ -121,8 +123,10 @@

$destfile = ( ! preg_match('/\w+\/\.\.\//', $data_path) ) ? G5_PATH.$data_path : '';

if($destfile && preg_match('/\/data\/editor\/[A-Za-z0-9_]{1,20}\//', $destfile) && is_file($destfile))
@unlink($destfile);
if ($destfile && preg_match('/\/data\/editor\/[A-Za-z0-9_]{1,20}\//', $destfile) && is_file($destfile)) {
delete_item_thumbnail(dirname($destfile), basename($destfile));
// @unlink($destfile);
}
}
}

Expand Down
8 changes: 5 additions & 3 deletions shop/itemuseformupdate.php
Expand Up @@ -93,7 +93,7 @@
alert("자신의 사용후기만 삭제하실 수 있습니다.");
}

// 에디터로 첨부된 이미지 삭제
// 에디터로 첨부된 썸네일 이미지 삭제
$sql = " select is_content from {$g5['g5_shop_item_use_table']} where is_id = '$is_id' and md5(concat(is_id,is_time,is_ip)) = '{$hash}' ";
$row = sql_fetch($sql);

Expand All @@ -111,8 +111,10 @@

$destfile = ( ! preg_match('/\w+\/\.\.\//', $data_path) ) ? G5_PATH.$data_path : '';

if($destfile && preg_match('/\/data\/editor\/[A-Za-z0-9_]{1,20}\//', $destfile) && is_file($destfile))
@unlink($destfile);
if ($destfile && preg_match('/\/data\/editor\/[A-Za-z0-9_]{1,20}\//', $destfile) && is_file($destfile)) {
delete_item_thumbnail(dirname($destfile), basename($destfile));
//@unlink($destfile);
}
}
}

Expand Down

0 comments on commit 79ce9ec

Please sign in to comment.