Authenticated Persistent Cross-Site Scripting (XSS) Vulnerability in Project Supremacy Lite (Project Supremacy V3 Lite)
As part of making sure we are providing the users of our service with the best information on vulnerabilities in WordPress plugins they may be using we monitor for indications that security vulnerabilities have been fixed in new versions of the plugins. Today that led to us looking at Project Supremacy Lite (Project Supremacy V3 Lite) where the changelog for the latest version is “Added some security fixes.” The changes made in that version look to be escaping the output of the plugin’s settings. Normally the lack of that wouldn’t be a vulnerability because only Administrators are allowed to change the settings and they can do anything they want with WordPress already. When we went to check to see if that was the case with this plugin we found that anyone logged in to WordPress can change the plugin’s settings and one of those settings is intended to be used to place JavaScript code on all of the frontened pages of the website, which would lead to an authenticated persistent cross-site scripting (XSS) vulnerability.
The plugin registers the function that handles saving the plugin’s setting, saveGeneral() to anyone logged in to WordPress:
12 | add_action( 'admin_post_prs_save_general', array( 'MPRS_Seo', 'saveGeneral' ) ); |
That function, which is located in the file /models/wp_seo.php, will update any WordPress option that has a name that includes “ps_seo” to an arbitrary value:
239 240 241 242 243 244 245 246 247 | public static function saveGeneral() { if (!empty($_POST)) { foreach($_POST as $key=>$value) { if (strpos($key, 'ps_seo') !== false) { update_option($key, trim($value)); } } } } |
There should be a capabilities check there to limit what users can access the update functionality. There should be a nonce check to prevent cross-site request forgery (CSRF), so that an attacker could not cause a logged in user to access that functionality without intending it. It also might be advisable to better limit what options can updated and sanitize the values appropriately.
Full Disclosure
Due to the moderators of the WordPress Support Forum’s continued inappropriate behavior we are full disclosing vulnerabilities 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. 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).
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 cause an alert box with the message “XSS” to be shown on frontend pages, 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-post.php" method="POST"> <input type="hidden" name="action" value="prs_save_general" /> <input type="hidden" name="ps_seo_global_scripts" value='<script>alert("XSS");</script>' /> <input type="submit" value="Submit" /> </form> </body> </html>