WordPress Plugin Vulnerabilities

WP All Import < 3.7.3 - Admin+ Arbitrary File Upload to RCE

Description

The plugin accepts all zip files and automatically extracts the zip file into a publicly accessible directory without sufficiently validating the extracted file type. This may allows high privilege users such as administrator to upload an executable file type leading to remote code execution.

Proof of Concept

1. Configure the Apache server with mod_include and mod_cgi enabled, and enable server-side includes:

      Options Includes
      AddType text/html .shtml
      AddOutputFilter INCLUDES .shtml

2. Create a zip file including a CSV file and a file `shell.shtml` with the following contents:

<!--#exec cmd="id" -->

3. As a site administrator on a multisite instance, visit /wp-admin/admin.php?page=pmxi-admin-import

4. Click "Upload a file" and choose the zip file created previously.

5. View the response of the AJAX request to /wp-admin/admin.php?page=pmxi-admin-settings&action=upload&_wpnonce=... to find the directory of the uploaded zip file.

6. Directly access `shell.shtml` (e.g. at `https://example.com/wp-content/uploads/wpallimport/uploads/abc123/zipfilename/shell.shtml`) to trigger the RCE.

Affects Plugins

Fixed in 3.7.3

References

Miscellaneous

Original Researcher
quangnt
Submitter
quangnt
Verified
Yes

Timeline

Publicly Published
2023-12-29 (about 4 months ago)
Added
2023-12-29 (about 4 months ago)
Last Updated
2023-12-29 (about 4 months ago)

Other