Hackers May Already be Targeting this Authenticated Persistent XSS Vulnerability in FileBird Lite
As part of monitoring we do to make sure we are providing customers of our service with the best possible data on vulnerabilities in WordPress plugins they may be using, we found that yesterday a hacker looked to be probing for usage of the plugin FileBird Lite, which has 10,000+ installs, by requesting the following files:
- /wp-content/plugins/filebird/admin/css/filebird-upload.css
- /wp-content/plugins/filebird/readme.txt
- /wp-content/plugins/filebird/admin/js/filebird-util.js
In looking into what the hacker might be interested in exploiting in that we found right away that there is an authenticated persistent cross-site scripting (XSS) vulnerability in the current version of the plugin that is similar to vulnerabilities that hackers have widely exploited recently. We saw other insecure code in the plugin and there look to be additional vulnerabilities, so the plugin should be more thoroughly reviewed and secured before being used.
The plugin registers the function filebird_ajax_save_splitter() to accessible via WordPress’ AJAX functionality to those logged in to WordPress:
174 | $this->loader->add_action('wp_ajax_filebird_ajax_save_splitter', $plugin_admin, 'filebird_ajax_save_splitter'); |
That function, which is located in the file /admin/class-filebird-admin.php, takes user input and saves it as the plugin’s splitter width setting:
664 665 666 667 668 669 670 671 672 | public function filebird_ajax_save_splitter() { $width = $_POST['splitter_width']; if (update_option('njt-filebird_splitter_width', $width)) { wp_send_json_success(); } else { wp_send_json_error(); } } |
The code lacks a capabilities checks to limit access to changing the settings to the user intended to be able to do it, a nonce check to prevent cross-site request forgery (CSRF), and santiziation/validation to restrict the value of the setting to an intended value.
When visiting WordPress’ Media Library the following code in the function filebird_add_init_media_manager(), which is located in the same file, will output the saved value without escaping it:
280 281 282 283 284 285 286 287 288 | $sidebar_splitter_width = get_option('njt-filebird_splitter_width'); ?> <div id="filebird_sidebar" style="display: none;"> <div class="filebird_sidebar panel-left" <?php echo ($sidebar_splitter_width && !$isCallModal ? ' style="width: ' . $sidebar_splitter_width . 'px;"' : '') ?> > <div class="filebird_sidebar_fixed" <?php echo ($sidebar_splitter_width && !$isCallModal ? ' style="width: ' . $sidebar_splitter_width . 'px;"' : '') ?> |
So you have an authenticated persistent cross-site scripting (XSS) vulnerability there as anyone logged in to WordPress can cause malicious JavaScript code to be output on that page by exploiting the vulnerability. Through cross-site request forgery (CSRF) an attacker could cause someone logged in to WordPress to do the same.
WordPress Causes 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 concept will cause an alert box with any available cookies to be shown when accessing the page /wp-admin/upload.php, 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=filebird_ajax_save_splitter" method="POST"> <input type="hidden" name="splitter_width" value='"><script>alert(document.cookie);</script>' /> <input type="submit" value="Submit" /> </form> </body> </html>