[security]KVE-2026-0859 KCP CLI Windows 환경 명령 인젝션(RCE) 수정

shop/kcp/pp_cli_hub_lib.php, shop/kcp/pp_ax_hub_lib.php 의
mf_do_tx() Windows 분기가 사용자 입력이 포함된 KCP CLI 인자를
큰따옴표로 감싼 단일 문자열로 만들어 mf_exec() 첫 인자로 전달했고,
mf_exec() 는 첫 인자를 escape 없이 exec() 에 넘겨 Windows cmd.exe
메타문자(`"`, `&` 등)로 인증 없는 OS 명령 실행이 가능했음.

Linux 분기와 동일하게 실행 파일 경로와 콤마 구분 인자 문자열을
분리하여 mf_exec($bin_exe, $args) 형태로 호출하도록 변경.
mf_exec() 의 foreach 가 두 번째 이후 인자에 escapeshellarg() 를
자동 적용하여 cmd.exe 메타문자가 안전하게 wrapping 됨.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
thisgun
2026-05-26 03:35:51 +00:00
co-authored by Claude Opus 4.7
parent f4f8c57a74
commit 59d0b3c19c
2 changed files with 8 additions and 8 deletions
+4 -4
View File
@@ -168,9 +168,10 @@
{
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN')
{
$bin_exe = $home_dir.'/bin/pp_cli_exe ';
// 실행 파일 경로와 인자를 분리하여 mf_exec 호출 → escapeshellarg 자동 적용 (KVE-2026-0859)
$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
{
+4 -4
View File
@@ -161,9 +161,10 @@ class C_PAYPLUS_CLI_T
{
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN')
{
$bin_exe = $home_dir.'/bin/pp_cli_exe ';
// 실행 파일 경로와 인자를 분리하여 mf_exec 호출 → escapeshellarg 자동 적용 (KVE-2026-0859)
$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 . "," .
@@ -181,8 +182,7 @@ class C_PAYPLUS_CLI_T
$ordr_data .
$rcvr_data .
$escw_data .
$modx_data .
"\"") ;
$modx_data) ;
}
else
{