Recently Closed WordPress Plugin with 40,000+ Installs Contains Privilege Escalation Vulnerability
On Monday, the WordPress plugin WP SVG Icons was closed on WordPress Plugin Directory. Because that is one of the 1,000 most popular plugins in that directory (it has 40,000+ installs), our systems warned us about the closure and we started checking over the plugin to see if there was a vulnerability we should warn customers of our services about. What we found was that it at least contains a minor vulnerability.
The plugin registers the function svg_delete_custom_pack_ajax() to be accessible through WordPress’ AJAX functionality by anyone logged in to WordPress:
60 | add_action( 'wp_ajax_svg_delete_custom_pack', array( &$this, 'svg_delete_custom_pack_ajax' ) ); |
That function, which is located in the file /admin/class-wp-svg-icons-admin.php, doesn’t do any security checks before deleting the custom icon pack on the website:
131 132 133 134 135 136 137 138 139 140 141 | function svg_delete_custom_pack_ajax() { $dest = wp_upload_dir(); $dest_path = explode( '/uploads/' , $dest['path'] ); $customFontPackFolderPath = $dest_path[0] . '/uploads/wp-svg-icons/custom-pack/'; $zip_fileName = 'wp-svg-custom-pack.zip'; // delete the custom icon pack .zip $delete_zip = $this->recursive_delete_directory( $customFontPackFolderPath . $zip_fileName ); // delete the entire custom font pack folder $delete_directory = $this->recursive_delete_directory( $customFontPackFolderPath ); die(); } |
There should be a capabilities check to limit who can access that and a nonce check to prevent cross-site request forgery (CSRF).
The impact of that is fairly minimal, since there isn’t an ability to delete anything other than what is intended.
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 delete the custom icon pack, when logged in to WordPress.
Make sure to replace “[path to WordPress]” with the location of WordPress.
http://[path to WordPress]/wp-admin/admin-ajax.php?action=svg_delete_custom_pack