Skip to content

Commit

Permalink
OpenRediect 취약점 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
thisgun committed Jan 25, 2024
1 parent cb6b39c commit 15f2037
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion bbs/logout.php
Expand Up @@ -19,7 +19,7 @@
if ( substr($url, 0, 2) == '//' )
$url = 'http:' . $url;

$p = @parse_url(urldecode($url));
$p = @parse_url(urldecode(str_replace('\\', '', $url)));
/*
// OpenRediect 취약점관련, PHP 5.3 이하버전에서는 parse_url 버그가 있음 ( Safflower 님 제보 ) 아래 url 예제
// http://localhost/bbs/logout.php?url=http://sir.kr%23@/
Expand Down
3 changes: 2 additions & 1 deletion lib/common.lib.php
Expand Up @@ -3612,7 +3612,8 @@ function check_url_host($url, $msg='', $return_url=G5_URL, $is_redirect=false)
while ( ( $replace_url = preg_replace(array('/\/{2,}/', '/\\@/'), array('//', ''), urldecode($url)) ) != $url ) {
$url = $replace_url;
}
$p = @parse_url(trim($url));

$p = @parse_url(trim(str_replace('\\', '', $url)));
$host = preg_replace('/:[0-9]+$/', '', $_SERVER['HTTP_HOST']);
$is_host_check = false;

Expand Down

0 comments on commit 15f2037

Please sign in to comment.