From 2b79194f72c2ca28e8197769c2a2212b73b38665 Mon Sep 17 00:00:00 2001 From: thisgun Date: Thu, 6 Sep 2018 10:38:14 +0900 Subject: [PATCH] =?UTF-8?q?clean=5Fxss=5Fattributes=20=ED=95=A8=EC=88=98?= =?UTF-8?q?=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/common.lib.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/common.lib.php b/lib/common.lib.php index 28a984da4..963701e47 100644 --- a/lib/common.lib.php +++ b/lib/common.lib.php @@ -2878,6 +2878,14 @@ function clean_xss_tags($str) return $str; } +// XSS 어트리뷰트 태그 제거 +function clean_xss_attributes($str) +{ + $str = preg_replace('#(onabort|onactivate|onafterprint|onafterupdate|onbeforeactivate|onbeforecopy|onbeforecut|onbeforedeactivate|onbeforeeditfocus|onbeforepaste|onbeforeprint|onbeforeunload|onbeforeupdate|onblur|onbounce|oncellchange|onchange|onclick|oncontextmenu|oncontrolselect|oncopy|oncut|ondataavaible|ondatasetchanged|ondatasetcomplete|ondblclick|ondeactivate|ondrag|ondragdrop|ondragend|ondragenter|ondragleave|ondragover|ondragstart|ondrop|onerror|onerrorupdate|onfilterupdate|onfinish|onfocus|onfocusin|onfocusout|onhelp|onkeydown|onkeypress|onkeyup|onlayoutcomplete|onload|onlosecapture|onmousedown|onmouseenter|onmouseleave|onmousemove|onmoveout|onmouseover|onmouseup|onmousewheel|onmove|onmoveend|onmovestart|onpaste|onpropertychange|onreadystatechange|onreset|onresize|onresizeend|onresizestart|onrowexit|onrowsdelete|onrowsinserted|onscroll|onselect|onselectionchange|onselectstart|onstart|onstop|onsubmit|onunload)\\s*=\\s*\\\?".*?"#is', '', $str); + + return $str; +} + // unescape nl 얻기 function conv_unescape_nl($str) {