From d7cf0ce39db684c5328e39e7d15dec8f10633099 Mon Sep 17 00:00:00 2001 From: thisgun Date: Tue, 5 Jun 2018 11:33:12 +0900 Subject: [PATCH] =?UTF-8?q?KVE-2018-366,=20379,=20397=20=EC=B7=A8=EC=95=BD?= =?UTF-8?q?=EC=A0=90=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- adm/board_form_update.php | 8 ++++---- adm/contentformupdate.php | 8 ++++---- adm/qa_config_update.php | 8 ++++---- adm/sms_admin/form_list.php | 2 ++ adm/sms_admin/num_book.php | 1 + lib/common.lib.php | 2 +- 6 files changed, 16 insertions(+), 13 deletions(-) diff --git a/adm/board_form_update.php b/adm/board_form_update.php index b7e56ef8c..8b40bc8d2 100644 --- a/adm/board_form_update.php +++ b/adm/board_form_update.php @@ -29,8 +29,8 @@ if ($board && ($board['bo_include_head'] !== $_POST['bo_include_head'] || $board if ($file = $_POST['bo_include_head']) { $file_ext = pathinfo($file, PATHINFO_EXTENSION); - if( ! $file_ext || ! in_array($file_ext, array('php', 'htm', 'html')) ) { - alert('상단 파일 경로의 확장자는 php, html 만 허용합니다.'); + if( ! $file_ext || ! in_array($file_ext, array('php', 'htm', 'html')) || ! preg_match('/^.*\.(php|htm|html)$/i', $file) ) { + alert('상단 파일 경로의 확장자는 php, htm, html 만 허용합니다.'); } $_POST['bo_include_head'] = $file; } @@ -38,8 +38,8 @@ if ($file = $_POST['bo_include_head']) { if ($file = $_POST['bo_include_tail']) { $file_ext = pathinfo($file, PATHINFO_EXTENSION); - if( ! $file_ext || ! in_array($file_ext, array('php', 'htm', 'html')) ) { - alert('하단 파일 경로의 확장자는 php, html 만 허용합니다.'); + if( ! $file_ext || ! in_array($file_ext, array('php', 'htm', 'html')) || ! preg_match('/^.*\.(php|htm|html)$/i', $file) ) { + alert('하단 파일 경로의 확장자는 php, htm, html 만 허용합니다.'); } $_POST['bo_include_tail'] = $file; } diff --git a/adm/contentformupdate.php b/adm/contentformupdate.php index 753c5e4bf..9904425b1 100644 --- a/adm/contentformupdate.php +++ b/adm/contentformupdate.php @@ -41,8 +41,8 @@ if( $co_include_head ){ $file_ext = pathinfo($co_include_head, PATHINFO_EXTENSION); - if( ! $file_ext || ! in_array($file_ext, array('php', 'htm', 'html')) ) { - alert('상단 파일 경로의 확장자는 php, html 만 허용합니다.'); + if( ! $file_ext || ! in_array($file_ext, array('php', 'htm', 'html')) || ! preg_match('/^.*\.(php|htm|html)$/i', $co_include_head) ) { + alert('상단 파일 경로의 확장자는 php, htm, html 만 허용합니다.'); } } @@ -50,8 +50,8 @@ if( $co_include_tail ){ $file_ext = pathinfo($co_include_tail, PATHINFO_EXTENSION); - if( ! $file_ext || ! in_array($file_ext, array('php', 'htm', 'html')) ) { - alert('하단 파일 경로의 확장자는 php, html 만 허용합니다.'); + if( ! $file_ext || ! in_array($file_ext, array('php', 'htm', 'html')) || ! preg_match('/^.*\.(php|htm|html)$/i', $co_include_tail) ) { + alert('하단 파일 경로의 확장자는 php, htm, html 만 허용합니다.'); } } diff --git a/adm/qa_config_update.php b/adm/qa_config_update.php index a472f7c6c..df9153e9c 100644 --- a/adm/qa_config_update.php +++ b/adm/qa_config_update.php @@ -24,16 +24,16 @@ if ($board && ($qaconfig['qa_include_head'] !== $_POST['qa_include_head'] || $qa if( $qa_include_head ){ $file_ext = pathinfo($qa_include_head, PATHINFO_EXTENSION); - if( ! $file_ext || ! in_array($file_ext, array('php', 'htm', 'html')) ) { - alert('상단 파일 경로의 확장자는 php, html 만 허용합니다.'); + if( ! $file_ext || ! in_array($file_ext, array('php', 'htm', 'html')) || ! preg_match('/^.*\.(php|htm|html)$/i', $qa_include_head) ) { + alert('상단 파일 경로의 확장자는 php, htm, html 만 허용합니다.'); } } if( $qa_include_tail ){ $file_ext = pathinfo($qa_include_tail, PATHINFO_EXTENSION); - if( ! $file_ext || ! in_array($file_ext, array('php', 'htm', 'html')) ) { - alert('하단 파일 경로의 확장자는 php, html 만 허용합니다.'); + if( ! $file_ext || ! in_array($file_ext, array('php', 'htm', 'html')) || ! preg_match('/^.*\.(php|htm|html)$/i', $qa_include_tail) ) { + alert('하단 파일 경로의 확장자는 php, htm, html 만 허용합니다.'); } } diff --git a/adm/sms_admin/form_list.php b/adm/sms_admin/form_list.php index 97cb3396f..dca08fb51 100644 --- a/adm/sms_admin/form_list.php +++ b/adm/sms_admin/form_list.php @@ -13,6 +13,8 @@ $g5['title'] = "이모티콘 관리"; if ($page < 1) $page = 1; +$fg_no = isset($fg_no) ? (int) $fg_no : ''; + if (is_numeric($fg_no)) $sql_group = " and fg_no='$fg_no' "; else diff --git a/adm/sms_admin/num_book.php b/adm/sms_admin/num_book.php index 14a892bc5..567e05f00 100644 --- a/adm/sms_admin/num_book.php +++ b/adm/sms_admin/num_book.php @@ -14,6 +14,7 @@ $g5['title'] = "휴대폰번호 관리"; if ($page < 1) $page = 1; $bg_no = isset($bg_no) ? (int) $bg_no : 0; +$st = isset($st) ? preg_replace('/[^a-z0-9]/i', '', $st) : ''; if (is_numeric($bg_no)) $sql_group = " and bg_no='$bg_no' "; diff --git a/lib/common.lib.php b/lib/common.lib.php index 23f07d00b..084ffb16e 100644 --- a/lib/common.lib.php +++ b/lib/common.lib.php @@ -3478,7 +3478,7 @@ function is_include_path_check($path='', $is_input='') return false; } - if( preg_match('/\/data\/(file|editor)\/[A-Za-z0-9_]{1,20}\//', $path) ){ + if( preg_match('/\/data\/(file|editor|qa|cache|member|member_image|session|tmp)\/[A-Za-z0-9_]{1,20}\//i', $path) ){ return false; } }