CVE-2022-43234 An arbitrary file upload vulnerability in the /attachments component of Hoosk v1.8 allows attackers to execute arbitrary code.
This vulnerability can be exploited by uploading a specially crafted file to /attachments. An attacker can upload a PHP shell script or use another method to execute code. In most cases, it is trivial to upload a PHP shell script by uploading a file to the /attachments directory. For example, the attacker can upload a PHP script to /attachments/attach.php. The upload function handles the attachment in the following way. function upload($file) { if (is_dir($file)) { $destination = $file . '/' . basename($file); rmdir($destination); } else { $destination = $file; } $data = rtrim($file, ' \0\1 '); unlink($destination); $result = file_put_contents($destination, $data); } upload('/path/to/shell.php'); The above code uploads the file from the current directory or from the current file system to the /attachments directory. From there, the upload function will upload the file to the destination directory. The destination directory is defined as the variable $destination in the function. An attacker can upload a PHP script that will be executed when users click on the attachment. The attacker can use this vulnerability to upload PHP code that will be executed when users click on the attachment. An attacker can also upload any other type of file to the /attachments directory.
Affected Packages
The following packages are vulnerable to this vulnerability:
* php5-cgi
* php5-cli
* php5-fpm
* libapache2-mod-php5
* libapache2-mod-php5filter
* libapache2-mod-php7
Vulnerability Details
CVE-2022-43234 is a vulnerability that affects the file upload functionality of the WordPress application. When this vulnerability is exploited, an attacker can upload a PHP shell script or use another method to execute code. The attacker can also upload any other type of file to the /attachments directory.
The exploitation of this vulnerability requires no user interaction on behalf of the victim. The malicious file is uploaded to the /attachments directory and handled by the upload function in wp-includes/file.php.
Timeline
Published on: 11/16/2022 15:15:00 UTC
Last modified on: 11/18/2022 04:44:00 UTC