29 Nov 2021

Our Proactive Monitoring Caught an Authenticated Plugin Deactivation Vulnerability in Userplace

Recently we ran across a vulnerability that had just been fixed in a plugin that allowed deactivating arbitrary WordPress plugins. That is a big concern for firewall plugins, like the one we recently released, as an attacker could disable the plugin and then take actions they would otherwise be unable to take because of the firewall. Making it more of a concern, testing we did after finding that, showed that most security plugins didn’t protect against that. We have put in place protection for that in our firewall plugin, which will be released with the next version of our plugin, but based on past experience, other security plugins likely won’t address that.

After seeing that vulnerability, we updated our automated tools, including our proactive monitoring of changes made to plugins in the Plugin Directory to try to catch serious vulnerabilities, to detect some instances of that. Because of that update to our proactive monitoring, we were alerted to an authenticated instance of that in the plugin Userplace.

The possibility of this vulnerability is also flagged by our Plugin Security Checker, so you can check plugins you use to see if they might have similar issues with that tool.

We tested and confirmed that the next version of firewall plugin for WordPress protected against the proof of concept below, even before we discovered the vulnerability, as part of its protection against zero-day vulnerabilities.

Authenticated Plugin Deactivation

In the file /includes/class-userplace-ajax-handler.php, the plugin makes the function userplace_deactivate_adons() accessible to anyone logged in to WordPress:

42
add_action("wp_ajax_userplace_deactivate_adons", array($this, 'userplace_deactivate_adons'));

That function, which is located in the same file, will deactivate an arbitrary plugin specified by the POST input “plugin”:

62
63
64
65
public function userplace_deactivate_adons()
{
	$plugin = $_POST['plugin'];
	$result = deactivate_plugins($_POST['plugin']);

No security checks are done there. Considering that this is a membership plugin, making sure that only Administrators have access to the functionality seems like it should be top of mind, so the lack of capabilities check is troubling. Anyone considering using the plugin should check to make sure there are not other issues along those lines.

There is also a lack of a nonce check, so this 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 disable the Akismet plugin, when logged in to WordPress.

Make sure to replace “[path to WordPress]” with the location of WordPress.

<html>
<body>
<form action="http://[path to WordPress]/wp-admin/admin-ajax.php?action=userplace_deactivate_adons" method="POST">
<input type="hidden" name="plugin" value="akismet/akismet.php" />
<input type="submit" value="Submit" />
</form>
</body>

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.

Leave a Reply

Your email address will not be published.