From 52590509d5e299f7e9b73808d1fe9c12afd61c7a Mon Sep 17 00:00:00 2001 From: thisgun Date: Fri, 3 Apr 2026 03:59:23 +0000 Subject: [PATCH] =?UTF-8?q?[KVE-2026-0559]=EA=B7=B8=EB=88=84=EB=B3=B4?= =?UTF-8?q?=EB=93=9C5=20SQL=20Injection=20=EC=B7=A8=EC=95=BD=EC=A0=90=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bbs/poll_etc_update.php | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/bbs/poll_etc_update.php b/bbs/poll_etc_update.php index 189c7d362..dcda10a22 100644 --- a/bbs/poll_etc_update.php +++ b/bbs/poll_etc_update.php @@ -5,13 +5,23 @@ include_once(G5_LIB_PATH.'/mailer.lib.php'); if ($w == '') { $po_id = isset($_POST['po_id']) ? (int) $_POST['po_id'] : ''; - $pc_name = isset($_POST['pc_name']) ? addslashes(clean_xss_tags(stripslashes($_POST['pc_name']), 1, 1)) : ''; - $pc_idea = isset($_POST['pc_idea']) ? addslashes(clean_xss_tags(stripslashes($_POST['pc_idea']), 1, 1)) : ''; $po = sql_fetch(" select * from {$g5['poll_table']} where po_id = '{$po_id}' "); if (!$po['po_id']) alert('po_id 값이 제대로 넘어오지 않았습니다.'); + // 기타의견 사용 여부 검사 + if (!$po['po_etc']) + alert('기타의견이 비활성화되어 있습니다.'); + + // 접근 권한 검사 + if ($member['mb_level'] < $po['po_level']) + alert('권한이 없습니다.'); + + $pc_name = isset($_POST['pc_name']) ? addslashes(clean_xss_tags(stripslashes($_POST['pc_name']), 1, 1)) : ''; + $pc_name = preg_replace("#[\\\]+$#", "", $pc_name); + $pc_idea = isset($_POST['pc_idea']) ? addslashes(clean_xss_tags(stripslashes($_POST['pc_idea']), 1, 1)) : ''; + $tmp_row = sql_fetch(" select max(pc_id) as max_pc_id from {$g5['poll_etc_table']} "); $pc_id = $tmp_row['max_pc_id'] + 1;