security: KVE-2026-1899 KVE-2026-1900 KVE-2026-1909 입력 및 권한 검증 강화
상품 정렬값을 허용 목록으로 검증하고 관리자 권한 컨텍스트를 명확히 구분한다. 모바일 KCP의 Windows 명령 인자를 안전하게 조립하고 검증한다.
This commit is contained in:
1 parent
375a8336e8
commit
71209fc7c9
40 files changed
+185
-148
No files matched your search
+9
-15
@@ -1,20 +1,14 @@
|
||||
<?php
|
||||
include_once('../../common.php');
|
||||
|
||||
// SQL 주석 토큰 차단 추가 — 데스크톱 shop/_common.php 와 동일 패턴
|
||||
if (isset($_REQUEST['sort']) && !preg_match("/(--|#|\/\*|\*\/)/", $_REQUEST['sort'])) {
|
||||
$sort = trim($_REQUEST['sort']);
|
||||
$sort = preg_replace("/[\<\>\'\"\\\'\\\"\%\=\(\)\s]/", "", $sort);
|
||||
} else {
|
||||
$sort = '';
|
||||
}
|
||||
|
||||
if (isset($_REQUEST['sortodr'])) {
|
||||
$sortodr = preg_match("/^(asc|desc)$/i", $sortodr) ? $sortodr : '';
|
||||
} else {
|
||||
$sortodr = '';
|
||||
}
|
||||
|
||||
if (!defined('G5_USE_SHOP') || !G5_USE_SHOP)
|
||||
die('<p>쇼핑몰 설치 후 이용해 주십시오.</p>');
|
||||
define('_SHOP_', true);
|
||||
|
||||
$is_admin = get_super_admin_type($is_admin);
|
||||
|
||||
$request_sort = (isset($_REQUEST['sort']) && is_string($_REQUEST['sort'])) ? $_REQUEST['sort'] : '';
|
||||
$request_sortodr = (isset($_REQUEST['sortodr']) && is_string($_REQUEST['sortodr'])) ? $_REQUEST['sortodr'] : '';
|
||||
list($sort, $sortodr) = get_shop_item_sort($request_sort, $request_sortodr);
|
||||
unset($request_sort, $request_sortodr);
|
||||
|
||||
define('_SHOP_', true);
|
||||
@@ -93,4 +93,4 @@ echo '<div id="sev_thtml">'.conv_content($ev['ev_tail_html'], 1).'</div>';
|
||||
</div>
|
||||
|
||||
<?php
|
||||
include_once(G5_MSHOP_PATH.'/_tail.php');
|
||||
include_once(G5_MSHOP_PATH.'/_tail.php');
|
||||
@@ -31,7 +31,7 @@ if ($w == "u")
|
||||
|
||||
$it_id = $qa['it_id'];
|
||||
|
||||
if (!$is_admin && $qa['mb_id'] != $member['mb_id']) {
|
||||
if (!is_shop_resource_owner_or_super_admin($qa['mb_id'], $member['mb_id'], $is_admin)) {
|
||||
alert_close("자신의 상품문의만 수정이 가능합니다.");
|
||||
}
|
||||
|
||||
@@ -59,4 +59,4 @@ if(!file_exists($itemqaform_skin)) {
|
||||
include_once($itemqaform_skin);
|
||||
}
|
||||
|
||||
include_once(G5_PATH.'/tail.sub.php');
|
||||
include_once(G5_PATH.'/tail.sub.php');
|
||||
@@ -29,7 +29,7 @@ if ($w == "") {
|
||||
$it_id = $use['it_id'];
|
||||
$is_score = $use['is_score'];
|
||||
|
||||
if (!$is_admin && $use['mb_id'] != $member['mb_id']) {
|
||||
if (!is_shop_resource_owner_or_super_admin($use['mb_id'], $member['mb_id'], $is_admin)) {
|
||||
alert_close("자신의 사용후기만 수정이 가능합니다.");
|
||||
}
|
||||
}
|
||||
@@ -54,4 +54,4 @@ if(!file_exists($itemuseform_skin)) {
|
||||
include_once($itemuseform_skin);
|
||||
}
|
||||
|
||||
include_once(G5_PATH.'/tail.sub.php');
|
||||
include_once(G5_PATH.'/tail.sub.php');
|
||||
@@ -168,9 +168,10 @@
|
||||
{
|
||||
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN')
|
||||
{
|
||||
$bin_exe = $home_dir.'/bin/pp_cli_exe ';
|
||||
// 실행 파일 경로와 인자를 분리하여 mf_exec 호출 → escapeshellarg 자동 적용
|
||||
$bin_exe = $home_dir.'/bin/pp_cli_exe';
|
||||
|
||||
$res_data = $this->mf_exec($bin_exe . "\"".
|
||||
$res_data = $this->mf_exec($bin_exe,
|
||||
"site_cd=" . $site_cd . "," .
|
||||
"site_key=" . $site_key . "," .
|
||||
"tx_cd=" . $tx_cd . "," .
|
||||
@@ -188,8 +189,7 @@
|
||||
$ordr_data .
|
||||
$rcvr_data .
|
||||
$escw_data .
|
||||
$modx_data .
|
||||
"\"") ;
|
||||
$modx_data) ;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -276,21 +276,27 @@
|
||||
return $my_data;
|
||||
}
|
||||
|
||||
function mf_exec()
|
||||
function mf_build_exec_cmd( $arg )
|
||||
{
|
||||
$arg = func_get_args();
|
||||
|
||||
if ( is_array( $arg[0] ) ) $arg = $arg[0];
|
||||
|
||||
$exec_cmd = array_shift( $arg );
|
||||
|
||||
foreach($arg as $i)
|
||||
foreach((array) $arg as $key=>$i)
|
||||
{
|
||||
$exec_cmd .= " " . escapeshellarg( $i );
|
||||
}
|
||||
|
||||
return $exec_cmd;
|
||||
}
|
||||
|
||||
function mf_exec()
|
||||
{
|
||||
$arg = func_get_args();
|
||||
$exec_cmd = $this->mf_build_exec_cmd( $arg );
|
||||
|
||||
$rt = exec( $exec_cmd );
|
||||
|
||||
return $rt;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -11,11 +11,6 @@ if(defined('G5_THEME_MSHOP_PATH')) {
|
||||
unset($theme_list_file);
|
||||
}
|
||||
|
||||
// 상품 리스트에서 다른 필드로 정렬을 하려면 아래의 배열 코드에서 해당 필드를 추가하세요.
|
||||
if( isset($sort) && ! in_array($sort, array('it_name', 'it_sum_qty', 'it_price', 'it_use_avg', 'it_use_cnt', 'it_update_time')) ){
|
||||
$sort='';
|
||||
}
|
||||
|
||||
$sql = " select *
|
||||
from {$g5['g5_shop_category_table']}
|
||||
where ca_id = '$ca_id'
|
||||
@@ -200,4 +195,4 @@ var g5_shop_url = "<?php echo G5_SHOP_URL; ?>";
|
||||
<?php
|
||||
include_once(G5_MSHOP_PATH.'/_tail.php');
|
||||
|
||||
echo "\n<!-- {$ca['ca_mobile_skin']} -->\n";
|
||||
echo "\n<!-- {$ca['ca_mobile_skin']} -->\n";
|
||||
@@ -1,9 +1,6 @@
|
||||
<?php
|
||||
include_once('./_common.php');
|
||||
|
||||
// 상품 정렬 컬럼 화이트리스트 — 데스크톱 shop/listtype.php 와 동일 패턴
|
||||
$sort = (isset($_REQUEST['sort']) && in_array($_REQUEST['sort'], array('it_name', 'it_sum_qty', 'it_price', 'it_use_avg', 'it_use_cnt', 'it_update_time'))) ? $_REQUEST['sort'] : '';
|
||||
|
||||
$type = isset($_REQUEST['type']) ? (int) preg_replace("/[^0-9]/", "", $_REQUEST['type']) : 1;
|
||||
if ($type === 1) $g5['title'] = '히트상품';
|
||||
else if ($type === 2) $g5['title'] = '추천상품';
|
||||
@@ -78,4 +75,4 @@ echo get_paging($config['cf_mobile_pages'], $page, $total_page, "{$_SERVER['SCRI
|
||||
?>
|
||||
|
||||
<?php
|
||||
include_once(G5_MSHOP_PATH.'/_tail.php');
|
||||
include_once(G5_MSHOP_PATH.'/_tail.php');
|
||||
@@ -4,7 +4,7 @@ if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
|
||||
|
||||
<section id="bo_v_ans">
|
||||
<?php
|
||||
if($is_admin) // 관리자이면 답변등록
|
||||
if($is_admin === 'super') // 최고관리자이면 답변등록
|
||||
{
|
||||
?>
|
||||
<h2>답변등록</h2>
|
||||
@@ -151,4 +151,4 @@ if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</section>
|
||||
</section>
|
||||
@@ -27,7 +27,7 @@ add_stylesheet('<link rel="stylesheet" href="'.G5_MSHOP_SKIN_URL.'/style.css">',
|
||||
if($row['iq_secret']) {
|
||||
$iq_subject .= ' <img src="'.G5_MSHOP_SKIN_URL.'/img/icon_secret.gif" alt="비밀글">';
|
||||
|
||||
if($is_admin || $member['mb_id' ] == $row['mb_id']) {
|
||||
if(is_shop_resource_owner_or_super_admin($row['mb_id'], $member['mb_id'], $is_admin)) {
|
||||
$iq_question = get_view_thumbnail(conv_content($row['iq_question'], 1), $thumbnail_width);
|
||||
} else {
|
||||
$iq_question = '비밀글로 보호된 문의입니다.';
|
||||
@@ -87,7 +87,7 @@ add_stylesheet('<link rel="stylesheet" href="'.G5_MSHOP_SKIN_URL.'/style.css">',
|
||||
<?php } ?>
|
||||
</div>
|
||||
|
||||
<?php if ($is_admin || ($row['mb_id'] == $member['mb_id'] && !$is_answer)) { ?>
|
||||
<?php if ($is_admin === 'super' || ($row['mb_id'] == $member['mb_id'] && !$is_answer)) { ?>
|
||||
<div class="sit_qa_cmd">
|
||||
<a href="<?php echo $itemqa_form."&iq_id={$row['iq_id']}&w=u"; ?>" class="itemqa_form btn01" onclick="return false;">수정</a>
|
||||
<a href="<?php echo $itemqa_formupdate."&iq_id={$row['iq_id']}&w=d&hash={$hash}"; ?>" class="itemqa_delete btn01">삭제</a>
|
||||
@@ -148,4 +148,4 @@ $(function(){
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<!-- } 상품문의 목록 끝 -->
|
||||
<!-- } 상품문의 목록 끝 -->
|
||||
@@ -46,7 +46,7 @@ add_stylesheet('<link rel="stylesheet" href="'.G5_MSHOP_SKIN_URL.'/style.css">',
|
||||
if($row['iq_secret']) {
|
||||
$iq_subject .= ' <i class="fa fa-lock" aria-hidden="true"></i>';
|
||||
|
||||
if($is_admin || $member['mb_id' ] == $row['mb_id']) {
|
||||
if(is_shop_resource_owner_or_super_admin($row['mb_id'], $member['mb_id'], $is_admin)) {
|
||||
$iq_question = get_view_thumbnail(conv_content($row['iq_question'], 1), $thumbnail_width);
|
||||
} else {
|
||||
$iq_question = '비밀글로 보호된 문의입니다.';
|
||||
@@ -141,4 +141,4 @@ $(function(){
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<!-- } 전체 상품 사용후기 목록 끝 -->
|
||||
<!-- } 전체 상품 사용후기 목록 끝 -->
|
||||
@@ -52,7 +52,7 @@ add_stylesheet('<link rel="stylesheet" href="'.G5_MSHOP_SKIN_URL.'/style.css">',
|
||||
<?php echo $is_content; // 사용후기 내용 ?>
|
||||
</div>
|
||||
|
||||
<?php if ($is_admin || $row['mb_id'] == $member['mb_id']) { ?>
|
||||
<?php if (is_shop_resource_owner_or_super_admin($row['mb_id'], $member['mb_id'], $is_admin)) { ?>
|
||||
<div class="sit_use_cmd">
|
||||
<a href="<?php echo $itemuse_form."&is_id={$row['is_id']}&w=u"; ?>" class="itemuse_form btn01" onclick="return false;">수정</a>
|
||||
<a href="<?php echo $itemuse_formupdate."&is_id={$row['is_id']}&w=d&hash={$hash}"; ?>" class="itemuse_delete btn01">삭제</a>
|
||||
@@ -130,4 +130,4 @@ $(function(){
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<!-- } 상품 사용후기 끝 -->
|
||||
<!-- } 상품 사용후기 끝 -->
|
||||
Reference in new issue
Block a user