Below is a differential between the unpatched vulnerable code and the patched update, for reference.
--- a/youtube-showcase/includes/admin/getting-started.php
+++ b/youtube-showcase/includes/admin/getting-started.php
@@ -327,6 +327,17 @@
?>
<p class="about-description">This page lists the release notes from every production version of YouTube Showcase Community.</p>
+<h3 style="font-size: 18px;font-weight:700;color: white;background: #708090;padding:5px 10px;width:155px;border: 2px solid #fff;border-radius:4px;text-align:center">3.5.2 changes</h3>
+<div class="wp-clearfix"><div class="changelog emd-section whats-new whats-new-1595" style="margin:0">
+<h3 style="font-size:18px;" class="fix"><div style="font-size:110%;color:#c71585"><span class="dashicons dashicons-admin-tools"></span> FIX</div>
+Vulnerability related to emd_get_widg_pagenum</h3>
+<div ></a></div></div></div><hr style="margin:30px 0"><div class="wp-clearfix"><div class="changelog emd-section whats-new whats-new-1594" style="margin:0">
+<h3 style="font-size:18px;" class="fix"><div style="font-size:110%;color:#c71585"><span class="dashicons dashicons-admin-tools"></span> FIX</div>
+Validate input for emd_form_builder_lite_pagenum function</h3>
+<div ></a></div></div></div><hr style="margin:30px 0"><div class="wp-clearfix"><div class="changelog emd-section whats-new whats-new-1593" style="margin:0">
+<h3 style="font-size:18px;" class="fix"><div style="font-size:110%;color:#c71585"><span class="dashicons dashicons-admin-tools"></span> FIX</div>
+XSS vulnerability for noaccess_msg</h3>
+<div ></a></div></div></div><hr style="margin:30px 0">
<h3 style="font-size: 18px;font-weight:700;color: white;background: #708090;padding:5px 10px;width:155px;border: 2px solid #fff;border-radius:4px;text-align:center">3.5.1 changes</h3>
<div class="wp-clearfix"><div class="changelog emd-section whats-new whats-new-1561" style="margin:0">
<h3 style="font-size:18px;" class="fix"><div style="font-size:110%;color:#c71585"><span class="dashicons dashicons-admin-tools"></span> FIX</div>
--- a/youtube-showcase/includes/class-install-deactivate.php
+++ b/youtube-showcase/includes/class-install-deactivate.php
@@ -216,6 +216,7 @@
*/
private function set_options() {
$access_views = Array();
+ $widg_list = Array();
if (get_option($this->option_name . '_setup_pages', 0) == 0) {
update_option($this->option_name . '_setup_pages', 1);
}
@@ -305,6 +306,12 @@
if (!empty($shc_list)) {
update_option($this->option_name . '_shc_list', $shc_list);
}
+ $widg_list = Array(
+ 'youtube_showcase_recent_videos_widget,youtube_showcase_featured_videos_widget,youtube_showcase_search_videos_widget'
+ );
+ if (!empty($widg_list)) {
+ update_option($this->option_name . '_widg_list', $widg_list);
+ }
$attr_list['emd_video']['emd_video_key'] = Array(
'label' => __('Video Key', 'youtube-showcase') ,
'display_type' => 'text',
--- a/youtube-showcase/includes/emd-form-builder-lite/emd-form-frontend.php
+++ b/youtube-showcase/includes/emd-form-builder-lite/emd-form-frontend.php
@@ -470,8 +470,8 @@
}
return emd_form_builder_lite_render_form($myform->ID,$app,$fcontent,$error,$status,$atts_set);
} else {
- $noaccess_msg = $fcontent['settings']['noaccess_msg'];
- return "<div class='alert alert-info not-authorized'>" . $noaccess_msg . "</div>";
+ $noaccess_msg = sanitize_text_field($fcontent['settings']['noaccess_msg']);
+ return "<div class='alert alert-info not-authorized'>" . esc_html($noaccess_msg) . "</div>";
}
}
}
--- a/youtube-showcase/includes/emd-form-builder-lite/emd-form-settings.php
+++ b/youtube-showcase/includes/emd-form-builder-lite/emd-form-settings.php
@@ -209,7 +209,7 @@
'enable_ajax' => Array('label' => 'Enable Ajax', 'type' => 'checkbox', 'depend' => 'settings_confirm_method_text', 'upgrade' => true, 'disabled' => true),
'after_submit' => Array('label' => 'After Submit', 'type' => 'select', 'depend' => 'settings_confirm_method_text', 'options' => $after_options, 'upgrade' => true, 'disabled' => true),
'success_msg' => Array('label' => 'Success Message', 'type' => 'textarea', 'depend' => 'settings_confirm_method_text','default'=> __('Thanks for your submission.','youtube-showcase')),
- 'error_msg' => Array('label' => 'Error Message', 'type' => 'textarea', 'depend' => 'settings_confirm_method_text','default'=> __('There has been an error when submitting your entry. Please contact the site administrator.')),
+ 'error_msg' => Array('label' => 'Error Message', 'type' => 'textarea', 'depend' => 'settings_confirm_method_text','default'=> __('There has been an error when submitting your entry. Please contact the site administrator.','youtube-showcase')),
);
break;
--- a/youtube-showcase/includes/emd-lite/emd-lite.php
+++ b/youtube-showcase/includes/emd-lite/emd-lite.php
@@ -298,7 +298,7 @@
}
elseif($type == 'cust_fields'){
- echo '<h2>' . esc_html__('Gather, display and search information with ease') . '</h2>
+ echo '<h2>' . esc_html__('Gather, display and search information with ease', 'youtube-showcase') . '</h2>
<div style="max-width:470px;margin: auto;margin-bottom:15px;"><strong>' . esc_html__('EMD Custom Field Builder is an easy to use yet powerful tool to customize your plugin by adding custom fields and taxonomies. ', 'youtube-showcase') . '</strong>
<span><a href="https://emdplugins.com/questions/how-to-use-emd-custom-field-builder/?pk_campaign=' . esc_attr($app) . '-cust-fields&pk_kwd=learnmore" target="_blank">' .
esc_html__('Learn more', 'youtube-showcase') . '</a>' .
--- a/youtube-showcase/includes/entities/class-emd-entity.php
+++ b/youtube-showcase/includes/entities/class-emd-entity.php
@@ -194,7 +194,7 @@
* @param string $tax_name
*
*/
- protected static function set_taxonomy_init($set_tax_terms, $tax_name) {
+ public static function set_taxonomy_init($set_tax_terms, $tax_name) {
foreach ($set_tax_terms as $my_tax_term) {
$term_id_arr = term_exists($my_tax_term['slug'], $tax_name);
$args = Array();
--- a/youtube-showcase/includes/widget-functions.php
+++ b/youtube-showcase/includes/widget-functions.php
@@ -16,32 +16,38 @@
$div_id = isset($_GET['div_id']) ? sanitize_text_field($_GET['div_id']) : '';
$myapp = isset($_GET['app']) ? sanitize_text_field($_GET['app']) : '';
if(!empty($div_id)){
- $pids = Array();
- $front_ents = emd_find_limitby('frontend', $myapp);
+ $widg_list = get_option($myapp . '_widg_list', Array());
$widg_arr = explode("-",$div_id);
- $mywidg = new $widg_arr[1]();
- $widget_settings = get_option('widget_' . $widg_arr[1]);
- $count = $widget_settings[$widg_arr[2]]['count'];
- $args['has_pages'] = $widget_settings[$widg_arr[2]]['pagination'];
- $args['posts_per_page'] = $widget_settings[$widg_arr[2]]['count_per_page'];
- $args['pagination_size'] = $widget_settings[$widg_arr[2]]['pagination_size'];
- if(!empty($front_ents) && in_array($mywidg->class,$front_ents) && $mywidg->type != 'integration'){
- $pids = apply_filters('emd_limit_by', $pids, $app, $mywidg->class,'frontend');
- }
- $args['filter'] = $mywidg->filter;
- $args['has_pages'] = true;
- $args['class'] = $mywidg->class;
- $args['cname'] = get_class($mywidg);
- $args['app'] = $myapp;
- $args['query_args'] = $mywidg->query_args;
- $args['query_args']['paged'] = $pageno;
- $widg_layout = Emd_Widget::get_ent_widget_layout($count, $pids,$args);
- if ($widg_layout) {
- echo '<input type="hidden" id="emd_app" value="' . esc_attr($myapp) . '">';
- echo wp_kses_post($mywidg->header);
- echo wp_kses_post($widg_layout);
- echo wp_kses_post($mywidg->footer);
- die();
+ $class_to_instantiate = isset($widg_arr[1]) ? sanitize_text_field($widg_arr[1]) : '';
+ if(!empty($widg_list) && in_array($class_to_instantiate, $widg_list)) {
+ $pids = Array();
+ $widget_settings = get_option('widget_' . $class_to_instantiate, Array());
+ if(!empty($widget_settings) && isset($widg_arr[2]) && !empty($widget_settings[$widg_arr[2]])){
+ $mywidg = new $class_to_instantiate();
+ $count = $widget_settings[$widg_arr[2]]['count'];
+ $args['has_pages'] = $widget_settings[$widg_arr[2]]['pagination'];
+ $args['posts_per_page'] = $widget_settings[$widg_arr[2]]['count_per_page'];
+ $args['pagination_size'] = $widget_settings[$widg_arr[2]]['pagination_size'];
+ $front_ents = emd_find_limitby('frontend', $myapp);
+ if(!empty($front_ents) && in_array($mywidg->class,$front_ents) && $mywidg->type != 'integration'){
+ $pids = apply_filters('emd_limit_by', $pids, $myapp, $mywidg->class,'frontend');
+ }
+ $args['filter'] = $mywidg->filter;
+ $args['has_pages'] = true;
+ $args['class'] = $mywidg->class;
+ $args['cname'] = get_class($mywidg);
+ $args['app'] = $myapp;
+ $args['query_args'] = $mywidg->query_args;
+ $args['query_args']['paged'] = $pageno;
+ $widg_layout = Emd_Widget::get_ent_widget_layout($count, $pids,$args);
+ if ($widg_layout) {
+ echo '<input type="hidden" id="emd_app" value="' . esc_attr($myapp) . '">';
+ echo wp_kses_post($mywidg->header);
+ echo wp_kses_post($widg_layout);
+ echo wp_kses_post($mywidg->footer);
+ die();
+ }
+ }
}
}
echo false;
--- a/youtube-showcase/youtube-showcase.php
+++ b/youtube-showcase/youtube-showcase.php
@@ -3,7 +3,7 @@
* Plugin Name: Responsive YouTube Video Gallery Plugin for WordPress – YouTube Showcase
* Plugin URI: https://emarketdesign.com
* Description: Create a responsive YouTube video gallery, playlist, or channel grid in WordPress with thumbnails, lightbox, and shortcode support.
- * Version: 3.5.1
+ * Version: 3.5.2
* Author: eMarket Design
* Author URI: https://emdplugins.com?pk_campaign=youtube-showcase-com&pk_kwd=readme-by
* Text Domain: youtube-showcase
@@ -87,7 +87,7 @@
* @return void
*/
private function define_constants() {
- define('YOUTUBE_SHOWCASE_VERSION', '3.5.1');
+ define('YOUTUBE_SHOWCASE_VERSION', '3.5.2');
define('YOUTUBE_SHOWCASE_AUTHOR', 'eMarket Design');
define('YOUTUBE_SHOWCASE_NAME', 'Youtube Showcase');
define('YOUTUBE_SHOWCASE_PLUGIN_FILE', __FILE__);