Skip to content
This repository has been archived by the owner on Jun 24, 2021. It is now read-only.

Commit

Permalink
Open Redirect 취약점 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
thisgun committed Dec 27, 2017
1 parent 3b9a647 commit fc3e153
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions bbs/logout.php
Expand Up @@ -15,8 +15,12 @@
$url = 'http:' . $url;

$p = @parse_url(urldecode($url));
if ($p['scheme'] || $p['host']) {
alert('url에 도메인을 지정할 수 없습니다.');
/*
// OpenRediect 취약점관련, PHP 5.3 이하버전에서는 parse_url 버그가 있음 ( Safflower 님 제보 ) 아래 url 예제
// http://localhost/bbs/logout.php?url=http://sir.kr%23@/
*/
if (preg_match('/^https?:\/\//i', $url) || $p['scheme'] || $p['host']) {
alert('url에 도메인을 지정할 수 없습니다.', G5_URL);
}

if($url == 'shop')
Expand Down

0 comments on commit fc3e153

Please sign in to comment.