search
HomeCMS TutorialPHPCMSPHPCMS various injection vulnerability patches

PHPCMS various injection vulnerability patches

Nov 21, 2019 am 10:24 AM
phpcmsinjectionloopholespatch

PHPCMS various injection vulnerability patches

1. Wide byte injection vulnerability

/phpcms/modules/pay/respond.php Location is about 16 Line

original code

$payment = $this->get_by_code($_GET['code']);

is replaced with

$payment = $this->get_by_code(mysql_real_escape_string($_GET['code']));

2. phpcms injection vulnerability

/phpcms/modules/poster/poster .php position is about 221 lines after

if ($_GET['group']) {

, add

$_GET['group'] = preg_replace('#`#', '', $_GET['group']);

3, phpcms front-end injection leads to arbitrary file reading vulnerability patch

/phpcms/ modules/content/down.php

(1) Replace line 17

parse_str($a_k);

with

$a_k = safe_replace($a_k); parse_str($a_k);

(2) Line 89

parse_str($a_k);

Replace with

$a_k = safe_replace($a_k); parse_str($a_k);

(3) and add

$filename = date('Ymd_his').random(3).'.'.$ext;

# after line 120 of position 3.

$fileurl = str_replace(array(&#39;<&#39;,&#39;>&#39;), &#39;&#39;,$fileurl);

4, phpcms injection vulnerability

/phpcms/modules/member/index.php is located at about 615 lines

Original code:

$password = isset($_POST[&#39;password&#39;]) && trim($_POST[&#39;password&#39;]) ? trim($_POST[&#39;password&#39;]) : 
showmessage(L(&#39;password_empty&#39;),HTTP_REFERER);

Replaced with:

$password = isset($_POST[&#39;password&#39;]) && trim($_POST[&#39;password&#39;]) ? addslashes(urldecode(trim($_POST[&#39;password&#39;]
))) : showmessage(L(&#39;password_empty&#39;), HTTP_REFERER);

5, PHPCMS V9.6.2 SQL Injection vulnerability

(1) phpcms/libs/classes/param.class.php is located at about line 109

The original code

$value = isset($_COOKIE[$var]) ? sys_auth($_COOKIE[$var], &#39;DECODE&#39;) : $default;

is replaced with

$value = isset($_COOKIE[$var])?addslashes(sys_auth($_COOKIE[$var],&#39;DECODE&#39;)):$default;

(2)/phpsso_server/phpcms/libs/classes/param.class.php is located at about 108 lines

The original code

return isset($_COOKIE[$var]) ? sys_auth($_COOKIE[$var], &#39;DECODE&#39;) : $default;

is replaced with

return isset($_COOKIE[$var]) ? addslashes(sys_auth($_COOKIE[$var],&#39;DECODE&#39;)) : $default;

6. A logical problem somewhere in phpcms caused getshell

/phpcms/libs/classes/attachment.class.php to be located at line 143 of

function download($field, $value,$watermark = &#39;0&#39;,$ext = &#39;gif|jpg|jpeg|bmp|png&#39;, $absurl = &#39;&#39;, $basehref = &#39;&#39;){

followed by

   $extArray=explode(&#39;|&#39;,$ext); 
     if(!empty($extArray) && is_array($extArray)){ 
         foreach($extArray as $k => $v){ 
           if(!in_array(strtolower($v), array(&#39;gif&#39;,&#39;jpg&#39;,&#39;jpeg&#39;,&#39;bmp&#39;,&#39;png&#39;))); exit(&#39;0&#39;);//循环判断如果
           有一个不符合,直接返回 0 
         } 
      }

In this way, add a judgment. If the allowed file formats are 'gif', 'jpg', 'jpeg', 'bmp', 'png', continue, otherwise it will jump out. Of course, the formats here can be increased as needed. several.

7. phpcms injection vulnerability

/api/phpsso.php is located at about 128 lines

The original code

$arr[&#39;uid&#39;] = intval($arr[&#39;uid&#39;]);
$phpssouid = $arr[&#39;uid&#39;];

is replaced by , two-in-one code

$phpssouid = intval($arr[&#39;uid&#39;]);

8. phpcms authkey generation algorithm problem leads to authkey leakage

Follow the following function to regenerate the key value, and then find caches/configs Just replace the two parameters in /system.php and it will be ok

<?php 
     function random($length, $chars = &#39;0123456789&#39;) { 
       
        $hash = &#39;&#39;; 
        $max = strlen($chars) - 1; 
        for($i = 0; $i < $length; $i++) { 
            $hash .= $chars[mt_rand(0, $max)]; 
        } 
        return $hash; 
    }
    
    echo random(20, &#39;authkey&#39;).&#39;<br/>&#39;;    
    echo random(32, &#39;phpssoauthkey&#39;);exit; 
?>

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

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

Statement
This article is reproduced at:阿里云. If there is any infringement, please contact admin@php.cn delete

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
WWE 2K25: How To Unlock Everything In MyRise
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Safe Exam Browser

Safe Exam Browser

Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

MinGW - Minimalist GNU for Windows

MinGW - Minimalist GNU for Windows

This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

SecLists

SecLists

SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

WebStorm Mac version

WebStorm Mac version

Useful JavaScript development tools

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools