diff --git a/adm/admin.lib.php b/adm/admin.lib.php index 28db108e4..822f5857b 100644 --- a/adm/admin.lib.php +++ b/adm/admin.lib.php @@ -355,6 +355,17 @@ function get_admin_token() return $token; } +//input value 에서 xss 공격 filter 역할을 함 ( 반드시 input value='' 타입에만 사용할것 ) +function get_sanitize_input($s, $is_html=false){ + + if(!$is_html){ + $s = strip_tags($s); + } + + $s = htmlspecialchars($s, ENT_QUOTES, 'utf-8'); + + return $s; +} // POST로 넘어온 토큰과 세션에 저장된 토큰 비교 function check_admin_token() diff --git a/adm/auth_list_delete.php b/adm/auth_list_delete.php index 46acecce6..0327c1889 100644 --- a/adm/auth_list_delete.php +++ b/adm/auth_list_delete.php @@ -9,17 +9,24 @@ if ($is_admin != 'super') check_admin_token(); -$count = count($_POST['chk']); +$count = (isset($_POST['chk']) && is_array($_POST['chk'])) ? count($_POST['chk']) : 0; if (!$count) alert($_POST['act_button']." 하실 항목을 하나 이상 체크하세요."); +if ( (isset($_POST['mb_id']) && ! is_array($_POST['mb_id'])) || (isset($_POST['au_menu']) && ! is_array($_POST['au_menu'])) ){ + alert("잘못된 요청입니다."); +} + for ($i=0; $i<$count; $i++) { // 실제 번호를 넘김 $k = $chk[$i]; + + $mb_id = preg_replace('/[^a-zA-Z0-9_]/', '', $_POST['mb_id'][$k]); + $au_menu = preg_replace('/[^a-zA-Z0-9_]/', '', $_POST['au_menu'][$k]); - $sql = " delete from {$g5['auth_table']} where mb_id = '{$_POST['mb_id'][$k]}' and au_menu = '{$_POST['au_menu'][$k]}' "; + $sql = " delete from {$g5['auth_table']} where mb_id = '".$mb_id."' and au_menu = '".$au_menu."' "; sql_query($sql); } diff --git a/adm/board_form.php b/adm/board_form.php index 12c667a7e..bd7d7bd3c 100644 --- a/adm/board_form.php +++ b/adm/board_form.php @@ -230,7 +230,7 @@ $pg_anchor = '