Home CMS Tutorial PHPCMS PHPCMS vulnerability frontend injection leads to arbitrary file reading

PHPCMS vulnerability frontend injection leads to arbitrary file reading

Nov 21, 2019 am 10:06 AM
phpcms file reading loopholes

PHPCMS vulnerability frontend injection leads to arbitrary file reading

About the repair issue of arbitrary file reading vulnerability caused by phpcms front-end injection

简介:
phpcms的/phpcms/modules/content/down.php 文件中,对输入参数 $_GET['a_k'] 未进行严格过滤,导致SQL注入的发生,黑客
可利用该漏洞读取任意文件。
…
阿里云服务器提示漏洞问题。
Copy after login

Solution:

1. According to the vulnerability prompt in the introduction, find the corresponding location of the corresponding file down.php (near lines 18 and 89), and add or replace the corresponding code.

The patch code snippet is as follows:

$a_k = safe_replace($a_k);
parse_str($a_k);
Copy after login

The modified patch code snippet is as follows:

The first modification, near line 18:

PHPCMS vulnerability frontend injection leads to arbitrary file reading

The second modification, near line 89:

PHPCMS vulnerability frontend injection leads to arbitrary file reading

Note: The contents of the first and second patch codes are the same.

The third modification, near line 120:

The patch code snippet is as follows:

$fileurl = str_replace(array(&#39;<&#39;,&#39;>&#39;), &#39;&#39;,$fileurl); 
file_down($fileurl, $filename);
Copy after login

Note: After actual testing, as much as possible between the above two lines of code There should be no other code to avoid being detected by Alibaba Cloud and the repair result will be invalid.

The screenshot of the modified patch code snippet is as follows:

PHPCMS vulnerability frontend injection leads to arbitrary file reading

2. Then, upload the modified file 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.

PHPCMS vulnerability frontend injection leads to arbitrary file reading

The above is all about the "phpcms front-end injection leading to arbitrary file reading vulnerability" vulnerability repair content.

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

The above is the detailed content of PHPCMS vulnerability frontend injection leads to arbitrary file reading. For more information, please follow other related articles on the PHP Chinese website!

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

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

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Jailbreak any large model in 20 steps! More 'grandma loopholes' are discovered automatically Jailbreak any large model in 20 steps! More 'grandma loopholes' are discovered automatically Nov 05, 2023 pm 08:13 PM

In less than a minute and no more than 20 steps, you can bypass security restrictions and successfully jailbreak a large model! And there is no need to know the internal details of the model - only two black box models need to interact, and the AI ​​can fully automatically defeat the AI ​​and speak dangerous content. I heard that the once-popular "Grandma Loophole" has been fixed: Now, facing the "Detective Loophole", "Adventurer Loophole" and "Writer Loophole", what response strategy should artificial intelligence adopt? After a wave of onslaught, GPT-4 couldn't stand it anymore, and directly said that it would poison the water supply system as long as... this or that. The key point is that this is just a small wave of vulnerabilities exposed by the University of Pennsylvania research team, and using their newly developed algorithm, AI can automatically generate various attack prompts. Researchers say this method is better than existing

Buffer overflow vulnerability in Java and its harm Buffer overflow vulnerability in Java and its harm Aug 09, 2023 pm 05:57 PM

Buffer overflow vulnerabilities in Java and their harm Buffer overflow means that when we write more data to a buffer than its capacity, it will cause data to overflow to other memory areas. This overflow behavior is often exploited by hackers, which can lead to serious consequences such as abnormal code execution and system crash. This article will introduce buffer overflow vulnerabilities and their harm in Java, and give code examples to help readers better understand. The buffer classes widely used in Java include ByteBuffer, CharBuffer, and ShortB

PHP file processing tips: read and write files efficiently PHP file processing tips: read and write files efficiently Sep 06, 2023 am 11:36 AM

PHP file processing skills: Efficiently read and write files In the process of web development, we often need to read and write files, such as configuration files, log files, uploaded files, etc. However, file operations may affect system performance and efficiency. Therefore, we need to master some efficient file processing skills to improve system performance and user experience. This article will introduce some file processing techniques in PHP, as well as optimization methods for reading and writing files, and provide corresponding code examples. Efficiently read files 1.1 using fil

How to read .py files correctly in Python? How to read .py files correctly in Python? Apr 03, 2024 pm 04:21 PM

In Python, there are three ways to read .py files. The first method is to use the built-in function open(), such as withopen('example.py','r')asf:content=f.read(). The second method is to use the import statement, such as importexample. The third method is to use the exec() function, such as withopen('example.py','r')asf:code=f.read()exec(code).

Golang file reading operations: tips for reading large files quickly Golang file reading operations: tips for reading large files quickly Jan 19, 2024 am 08:33 AM

Golang file reading operation: Tips for quickly reading large files, specific code examples are required In Golang programming, file reading is a very common operation. But when large files need to be read, it is usually a time- and resource-consuming operation. Therefore, how to read large files quickly is a topic worth discussing. This article will introduce how to use Golang's features and some techniques to quickly read large files, and provide specific code examples. Using bufio to read files in Golang, file reading

The OpenAI DALL-E 3 model has a vulnerability that generates 'inappropriate content.' A Microsoft employee reported it and was slapped with a 'gag order.' The OpenAI DALL-E 3 model has a vulnerability that generates 'inappropriate content.' A Microsoft employee reported it and was slapped with a 'gag order.' Feb 04, 2024 pm 02:40 PM

According to news on February 2, Shane Jones, manager of Microsoft’s software engineering department, recently discovered a vulnerability in OpenAI’s DALL-E3 model, which is said to be able to generate a series of inappropriate content. Shane Jones reported the vulnerability to the company, but was asked to keep it confidential. However, he eventually decided to disclose the vulnerability to the outside world. ▲Image source: Report disclosed by ShaneJones. This site noticed that ShaneJones discovered through independent research in December last year that there was a vulnerability in the DALL-E3 model of OpenAI text-generated images. This vulnerability can bypass the AI ​​Guardrail (AIGuardrail), resulting in the generation of a series of NSFW inappropriate content. This discovery attracted widespread attention

How to jump to the details page in phpcms How to jump to the details page in phpcms Jul 27, 2023 pm 05:23 PM

How to jump to the details page in phpcms: 1. Use the header function to generate a jump link; 2. Loop through the content list; 3. Get the title and details page link of the content; 4. Generate a jump link.

fread() function in PHP fread() function in PHP Sep 07, 2023 pm 11:57 PM

The fread() function reads data from an open file. The fread() function stops at the end of the file or when it reaches the specified length. Returns the read string on success. Returns FALSE on failure. Syntax fread(file_pointer,length) Parameter file_pointer−The file system pointer resource created using fopen(). Required. length−Maximum number of bytes to read. Required. Return Value If successful, the fread() function returns the read string. On failure, returns FALSE. Suppose we have a file called "one.txt" where

See all articles