Open Redirection 취약점 다시 재수정

This commit is contained in:
thisgun
2024-02-14 18:31:52 +09:00
parent c67118f374
commit 8d912e3511
2 changed files with 5 additions and 1 deletions

View File

@ -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 예제

View File

@ -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 에 올바르지 않은 값이 포함되어 있습니다.');
}