Our Proactive Monitoring Caught an Authenticated Option Update Vulnerability in a WordPress Plugin with 40,000+ Installs
One way we help to improve the security of WordPress plugins, not just for our 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, an authenticated option update vulnerability, in the plugin Stop Generating Unnecessary Thumbnails, which has 40,000+ installs.
We now are also running all the plugins used by customers through that on a weekly basis, to provide additional protection for our customers.
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.
Authenticated Option Update
The plugin registers the function dismiss_notice() to be accessible through WordPress’ AJAX functionality to anyone logged in to WordPress:
152 | $ajax->priv( 'cxis-dismiss', 'dismiss_notice' ); |
That function, which is in the file /src/AJAX.php, will update a WordPress option (setting) specified by user input to true:
111 112 113 114 115 116 117 118 119 120 121 122 123 | public function dismiss_notice() { $response = [ 'status' => 0, 'message' => __( 'Failed', 'image-sizes' ), ]; if( !wp_verify_nonce( $_GET['_nonce'], $this->slug ) ) { $response['message'] = __( 'Unauthorized', 'image-sizes' ); wp_send_json( $response ); } update_option( $_GET['meta_key'], 1 ); |
The only limitation on that is that you have to have a valid nonce, which is used to prevent cross-site request forgery (CSRF). In this case, that doesn’t provide much restriction as anyone logged in to WordPress that has access to the admin area, which they normally would, will have access to a valid nonce.
The code should restrict what options can be updated to the ones intended to be changed through that and probably have a capabilities check as well.
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 turn on user registration, when logged in to WordPress.
Make sure to replace “[path to WordPress]” with the location of WordPress and “[nonce]” with nonce value on the line that starts on “var CXIS ” on admin pages.
http://[path to WordPress]/wp-admin/admin-ajax.php?action=cxis-dismiss&_nonce=[nonce]&meta_key=users_can_register