CVE-2015-10101: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') (CWE-79)
value: A vulnerability classified as problematic was found in Google Analytics Top Content Widget Plugin up to 1.5.6 on WordPress. Affected by this vulnerability is an unknown functionality of the file class-tgm-plugin-activation.php. The manipulation leads to cross site scripting. The attack can be launched remotely. Upgrading to version 1.5.7 is able to address this issue. The identifier of the patch is 25bb1dea113716200a6f0f3135801d84a7a65540. It is recommended to upgrade the affected component. The identifier VDB-226117 was assigned to this vulnerability.
CWE description: The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.
CVSS v3 base score: 6.1
Published: 2023-04-15T21:15Z
Repository: https://github.com/wp-plugins/google-analytics-top-posts-widget
Language: PHP
Files changed: class-tgm-plugin-activation.php, google-analytics-top-posts-widget.php, readme.txt
Commit date: 2015-04-20 18:01:16 +0000
Commit message: Update for xss vulnerability, https://make.wordpress.org/plugins/2015/04/20/fixing-add_query_arg-and-remove_query_arg-usage/

git-svn-id: https://plugins.svn.wordpress.org/google-analytics-top-posts-widget/trunk@1139349 b8457f37-d9ea-0310-8a92-e5e31aec5664

Diff: diff --git a/class-tgm-plugin-activation.php b/class-tgm-plugin-activation.php
index 7473fe8..50a1039 100644
--- a/class-tgm-plugin-activation.php
+++ b/class-tgm-plugin-activation.php
@@ -700,11 +700,11 @@ if ( ! class_exists( 'TGM_Plugin_Activation' ) ) {
                     $action_links = apply_filters(
                         'tgmpa_notice_action_links',
                         array(
                             'install'  => ( current_user_can( 'install_plugins' ) ) ? $show_install_link : '',
                             'activate' => ( current_user_can( 'activate_plugins' ) ) ? $show_activate_link : '',
-                            'dismiss'  => '<a class="dismiss-notice" href="' . add_query_arg( 'tgmpa-dismiss', 'dismiss_admin_notices' ) . '" target="_parent">' . __( 'Dismiss this notice', $this->domain ) . '</a>',
+                            'dismiss'  => '<a class="dismiss-notice" href="' . esc_url( add_query_arg( 'tgmpa-dismiss', 'dismiss_admin_notices' ) ) . '" target="_parent">' . __( 'Dismiss this notice', $this->domain ) . '</a>',
                         )
                     );
 
                     $action_links = array_filter( $action_links ); // Remove any empty array items
                     if ( $action_links )
@@ -909,11 +909,11 @@ if ( ! class_exists( 'TGM_Plugin_Activation' ) ) {
          */
         public function force_activation() {
 
             /** Set file_path parameter for any installed plugins */
             $this->populate_file_path();
-            
+
             $installed_plugins = get_plugins();
 
             foreach ( $this->plugins as $plugin ) {
                 /** Oops, plugin isn't there so iterate to next condition */
                 if ( isset( $plugin['force_activation'] ) && $plugin['force_activation'] && ! isset( $installed_plugins[$plugin['file_path']] ) )
@@ -1111,28 +1111,28 @@ if ( ! class_exists( 'TGMPA_List_Table' ) ) {
                 $table_data[$i]['file_path'] = $plugin['file_path'];
                 $table_data[$i]['url'] = isset( $plugin['source'] ) ? $plugin['source'] : 'repo';
 
                 $i++;
             }
-            
+
             /** Sort plugins by Required/Recommended type and by alphabetical listing within each type */
             $resort = array();
             $req = array();
             $rec = array();
-            
+
             /** Grab all the plugin types */
             foreach ( $table_data as $plugin )
                 $resort[] = $plugin['type'];
-            
+
             /** Sort each plugin by type */
             foreach ( $resort as $type )
                 if ( 'Required' == $type )
                     $req[] = $type;
                 else
                     $rec[] = $type;
-            
-            /** Sort alphabetically each plugin type array, merge them and then sort in reverse	(lists Required plugins first) */	
+
+            /** Sort alphabetically each plugin type array, merge them and then sort in reverse	(lists Required plugins first) */
             sort( $req );
             sort( $rec );
             array_merge( $resort, $req, $rec );
             array_multisort( $resort, SORT_DESC, $table_data );
 
@@ -2087,6 +2087,6 @@ if ( ! class_exists( 'WP_Upgrader' ) && ( isset( $_GET[sanitize_key( 'page' )] )
 
             }
 
         }
     }
-}
\ No newline at end of file
+}
diff --git a/google-analytics-top-posts-widget.php b/google-analytics-top-posts-widget.php
index 60f8745..b89e389 100644
--- a/google-analytics-top-posts-widget.php
+++ b/google-analytics-top-posts-widget.php
@@ -4,11 +4,11 @@ Plugin Name:  Google Analytics Top Content Widget
 Description: Widget and shortcode to display top content according to Google Analytics. ("Google Analytics Dashboard" plugin required)
 Plugin URI: http://j.ustin.co/yWTtmy
 Author: Jtsternberg
 Author URI: http://jtsternberg.com/about
 Donate link: http://j.ustin.co/rYL89n
-Version: 1.5.6
+Version: 1.5.7
 */
 
 
 add_action( 'widgets_init', 'dsgnwrks_register_google_top_posts_widget' );
 /**
diff --git a/readme.txt b/readme.txt
index 8fef7dd..a88b7a1 100644
--- a/readme.txt
+++ b/readme.txt
@@ -7,13 +7,13 @@ Plugin URI: http://j.ustin.co/yWTtmy
 Tags: google analytics, google, top posts, top content, display rank, page rank, page views, widget, sidebar, sidebar widget, Google Analytics Dashboard, shortcode, site stats, statistics, stats  
 Author: Jtsternberg  
 Author URI: http://jtsternberg.com/about  
 Donate link: http://j.ustin.co/rYL89n  
 Requires at least: 3.0  
-Tested up to: 4.1  
-Stable tag: 1.5.6  
-Version: 1.5.6  
+Tested up to: 4.2  
+Stable tag: 1.5.7  
+Version: 1.5.7  
 License: GPLv2 or later  
 License URI: http://www.gnu.org/licenses/gpl-2.0.html  
 
 Widget and shortcode to display top content according to Google Analytics. ("Google Analytics Dashboard" plugin required)
 
@@ -96,10 +96,13 @@ If you run into a problem or have a question, contact me ([contact form](http://
 1. Widget options.
 2. Widget display (in an ordered list).
 
 == Changelog ==
 
+= 1.5.7 =
+* Update for xss vulnerability, https://make.wordpress.org/plugins/2015/04/20/fixing-add_query_arg-and-remove_query_arg-usage
+
 = 1.5.6 =
 * Feature: Add thumbnail option to widget.
 
 = 1.5.5 =
 * Bug Fix: Fix a few logic issues causing debug.log notices.
@@ -161,10 +164,13 @@ If you were using the shortcode and it broke, you will need to switch to using t
 * Launch.
 
 
 == Upgrade Notice ==
 
+= 1.5.7 =
+* Update for xss vulnerability, https://make.wordpress.org/plugins/2015/04/20/fixing-add_query_arg-and-remove_query_arg-usage
+
 = 1.5.6 =
 * Feature: Add thumbnail option to widget.
 
 = 1.5.5 =
 * Bug Fix: Fix a few logic issues causing debug.log notices.

Vulnerable code:                             'dismiss'  => '<a class="dismiss-notice" href="' . add_query_arg( 'tgmpa-dismiss', 'dismiss_admin_notices' ) . '" target="_parent">' . __( 'Dismiss this notice', $this->domain ) . '</a>',
            
            
            
            
            
            /** Sort alphabetically each plugin type array, merge them and then sort in reverse	(lists Required plugins first) */	
}
Version: 1.5.6
Tested up to: 4.1  
Stable tag: 1.5.6  
Version: 1.5.6  
Fixed code:                             'dismiss'  => '<a class="dismiss-notice" href="' . esc_url( add_query_arg( 'tgmpa-dismiss', 'dismiss_admin_notices' ) ) . '" target="_parent">' . __( 'Dismiss this notice', $this->domain ) . '</a>',





            /** Sort alphabetically each plugin type array, merge them and then sort in reverse	(lists Required plugins first) */
}
Version: 1.5.7
Tested up to: 4.2  
Stable tag: 1.5.7  
Version: 1.5.7  
= 1.5.7 =
* Update for xss vulnerability, https://make.wordpress.org/plugins/2015/04/20/fixing-add_query_arg-and-remove_query_arg-usage

= 1.5.7 =
* Update for xss vulnerability, https://make.wordpress.org/plugins/2015/04/20/fixing-add_query_arg-and-remove_query_arg-usage