search
HomeCMS TutorialPHPCMSThe logic problem of PHPCMS vulnerability causes getshell

The logic problem of PHPCMS vulnerability causes getshell

About the repair problem of getshell caused by a certain logic problem in phpcms

简介:
1. 漏洞名称:phpcms某处逻辑问题导致getshell
2. 补丁文件:/phpcms/libs/classes/attachment.class.php
3. 补丁来源:云盾自研
4. 漏洞描述:phpcms的/phpcms/libs/classes/attachment.class.php中,对输入参数$ext未进行类型限制,导致逻辑漏洞的产生。
【注意:该补丁为云盾自研代码修复方案,云盾会根据您当前代码是否符合云盾自研的修复模式进行检测,如果您自行采取了
底层/框架统一修复、或者使用了其他的修复方案,可能会导致您虽然已经修复了改漏洞,云盾依然报告存在漏洞,遇到该情况
可选择忽略该漏洞提示】
…
阿里云漏洞提示。

Solution:

1. According to the vulnerability description, find the corresponding location of the corresponding file attachment.class.php (near line 144), and add the patch code.

The patch code is as follows:

if($ext !== 'gif|jpg|jpeg|bmp|png'){
    if(!in_array(strtoupper($ext),array('JPG','GIF','BMP','PNG','JPEG'))) exit('附加扩展名必须为gif、jpg、jpeg、
    bmp、png');
}

The added code, the screenshot is as follows:

The logic problem of PHPCMS vulnerability causes getshell

2. Then, copy the modified file, Upload to the corresponding file location on the server and overwrite it directly;

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

The logic problem of PHPCMS vulnerability causes getshell

The above is all about the repair of the "logical problem somewhere in phpcms causing getshell" vulnerability.

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

The above is the detailed content of The logic problem of PHPCMS vulnerability causes getshell. For more information, please follow other related articles on the PHP Chinese website!

Statement
This article is reproduced at:CSDN. 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)
1 months agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
1 months agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
1 months agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Chat Commands and How to Use Them
1 months agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

ZendStudio 13.5.1 Mac

ZendStudio 13.5.1 Mac

Powerful PHP integrated development environment

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

EditPlus Chinese cracked version

EditPlus Chinese cracked version

Small size, syntax highlighting, does not support code prompt function

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.

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools