From 1cc13235cf07aa6d427fca1bcc1b676969524f11 Mon Sep 17 00:00:00 2001 From: chicpro Date: Fri, 8 Aug 2014 13:38:42 +0900 Subject: [PATCH] =?UTF-8?q?xss=20=EA=B4=80=EB=A0=A8=20=ED=83=9C=EA=B7=B8?= =?UTF-8?q?=20=EC=A0=9C=EA=B1=B0=20=ED=95=A8=EC=88=98=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common.php | 2 +- lib/common.lib.php | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/common.php b/common.php index 38a2c4d05..5bab616f7 100644 --- a/common.php +++ b/common.php @@ -252,7 +252,7 @@ if (isset($_REQUEST['PHPSESSID']) && $_REQUEST['PHPSESSID'] != session_id()) $qstr = ''; if (isset($_REQUEST['sca'])) { - $sca = trim($_REQUEST['sca']); + $sca = clean_xss_tags(trim($_REQUEST['sca'])); if ($sca) $qstr .= '&sca=' . urlencode($sca); } else { diff --git a/lib/common.lib.php b/lib/common.lib.php index df4a783dc..cefddb0aa 100644 --- a/lib/common.lib.php +++ b/lib/common.lib.php @@ -2653,6 +2653,14 @@ function get_search_string($stx) return $stx; } +// XSS 관련 태그 제거 +function clean_xss_tags($str) +{ + $str = preg_replace('#]*+>#i', '', $str); + + return $str; +} + // unescape nl 얻기 function conv_unescape_nl($str) {