Skip to content

Teresazdy/CVE

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 

Repository files navigation

CVE2023-50162

Vulnerability: SQL Statement Execution File Upload Remote Code Execution (RCE)

[NAME OF AFFECTED PRODUCT(S)]:EmpireCMS

[AFFECTED AND/OR FIXED VERSION(S)]: V7.5

[PROBLEM TYPE] SQL Statement Execution File Upload Remote Code Execution (RCE)

[DESCRIPTION]

Accessing the backend:

image

Execute the following SQL statement:

select '' into dumpfile '/Users/zhaozhouqiao/site/evil.php';

You can see that the file has been successfully written.

image

Subsequently, access evil.php to execute the code:

image

Note: The prerequisite is that the MySQL variable secure_file_priv must be set to null.

Code Analysis:

Firstly, in the following code snippet, the content of the POST request is directly passed to the DoExecSql function without any filtering.

image

The code below passes the content of the query variable to DoRunQuery for execution:

image

The execution process lacks any filtering, directly executing the SQL statements provided by the user:

image

Therefore, it is possible to achieve arbitrary file upload using statements like select into outfile.

Mitigation Measures:

Set secure_file_priv for the MySQL database to null to prevent file uploads.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published