diff --git a/includes/admin.php b/includes/admin.php index c0499f6..8519a91 100755 --- a/includes/admin.php +++ b/includes/admin.php @@ -67,7 +67,7 @@ public function __construct() */ public function init() { - $sitename = strtolower($_SERVER['SERVER_NAME']); + $sitename = sanitize_text_field(strtolower($_SERVER['SERVER_NAME'])); if (substr($sitename, 0, 4) === 'www.') { $sitename = substr($sitename, 4); } @@ -166,7 +166,7 @@ public function admin_footer_js() ajaxurl, { action: 'mailgun-test', - _wpnonce: '' + _wpnonce: '' } ) .complete(function () { @@ -386,7 +386,7 @@ public function ajax_send_test() nocache_headers(); header('Content-Type: application/json'); - if (!current_user_can('manage_options') || !wp_verify_nonce($_GET['_wpnonce'])): + if (!current_user_can('manage_options') || !wp_verify_nonce(sanitize_text_field($_GET['_wpnonce']))): die( json_encode(array( 'message' => __('Unauthorized', 'mailgun'), diff --git a/includes/lists-page.php b/includes/lists-page.php index 1ca4dea..1719f79 100644 --- a/includes/lists-page.php +++ b/includes/lists-page.php @@ -46,7 +46,7 @@ - Mailgun + Mailgun @@ -54,7 +54,7 @@ -

| Back to settings

+

| Back to settings

@@ -73,10 +73,10 @@ - - + + - [mailgun id=""] + [mailgun id=""] diff --git a/includes/mg-filter.php b/includes/mg-filter.php index b9272ef..95e7ba4 100755 --- a/includes/mg-filter.php +++ b/includes/mg-filter.php @@ -152,7 +152,7 @@ function mg_detect_from_address($from_addr_header = null): string if (function_exists('get_current_site')) { $sitedomain = get_current_site()->domain; } else { - $sitedomain = strtolower($_SERVER['SERVER_NAME']); + $sitedomain = strtolower(sanitize_text_field($_SERVER['SERVER_NAME'])); if (substr($sitedomain, 0, 4) === 'www.') { $sitedomain = substr($sitedomain, 4); } diff --git a/includes/options-page.php b/includes/options-page.php index bdfe998..502b3fb 100755 --- a/includes/options-page.php +++ b/includes/options-page.php @@ -57,7 +57,7 @@

- Mailgun + Mailgun

@@ -75,7 +75,7 @@ ) ), esc_url($url), '_blank' ); - echo $link; + echo wp_kses_data($link); ?>

@@ -92,7 +92,7 @@ ) ), esc_url($url), '_blank' ); - echo $link; + echo wp_kses_data($link); ?>

@@ -107,11 +107,11 @@ - + @@ -128,7 +128,7 @@ - + + + + +

- +

- +

- /> + />

get_lists(); ?> -
-
+
+

- +

- +

@@ -399,15 +399,15 @@ public function list_form(string $list_address, array $args = [], array $instanc ?>
  • + name="addresses[]"/>
  • - + - @@ -454,9 +454,9 @@ public function list_form(string $list_address, array $args = [], array $instanc // success if ((data.status === 200)) { - jQuery('. .widget-list-panel').css('display', 'none') - jQuery('. .list-form').css('display', 'none') - jQuery('. .result-panel').css('display', 'block') + jQuery('. .widget-list-panel').css('display', 'none') + jQuery('. .list-form').css('display', 'none') + jQuery('. .result-panel').css('display', 'block') // error } else { alert(data_msg) diff --git a/readme.md b/readme.md index 6395407..53604b0 100755 --- a/readme.md +++ b/readme.md @@ -5,7 +5,7 @@ Contributors: mailgun, sivel, lookahead.io, m35dev Tags: mailgun, smtp, http, api, mail, email Requires at least: 3.3 Tested up to: 6.1.1 -Stable tag: 1.8.10 +Stable tag: 1.9 Requires PHP: 5.6 License: GPLv2 or later @@ -130,6 +130,9 @@ MAILGUN_FROM_ADDRESS Type: string == Changelog == += 1.9 (2023-01-18): = +- Sanitizing and escaping vars. Possible security issues + = 1.8.10 (2022-12-26): = - Fixed bug with not overriding `from name` for Woocommerce diff --git a/readme.txt b/readme.txt index b4696e0..9f981d4 100755 --- a/readme.txt +++ b/readme.txt @@ -5,7 +5,7 @@ Contributors: mailgun, sivel, lookahead.io, m35dev Tags: mailgun, smtp, http, api, mail, email Requires at least: 4.4 Tested up to: 6.1.1 -Stable tag: 1.8.10 +Stable tag: 1.9 Requires PHP: 5.6 License: GPLv2 or later @@ -128,6 +128,9 @@ MAILGUN_FROM_ADDRESS Type: string == Changelog == += 1.9 (2023-01-18): = +- Sanitizing and escaping vars. Possible security issues + = 1.8.10 (2022-12-26): = - Fixed bug with not overriding `from name` for Woocommerce