Home > CMS Tutorial > PHPCMS > PHPCMS vulnerability v9 wide byte injection problem

PHPCMS vulnerability v9 wide byte injection problem

爱喝马黛茶的安东尼
Release: 2019-11-21 10:43:24
forward
3528 people have browsed it

PHPCMS vulnerability v9 wide byte injection problem

About the vulnerability fix plan for Alibaba Cloud prompt "phpcms v9 wide byte injection problem"

简介:
漏洞名称:phpcms v9宽字节注入问题
补丁文件:www/phpcms/modules/pay/respond.php
补丁来源:云盾自研
漏洞描述:phpcmsv9.5.9以后版本开始默认使用mysqli支持,在phpcms/modules/pay/respond.php中,因为代码逻辑不够严谨,
导致宽字节注入。【注意:该补丁为云盾自研代码修复方案,云盾会根据您当前代码是否符合云盾自研的修复模式进行检测,
如果您自行采取了底层/框架统一修复、或者使用了其他的修复方案,可能会导致您虽然已经修复了该漏洞,云盾依然报告存在
漏洞,遇到该情况可选择忽略该漏洞提示】
…
阿里云漏洞提示。
Copy after login

Solution:

1. Open www/phpcms/modules/pay/respond.php, about line 14 of the code;

2. Find respond_get() and replace it with the following Code, the code is as follows:

public function respond_get() { 
 if ($_GET['code']){ 
      $code = mysql_real_escape_string($_GET['code']);//注意修改
      $payment = $this->get_by_code($code);//注意修改
      if(!$payment) showmessage(L('payment_failed')); 
      $cfg = unserialize_config($payment['config']); 
      $pay_name = ucwords($payment['pay_code']); 
      pc_base::load_app_class('pay_factory','',0); 
      $payment_handler = new pay_factory($pay_name, $cfg); 
      $return_data = $payment_handler->receive(); 
      if($return_data) { 
          if($return_data['order_status'] == 0) {              
              $this->update_member_amount_by_sn($return_data['order_id']); 
          } 
          $this->update_recode_status_by_sn($return_data['order_id'],$return_data['order_status']); 
          showmessage(L('pay_success'),APP_PATH.'index.php?m=pay&c=deposit'); 
      } else { 
          showmessage(L('pay_failed'),APP_PATH.'index.php?m=pay&c=deposit'); 
      } 
  } else { 
      showmessage(L('pay_success')); 
  }
}
Copy after login

After adding the code, the screenshot example is as follows:

PHPCMS vulnerability v9 wide byte injection problem

3. Then, upload the modified file to the server corresponding File location, overwrite directly;

4. Finally, log in to the Alibaba Cloud backend and click Verify (screenshot below) to complete the vulnerability repair.

PHPCMS vulnerability v9 wide byte injection problem

The above is all about the "phpcms v9 wide byte injection problem" vulnerability fix.

PHP Chinese website, a large number of free PHPCMS tutorials, welcome to learn online!

The above is the detailed content of PHPCMS vulnerability v9 wide byte injection problem. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:csdn.net
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template