쇼핑몰 팁

|  캐머런에서 기술지원하지 않지만 운영하시는데 도움이 되는 정보를 제공해 드립니다.

Extra Form
적용해야 할 XE코어 버전 XE Core 1.8.1.1 ~ 1.8.4.2
적용해야 할 누리고 버전 결제모듈 2.2 이하


모바일 결제 시 "잘못된 요청입니다."라는 오류 메세지가 뜨는 경우

 

mobile_error.png

 

 

 

원인 : XE 코어 1.8.11 에서 CSRF 보안취약점 패치

 

해결방법

 

1. 결제모듈 "플러그인" → "모듈" - 변경매뉴얼 보러가기
ex) 이니시스 플러그인 → 이니시스 결제모듈

 

2. 아래와 같이 XE코어 소스코드 수정

※ XE 코어 1.8.1.5 사용자는 소스코드 수정할 필요 없이 다음 파일을 다운받아 덮어쓰기 하시면 됩니다.
아래 소스코드 변경한 파일 (XE코어 1.8.15~1.8.17 공용)

 


 

/classes/module/ModuleHandler.class.php 413라인

// check CSRF for POST actions

if(Context::getRequestMethod() === 'POST' && Context::isInstalled() && $this->act !== 'procFileUpload' && !checkCSRF()) {

    $this->error = 'msg_invalid_request';

    $oMessageObject = ModuleHandler::getModuleInstance('message', $display_mode);

    $oMessageObject->setError(-1);

    $oMessageObject->setMessage($this->error);

    $oMessageObject->dispMessage();

    return $oMessageObject;

}

 

다음으로 대체합니다.

// check CSRF for POST actions

if(Context::getRequestMethod() === 'POST' && Context::isInstalled() && !checkCSRF())

{

    if($xml_info->action->{$this->act} && $xml_info->action->{$this->act}->check_csrf !== 'false')

    {

        $this->_setInputErrorToContext();

        $this->error = 'msg_invalid_request';

        $oMessageObject = ModuleHandler::getModuleInstance('message', $display_mode);

        $oMessageObject->setError(-1);

        $oMessageObject->setMessage($this->error);

        $oMessageObject->dispMessage();

        return $oMessageObject;

    }

}

 

 

 

 

 

위 수정 후 561라인

if($type == "view" && Mobile::isFromMobilePhone())

 

이 코드 위에 다음을 추가합니다.

// check CSRF for POST actions

if(Context::getRequestMethod() === 'POST' && Context::isInstalled() && !checkCSRF())

{

    if($xml_info->action->{$this->act} && $xml_info->action->{$this->act}->check_csrf !== 'false')

    {

        $this->_setInputErrorToContext();

        $this->error = 'msg_invalid_request';

        $oMessageObject = ModuleHandler::getModuleInstance('message', $display_mode);

        $oMessageObject->setError(-1);

        $oMessageObject->setMessage($this->error);

        $oMessageObject->dispMessage();

        return $oMessageObject;

    }

}

 

if($type == "view" && Mobile::isFromMobilePhone())

 

 

 

 

 

/modules/file/conf/module.xml 11라인

<action name="procFileUpload" type="controller" />

 

다음을 추가합니다.

<action name="procFileUpload" type="controller" check_csrf="false" />

 

 

 

 

 

/ modules/module/module.model.php 936라인

$method = $action->attrs->method?$action->attrs->method:'';

 

다음 줄을 추가합니다.

$method = $action->attrs->method?$action->attrs->method:'';

$check_csrf = $action->attrs->check_csrf=='false'?'false':'true';

 

 

 

 

 

위 수정 후 950라인

$info->action->{$name}->method = $method;

 

다음 줄을 추가합니다.

$info->action->{$name}->method = $method;

$info->action->{$name}->check_csrf = $check_csrf;

 

 

 

 

 

위 수정 후 974라인

$buff[] = sprintf('$info->action->%s->method=\'%s\';', $name, $method);

 

다음 줄을 추가합니다.

$buff[] = sprintf('$info->action->%s->method=\'%s\';', $name, $method);

$buff[] = sprintf('$info->action->%s->check_csrf=\'%s\';', $name, $check_csrf);

 

 

 

 

 

* 모두 수정하고 XE 관리자페이지 - 캐시파일재생성을 해주어야 반영됩니다.



쇼핑몰 팁

캐머런에서 기술지원하지 않지만 운영하시는데 도움이 되는 정보를 제공해 드립니다.

List of Articles
번호 제목 적용해야 할 누리고 버전 적용해야 할 XE코어 버전 조회 수
공지 누리고 쇼핑몰 모듈 업데이트 방법 932
11 주문 상태 변경시 자동이메일 연동 방법 522
10 추가옵션이 있을 때 장바구니에 담기지 않고, "상품이 없습니다." 메세지가 뜰 때 상품관리모듈 2.6.2 490
» 모바일 결제 시 "잘못된 요청입니다." 오류 해결방법 file 결제모듈 2.2 이하 XE Core 1.8.1.1 ~ 1.8.4.2 1158
8 비회원 주문조회 "권한이 없습니다." file 주문관리 모듈 2.2 이하 XE Core 버전 상관없음. 586
7 상품별 CSV 다운로드 | 주문별 CSV 다운로드 "잘못된 요청입니다." 오류 해결방법 file 주문관리 모듈 2.2 이하 XE Core 1.8.1.1 이상 509
6 배송주소록 / 최근배송지 새주소시스템 반영 장바구니 모듈 1.7 이하 XE Core 1.7 이상 648
5 마일리지 적립에서 배송비 제외시키기 장바구니 모듈 1.7 이하 XE Core 버전 상관없음. 448
4 결제시 마일리지와 배송비 적용 안되는 문제 주문관리 모듈 2.2 이하 XE Core 버전 상관없음. 795
3 주문확인서 출력시 과세물품 가격이 소수자리로 표시되는 오류 상품관리 모듈 1.7 이하 XE Core 버전 상관없음. 411
2 상품옵션을 선택시 추가되는 방식에서 변경되는 방식으로 바꾸기 1 상품관리 모듈 1.7 이하 XE Core 버전 상관없음. 757
1 경동택배 배송조회 링크 깨짐 현상 주문관리 모듈 2.2 이하 XE Core 버전 상관없음. 994
목록
Board Pagination Prev 1 Next
/ 1