Below is a differential between the unpatched vulnerable code and the patched update, for reference.
--- a/mailoptin/mailoptin.php
+++ b/mailoptin/mailoptin.php
@@ -4,7 +4,7 @@
Plugin Name: MailOptin - Lite
Plugin URI: https://mailoptin.io
Description: Best lead generation, email automation & newsletter plugin.
-Version: 1.2.78.0
+Version: 1.2.78.1
Author: MailOptin Popup Builder Team
Contributors: collizo4sky
Author URI: https://mailoptin.io
@@ -16,7 +16,7 @@
require __DIR__ . '/vendor/autoload.php';
define('MAILOPTIN_SYSTEM_FILE_PATH', __FILE__);
-define('MAILOPTIN_VERSION_NUMBER', '1.2.78.0');
+define('MAILOPTIN_VERSION_NUMBER', '1.2.78.1');
MailOptinCoreCore::init();
MailOptinConnectionsInit::init();
No newline at end of file
--- a/mailoptin/src/connections/MailChimpConnect/AbstractMailChimpConnect.php
+++ b/mailoptin/src/connections/MailChimpConnect/AbstractMailChimpConnect.php
@@ -27,7 +27,7 @@
}
/**
- * Is MailChimp successfully connected to?
+ * Is Mailchimp successfully connected to?
*
* @return bool
*/
@@ -112,7 +112,7 @@
}
/**
- * Return instance of MailChimp list class.
+ * Return instance of Mailchimp list class.
*
* @throws Exception
*
@@ -123,7 +123,7 @@
$api_key = $this->connections_settings->mailchimp_api_key();
if (empty($api_key)) {
- throw new Exception('MailChimp API key not found.');
+ throw new Exception('Mailchimp API key not found.');
}
$client = new MailchimpCurlHttpClient(['timeout' => 30]);
@@ -132,7 +132,7 @@
}
/**
- * Return instance of MailChimp campaign class.
+ * Return instance of Mailchimp campaign class.
*
* @throws Exception
*
@@ -143,7 +143,7 @@
$api_key = $this->connections_settings->mailchimp_api_key();
if (empty($api_key)) {
- throw new Exception('MailChimp API key not found.');
+ throw new Exception('Mailchimp API key not found.');
}
$client = new MailchimpCurlHttpClient(['timeout' => 30]);
--- a/mailoptin/src/connections/MailChimpConnect/Connect.php
+++ b/mailoptin/src/connections/MailChimpConnect/Connect.php
@@ -117,7 +117,7 @@
}
/**
- * Register MailChimp Connection.
+ * Register Mailchimp Connection.
*
* @param array $connections
*
@@ -279,7 +279,7 @@
*/
public function add_reward_merge_tag($footer_description)
{
- // do not add MailChimp reward merge tag to customizer preview.
+ // do not add Mailchimp reward merge tag to customizer preview.
if ( ! is_customize_preview()) {
$footer_description .= '<br/>' . '*|IF:REWARDS|* *|HTML:REWARDS|* *|END:IF|*';
}
@@ -420,7 +420,7 @@
if (empty($interest_groups)) {
$controls[] = [
'field' => 'custom_content',
- 'content' => '<div class="MailChimpConnect_interests mc-group-block" style="background:#000000;color:#fff;margin:5px 0;padding:10px;font-size:14px;">' . __('No MailChimp group found. Try selecting another email list.', 'mailoptin') . '</div>'
+ 'content' => '<div class="MailChimpConnect_interests mc-group-block" style="background:#000000;color:#fff;margin:5px 0;padding:10px;font-size:14px;">' . __('No Mailchimp group found. Try selecting another email list.', 'mailoptin') . '</div>'
];
} else {
--- a/mailoptin/src/connections/MailChimpConnect/ConnectSettingsPage.php
+++ b/mailoptin/src/connections/MailChimpConnect/ConnectSettingsPage.php
@@ -83,7 +83,7 @@
'obfuscate_val' => true,
'label' => __('Enter API Key', 'mailoptin'),
'description' => sprintf(
- __('Log in to your %sMailChimp account%s to get your API Key.', 'mailoptin'),
+ __('Log in to your %sMailchimp account%s to get your API Key.', 'mailoptin'),
'<a target="_blank" href="https://admin.mailchimp.com/account/api-key-popup">',
'</a>'
),
--- a/mailoptin/src/connections/MailChimpConnect/SendCampaign.php
+++ b/mailoptin/src/connections/MailChimpConnect/SendCampaign.php
@@ -88,7 +88,7 @@
if ( ! empty($response->id)) {
$campaign_id = $response->id;
- // save the MailChimp campaign ID against the campaign log.
+ // save the Mailchimp campaign ID against the campaign log.
AbstractCampaignLogMeta::add_campaignlog_meta($this->campaign_log_id, 'mailchimp_campaign_id', $campaign_id);
$parameters = [
--- a/mailoptin/src/connections/MailChimpConnect/Subscription.php
+++ b/mailoptin/src/connections/MailChimpConnect/Subscription.php
@@ -212,9 +212,14 @@
'interests' => $this->interests(),
'status_if_new' => $optin_status,
'status' => 'subscribed',
- 'ip_signup' => parse_url('http://' . get_ip_address(), PHP_URL_HOST) // strip ports and stuff
+ // Strip ports and stuff. does not work with ipv6. see https://stackoverflow.com/a/66805163/2648410
+ 'ip_signup' => parse_url('http://' . get_ip_address(), PHP_URL_HOST)
];
+ if(filter_var($parameters['ip_signup'], FILTER_VALIDATE_IP) === false) {
+ unset($parameters['ip_signup']);
+ }
+
$parameters = apply_filters('mo_connections_mailchimp_subscription_parameters', array_filter($parameters, [$this, 'data_filter']), $this);
$response = $this->mc_list_instance()->addOrUpdateMember($this->list_id, $this->email, $parameters);
--- a/mailoptin/src/core/src/BlockEditor/build/email-optin/render.php
+++ b/mailoptin/src/core/src/BlockEditor/build/email-optin/render.php
@@ -1,3 +1,3 @@
<div <?php echo get_block_wrapper_attributes(); ?>>
- <?php echo do_shortcode(sprintf('[mo-optin-form id="%s"]', $attributes['id'] ?? '')) ?>
+ <?php echo do_shortcode(sprintf('[mo-optin-form id="%s"]', absint($attributes['id']) ?? '')) ?>
</div>
--- a/mailoptin/src/core/src/BlockEditor/src/email-optin/render.php
+++ b/mailoptin/src/core/src/BlockEditor/src/email-optin/render.php
@@ -1,3 +1,3 @@
<div <?php echo get_block_wrapper_attributes(); ?>>
- <?php echo do_shortcode(sprintf('[mo-optin-form id="%s"]', $attributes['id'] ?? '')) ?>
+ <?php echo do_shortcode(sprintf('[mo-optin-form id="%s"]', absint($attributes['id']) ?? '')) ?>
</div>
--- a/mailoptin/vendor/composer/installed.php
+++ b/mailoptin/vendor/composer/installed.php
@@ -66,12 +66,6 @@
'aliases' => array(),
'dev_requirement' => false,
),
- 'guzzlehttp/guzzle' => array(
- 'dev_requirement' => false,
- 'replaced' => array(
- 0 => '*',
- ),
- ),
'league/csv' => array(
'pretty_version' => '9.8.0',
'version' => '9.8.0.0',
@@ -82,8 +76,8 @@
'dev_requirement' => false,
),
'mailoptin/authifly' => array(
- 'pretty_version' => '0.2.1782903804',
- 'version' => '0.2.1782903804.0',
+ 'pretty_version' => '0.2.1785158706',
+ 'version' => '0.2.1785158706.0',
'reference' => null,
'type' => 'wordpress-plugin',
'install_path' => __DIR__ . '/../mailoptin/authifly',
@@ -91,8 +85,8 @@
'dev_requirement' => false,
),
'mailoptin/connections' => array(
- 'pretty_version' => '0.2.1782903847',
- 'version' => '0.2.1782903847.0',
+ 'pretty_version' => '0.2.1785158757',
+ 'version' => '0.2.1785158757.0',
'reference' => null,
'type' => 'wordpress-plugin',
'install_path' => __DIR__ . '/../../src/connections',
@@ -100,18 +94,18 @@
'dev_requirement' => false,
),
'mailoptin/core' => array(
- 'pretty_version' => '0.1.0-alpha.1782903842',
- 'version' => '0.1.0.0-alpha1782903842',
- 'reference' => '0fef44b70691635fe5521cc2cd32ad9e75591fe3',
+ 'pretty_version' => '0.1.0-alpha.1785158752',
+ 'version' => '0.1.0.0-alpha1785158752',
+ 'reference' => 'db73678b38edc158a9c3d8b1a005c175ff842b40',
'type' => 'wordpress-plugin',
'install_path' => __DIR__ . '/../../src/core',
'aliases' => array(),
'dev_requirement' => false,
),
'mailoptin/mailchimp-api-php' => array(
- 'pretty_version' => '2.1.5',
- 'version' => '2.1.5.0',
- 'reference' => 'ade3bac74a26260d400bfaaa619f45d2a1421eb8',
+ 'pretty_version' => '2.1.7',
+ 'version' => '2.1.7.0',
+ 'reference' => 'f39256fd31eb880361fc94c68544aa62b60fab1d',
'type' => 'library',
'install_path' => __DIR__ . '/../mailoptin/mailchimp-api-php',
'aliases' => array(),