diff --git a/bbs/logout.php b/bbs/logout.php index e0a1deee8..53b87571d 100644 --- a/bbs/logout.php +++ b/bbs/logout.php @@ -19,6 +19,10 @@ if ($url) { if ( substr($url, 0, 2) == '//' ) $url = 'http:' . $url; + if (preg_match('#\\\0#', $url) || preg_match('/^\/{1,}\\\/', $url)) { + alert('url 에 올바르지 않은 값이 포함되어 있습니다.', G5_URL); + } + $p = @parse_url(urldecode(str_replace('\\', '', $url))); /* // OpenRediect 취약점관련, PHP 5.3 이하버전에서는 parse_url 버그가 있음 ( Safflower 님 제보 ) 아래 url 예제 diff --git a/lib/common.lib.php b/lib/common.lib.php index a1b3c809d..059f775ca 100644 --- a/lib/common.lib.php +++ b/lib/common.lib.php @@ -3605,7 +3605,7 @@ function check_url_host($url, $msg='', $return_url=G5_URL, $is_redirect=false) } // KVE-2021-1277 Open Redirect 취약점 해결 - if (preg_match('#\\\0#', $url)) { + if (preg_match('#\\\0#', $url) || preg_match('/^\/{1,}\\\/', $url)) { alert('url 에 올바르지 않은 값이 포함되어 있습니다.'); }