diff --git a/adm/admin.lib.php b/adm/admin.lib.php index bbe556db4..5363b6d40 100644 --- a/adm/admin.lib.php +++ b/adm/admin.lib.php @@ -436,7 +436,7 @@ function admin_check_xss_params($params){ if( is_array($value) ){ admin_check_xss_params($params); - } else if ( preg_match('/<\s?[^\>]*\/?\s?>/i', $value) && preg_match('/script.*?\/script/ius', $value) ){ + } else if ( preg_match('/<\s?[^\>]*\/?\s?>/i', $value) && (preg_match('/script.*?\/script/ius', $value) || preg_match('/onload=.*/ius', $value)) ){ alert('요청 쿼리에 잘못된 스크립트문장이 있습니다.\\nXSS 공격일수도 있습니다.'); die(); } diff --git a/adm/contentform.php b/adm/contentform.php index 7b7751301..b7bedd389 100644 --- a/adm/contentform.php +++ b/adm/contentform.php @@ -109,8 +109,8 @@ include_once (G5_ADMIN_PATH.'/admin.head.php'); diff --git a/adm/menu_list_update.php b/adm/menu_list_update.php index 4244d3343..324f26209 100644 --- a/adm/menu_list_update.php +++ b/adm/menu_list_update.php @@ -23,7 +23,7 @@ for ($i=0; $i<$count; $i++) $code = $_POST['code'][$i]; $me_name = $_POST['me_name'][$i]; - $me_link = preg_match('/^javascript/', $_POST['me_link'][$i]) ? G5_URL : strip_tags($_POST['me_link'][$i]); + $me_link = preg_match('/^javascript/i', $_POST['me_link'][$i]) ? G5_URL : strip_tags($_POST['me_link'][$i]); if(!$code || !$me_name || !$me_link) continue; diff --git a/bbs/alert.php b/bbs/alert.php index 9d4475203..b1117d347 100644 --- a/bbs/alert.php +++ b/bbs/alert.php @@ -67,13 +67,17 @@ history.back();
$value) { + + $key = clean_xss_tags($url); + $value = clean_xss_tags($value); + if(strlen($value) < 1) continue; if(preg_match("/pass|pwd|capt|url/", $key)) continue; ?> - + diff --git a/bbs/confirm.php b/bbs/confirm.php index fcf94e0e9..a80f5eab1 100644 --- a/bbs/confirm.php +++ b/bbs/confirm.php @@ -2,9 +2,9 @@ include_once('./_common.php'); include_once(G5_PATH.'/head.sub.php'); -$url1 = clean_xss_tags($url1); -$url2 = clean_xss_tags($url2); -$url3 = clean_xss_tags($url3); +$url1 = preg_replace("/[\<\>\'\"\\\'\\\"\(\)]/", "", clean_xss_tags($url1)); +$url2 = preg_replace("/[\<\>\'\"\\\'\\\"\(\)]/", "", clean_xss_tags($url2)); +$url3 = preg_replace("/[\<\>\'\"\\\'\\\"\(\)]/", "", clean_xss_tags($url3)); // url 체크 check_url_host($url1); diff --git a/bbs/download.php b/bbs/download.php index 2ebe41742..8a98a32e1 100644 --- a/bbs/download.php +++ b/bbs/download.php @@ -84,11 +84,16 @@ if (!get_session($ss_name)) $g5['title'] = '다운로드 > '.conv_subject($write['wr_subject'], 255); //파일명에 한글이 있는 경우 +/* if(preg_match("/[\xA1-\xFE][\xA1-\xFE]/", $file['bf_source'])){ + // 2015.09.02 날짜의 파이어폭스에서 인코딩된 문자 그대로 출력되는 문제가 발생됨, 2018.12.11 날짜의 파이어폭스에서는 해당 현상이 없으므로 해당 코드를 사용 안합니다. $original = iconv('utf-8', 'euc-kr', $file['bf_source']); // SIR 잉끼님 제안코드 } else { $original = urlencode($file['bf_source']); } +*/ + +$original = urlencode($file['bf_source']); @include_once($board_skin_path.'/download.tail.skin.php'); diff --git a/bbs/email_certify.php b/bbs/email_certify.php index 2fc735b32..83465e706 100644 --- a/bbs/email_certify.php +++ b/bbs/email_certify.php @@ -1,6 +1,9 @@ ]*+>#i', '', $str); + $str_len = strlen($str); + + $i = 0; + while($i <= $str_len){ + $result = preg_replace('#]*+>#i', '', $str); + + if((string)$result === (string)$str) break; + + $str = $result; + $i++; + } return $str; } @@ -3577,6 +3587,27 @@ function get_real_client_ip(){ return preg_replace('/[^0-9.]/', '', $real_ip); } +function check_mail_bot($ip=''){ + + //아이피를 체크하여 메일 크롤링을 방지합니다. + $check_ips = array('211.249.40.'); + $bot_message = 'bot 으로 판단되어 중지합니다.'; + + if($ip){ + foreach( $check_ips as $c_ip ){ + if( preg_match('/^'.preg_quote($c_ip).'/', $ip) ) { + die($bot_message); + } + } + } + + // user agent를 체크하여 메일 크롤링을 방지합니다. + $user_agent = isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : ''; + if ($user_agent === 'Carbon' || strpos($user_agent, 'BingPreview') !== false || strpos($user_agent, 'Slackbot') !== false) { + die($bot_message); + } +} + function get_call_func_cache($func, $args=array()){ static $cache = array(); diff --git a/plugin/htmlpurifier/safeiframe.txt b/plugin/htmlpurifier/safeiframe.txt index 48c676d4f..ab6d6444f 100644 --- a/plugin/htmlpurifier/safeiframe.txt +++ b/plugin/htmlpurifier/safeiframe.txt @@ -11,4 +11,5 @@ www.microsoft.com/showcase/video.aspx/ w.soundcloud.com/ www.facebook.com/ kakaotv.daum.net/ -v.afree.ca/ \ No newline at end of file +v.afree.ca/ +play-tv.kakao.com/ \ No newline at end of file diff --git a/plugin/kcpcert/kcpcert_result.php b/plugin/kcpcert/kcpcert_result.php index 031942fa9..5468267ae 100644 --- a/plugin/kcpcert/kcpcert_result.php +++ b/plugin/kcpcert/kcpcert_result.php @@ -143,7 +143,7 @@ if( $cert_enc_use == "Y" ) $sql = " select mb_id from {$g5['member_table']} where mb_id <> '{$member['mb_id']}' and mb_dupinfo = '{$mb_dupinfo}' "; $row = sql_fetch($sql); if ($row['mb_id']) { - alert_close("입력하신 본인학인 정보로 가입된 내역이 존재합니다.\\n회원아이디 : ".$row['mb_id']); + alert_close("입력하신 본인확인 정보로 가입된 내역이 존재합니다.\\n회원아이디 : ".$row['mb_id']); } // hash 데이터 diff --git a/plugin/lgxpay/AuthOnlyReq.php b/plugin/lgxpay/AuthOnlyReq.php index f8c42b1b6..571d7d9c9 100644 --- a/plugin/lgxpay/AuthOnlyReq.php +++ b/plugin/lgxpay/AuthOnlyReq.php @@ -165,6 +165,8 @@ $_SESSION['lgd_certify'] = $payReqMap; $value) { + $key = htmlspecialchars(strip_tags($key)); + $value = htmlspecialchars(strip_tags($value)); echo "".PHP_EOL; } ?> diff --git a/plugin/lgxpay/returnurl.php b/plugin/lgxpay/returnurl.php index e0cd0a37b..b40e8940e 100644 --- a/plugin/lgxpay/returnurl.php +++ b/plugin/lgxpay/returnurl.php @@ -57,6 +57,8 @@ $payReqMap = $_SESSION['lgd_certify'];//결제 요청시, Session에 저장했 $value) { + $key = htmlspecialchars(strip_tags($key)); + $value = htmlspecialchars(strip_tags($value)); echo ""; } ?> diff --git a/plugin/social/includes/functions.php b/plugin/social/includes/functions.php index 4b847f54d..fab949a88 100644 --- a/plugin/social/includes/functions.php +++ b/plugin/social/includes/functions.php @@ -52,6 +52,10 @@ function get_social_callbackurl($provider, $no_domain=false){ $base_url = '/'.ltrim(parse_url($base_url, PHP_URL_PATH), '/'); } + if ( $provider === 'twitter' ){ + return $base_url; + } + $base_url = $base_url . ( strpos($base_url, '?') ? '&' : '?' ).G5_SOCIAL_LOGIN_DONE_PARAM.'='.$provider; return $base_url; @@ -764,6 +768,23 @@ function social_member_comfirm_redirect(){ } } +function social_is_edit_page($url=''){ + global $is_member; + + if( !$is_member ) return false; + + if($url){ + $p = @parse_url($url); + $host = preg_replace('/:[0-9]+$/', '', $_SERVER['HTTP_HOST']); + + if ( isset($p['host']) && ($p['host'] === $host) && preg_match('/register_form\.php$/i', $url) ){ + return true; + } + } + + return false; +} + function social_is_login_password_check($mb_id){ global $g5; diff --git a/skin/board/basic/style.css b/skin/board/basic/style.css index 37bf7fab7..d85f02315 100644 --- a/skin/board/basic/style.css +++ b/skin/board/basic/style.css @@ -65,7 +65,7 @@ #bo_w .tbl_frm01 {} #bo_w .tbl_frm01 th {} #bo_w .tbl_frm01 td {} -#bo_w .tbl_frm01 textarea, #bo_w tbl_frm01 .frm_input {} +#bo_w .tbl_frm01 textarea, #bo_w .tbl_frm01 .frm_input {} #bo_w .tbl_frm01 textarea {} /* #bo_w .tbl_frm01 #captcha {} diff --git a/skin/board/gallery/style.css b/skin/board/gallery/style.css index 7dd98d16b..cb38ea31f 100644 --- a/skin/board/gallery/style.css +++ b/skin/board/gallery/style.css @@ -55,7 +55,7 @@ #bo_w .tbl_frm01 {} #bo_w .tbl_frm01 th {} #bo_w .tbl_frm01 td {} -#bo_w .tbl_frm01 textarea, #bo_w tbl_frm01 .frm_input {} +#bo_w .tbl_frm01 textarea, #bo_w .tbl_frm01 .frm_input {} #bo_w .tbl_frm01 textarea {} /* #bo_w .tbl_frm01 #captcha {} diff --git a/theme/basic/skin/board/basic/style.css b/theme/basic/skin/board/basic/style.css index 37bf7fab7..d85f02315 100644 --- a/theme/basic/skin/board/basic/style.css +++ b/theme/basic/skin/board/basic/style.css @@ -65,7 +65,7 @@ #bo_w .tbl_frm01 {} #bo_w .tbl_frm01 th {} #bo_w .tbl_frm01 td {} -#bo_w .tbl_frm01 textarea, #bo_w tbl_frm01 .frm_input {} +#bo_w .tbl_frm01 textarea, #bo_w .tbl_frm01 .frm_input {} #bo_w .tbl_frm01 textarea {} /* #bo_w .tbl_frm01 #captcha {} diff --git a/theme/basic/skin/board/gallery/style.css b/theme/basic/skin/board/gallery/style.css index e20ab1c66..035553804 100644 --- a/theme/basic/skin/board/gallery/style.css +++ b/theme/basic/skin/board/gallery/style.css @@ -55,7 +55,7 @@ #bo_w .tbl_frm01 {} #bo_w .tbl_frm01 th {} #bo_w .tbl_frm01 td {} -#bo_w .tbl_frm01 textarea, #bo_w tbl_frm01 .frm_input {} +#bo_w .tbl_frm01 textarea, #bo_w .tbl_frm01 .frm_input {} #bo_w .tbl_frm01 textarea {} /* #bo_w .tbl_frm01 #captcha {}