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:
Input should be validated as strictly as possible on arrival, given the kind of content which it is expected to contain. For example, personal names should consist of alphabetical and a small range of typographical characters, and be relatively short; a year of birth should consist of exactly four numerals; email addresses should match a well-defined regular expression. Input which fails the validation should be rejected, not sanitised.
User input should be HTML-encoded at any point where it is copied into application responses. All HTML metacharacters, including < > " ' and =, should be replaced with the corresponding HTML entities (< > etc).
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.
The value of the Main request parameter is copied into the value of a tag attribute which can contain JavaScript. The payload javascript%3aalert(1)//770f415b was submitted in the Main parameter. This input was echoed as javascript:alert(1)//770f415b 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 /MOAframe.asp?Main=javascript%3aalert(1)//770f415b&ButHit=prod HTTP/1.1 Host: www.mutualofamerica.com Accept: */* Accept-Language: en User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0) Connection: close Cookie: ASPSESSIONIDAQCDQDDR=KJEHNODAIJKNJPNEMPHJBJDF;
Response
HTTP/1.1 200 OK Connection: close Date: Fri, 31 Dec 2010 17:31:53 GMT Server: Microsoft-IIS/6.0 X-Powered-By: ASP.NET Content-Length: 5353 Content-Type: text/html Cache-control: private
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">
The value of the main request parameter is copied into the value of a tag attribute which can contain JavaScript. The payload javascript%3aalert(1)//761bfaa2 was submitted in the main parameter. This input was echoed as javascript:alert(1)//761bfaa2 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 /MOAframe.asp?main=javascript%3aalert(1)//761bfaa2 HTTP/1.1 Host: www.mutualofamerica.com Accept: */* Accept-Language: en User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0) Connection: close Cookie: ASPSESSIONIDAQCDQDDR=KJEHNODAIJKNJPNEMPHJBJDF;
Response
HTTP/1.1 200 OK Connection: close Date: Fri, 31 Dec 2010 17:31:52 GMT Server: Microsoft-IIS/6.0 X-Powered-By: ASP.NET Content-Length: 5341 Content-Type: text/html Cache-control: private
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">
The value of the Main request parameter is copied into the value of a tag attribute which can contain JavaScript. The payload javascript%3aalert(1)//2b162662 was submitted in the Main parameter. This input was echoed as javascript:alert(1)//2b162662 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 /MoaFrame.asp?hideBtn=1&Main=javascript%3aalert(1)//2b162662&ButHit=prod HTTP/1.1 Host: www.mutualofamerica.com Accept: */* Accept-Language: en User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0) Connection: close Cookie: ASPSESSIONIDAQCDQDDR=KJEHNODAIJKNJPNEMPHJBJDF;
Response
HTTP/1.1 200 OK Connection: close Date: Fri, 31 Dec 2010 17:33:04 GMT Server: Microsoft-IIS/6.0 X-Powered-By: ASP.NET Content-Length: 5353 Content-Type: text/html Cache-control: private
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">
The cookie appears to contain a session token, which may increase 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 / HTTP/1.1 Host: www.mutualofamerica.com Proxy-Connection: keep-alive Referer: http://www.google.com/search?sourceid=chrome&ie=UTF-8&q=Mutual+of+America X-Purpose: prefetch Accept: */* User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.10 (KHTML, like Gecko) Chrome/8.0.552.224 Safari/534.10 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 Date: Fri, 31 Dec 2010 17:28:38 GMT Server: Microsoft-IIS/6.0 X-Powered-By: ASP.NET Content-Length: 46911 Content-Type: text/html Expires: Fri, 31 Dec 2010 17:28:37 GMT Set-Cookie: ASPSESSIONIDAQCDQDDR=KJEHNODAIJKNJPNEMPHJBJDF; path=/ Cache-control: private
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html lang="en-US"> <head> <title>Mutual of America Life Insurance Company</title> <!--<meta http-equiv="Page-Enter" content="revealtrans(du ...[SNIP]...
3. Cross-domain Referer leakagepreviousnext There are 2 instances of this issue:
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.
The response contains the following links to other domains:
http://home.netscape.com/download/index.html
http://www.microsoft.com/ie/download/128bit.htm
Request
GET /MOAframe.asp?Main=Products/prod_main.asp&ButHit=prod HTTP/1.1 Host: www.mutualofamerica.com Accept: */* Accept-Language: en User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0) Connection: close Cookie: ASPSESSIONIDAQCDQDDR=KJEHNODAIJKNJPNEMPHJBJDF;
Response
HTTP/1.1 200 OK Connection: close Date: Fri, 31 Dec 2010 17:31:45 GMT Server: Microsoft-IIS/6.0 X-Powered-By: ASP.NET Content-Length: 5346 Content-Type: text/html Cache-control: private
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">
GET /home.asp?ButHit=home HTTP/1.1 Host: www.mutualofamerica.com Accept: */* Accept-Language: en User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0) Connection: close Cookie: ASPSESSIONIDAQCDQDDR=KJEHNODAIJKNJPNEMPHJBJDF;
Response
HTTP/1.1 200 OK Connection: close Date: Fri, 31 Dec 2010 17:31:37 GMT Server: Microsoft-IIS/6.0 X-Powered-By: ASP.NET Content-Length: 46923 Content-Type: text/html Expires: Fri, 31 Dec 2010 17:31:37 GMT Cache-control: private
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html lang="en-US"> <head> <title>Mutual of America Life Insurance Company</title> <!--<meta http-equiv="Page-Enter" content="revealtrans(du ...[SNIP]... <td colspan="2"><img border="0" name="IndexIMG" width="160" height="169" src="http://chart.bigcharts.com/custom/alliance/gifquote/alliance-fp-blue-2.img" vspace="0" hspace="0" align="TOP" alt="Market Chart"/></td> ...[SNIP]...
Directory listings do not necessarily constitute a security vulnerability. Any sensitive resources within your web root should be properly access-controlled in any case, and should not be accessible by an unauthorised party who happens to know the URL. Nevertheless, directory listings can aid an attacker by enabling them to quickly identify the resources at a given path, and proceed directly to analysing and attacking them.
Issue remediation
There is not usually any good reason to provide directory listings, and disabling them may place additional hurdles in the path of an attacker. This can normally be achieved in two ways:
Configure your web server to prevent directory listings for all paths beneath the web root;
Place into each directory a default file (such as index.htm) which the web server will display instead of returning a directory listing.
Request
GET /lbp/featured_articles/ HTTP/1.1 Host: www.mutualofamerica.com Proxy-Connection: keep-alive Referer: http://www.mutualofamerica.com/ Content-Type: application/x-www-form-urlencoded Accept: */* User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.10 (KHTML, like Gecko) Chrome/8.0.552.224 Safari/534.10 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: ASPSESSIONIDAQCDQDDR=KJEHNODAIJKNJPNEMPHJBJDF
Response
HTTP/1.1 200 OK Content-Length: 10291 Content-Type: text/html Server: Microsoft-IIS/6.0 X-Powered-By: ASP.NET Date: Fri, 31 Dec 2010 17:28:49 GMT
The file robots.txt is used to give instructions to web robots, such as search engine crawlers, about locations within the web site which robots are allowed, or not allowed, to crawl and index.
The presence of the robots.txt does not in itself present any kind of security vulnerability. However, it is often used to identify restricted or private areas of a site's contents. The information in the file may therefore help an attacker to map out the site's contents, especially if some of the locations identified are not linked from elsewhere in the site. If the application relies on robots.txt to protect access to these areas, and does not enforce proper access control over them, then this presents a serious vulnerability.
Issue remediation
The robots.txt file is not itself a security threat, and its correct use can represent good practice for non-security reasons. You should not assume that all web robots will honour the file's instructions. Rather, assume that attackers will pay close attention to any locations identified in the file. Do not rely on robots.txt to provide any kind of protection over unauthorised access.
Unless directed otherwise, browsers may store a local cached copy of content received from web servers. Some browsers, including Internet Explorer, cache content accessed via HTTPS. If sensitive information in application responses is stored in the local cache, then this may be retrieved by other users who have access to the same computer at a future time.
Issue remediation
The application should return caching directives instructing browsers not to store local copies of any sensitive data. Often, this can be achieved by configuring the web server to prevent caching for relevant paths within the web root. Alternatively, most web development platforms allow you to control the server's caching directives from within individual scripts. Ideally, the web server should return the following HTTP headers in all responses containing sensitive content:
GET /MoaFrame.asp?hideBtn=1&Main=https://www.mutualofamerica.com/products/info/inforequest.asp?code=main&ButHit=prod HTTP/1.1 Host: www.mutualofamerica.com Accept: */* Accept-Language: en User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0) Connection: close Cookie: ASPSESSIONIDAQCDQDDR=KJEHNODAIJKNJPNEMPHJBJDF;
Response
HTTP/1.1 200 OK Connection: close Date: Fri, 31 Dec 2010 17:32:36 GMT Server: Microsoft-IIS/6.0 X-Powered-By: ASP.NET Content-Length: 5395 Content-Type: text/html Cache-control: private
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">
<html>
<head> <title>Mutual of America</title> <meta name="GENERATOR" content="Microsoft ...[SNIP]...
GET /NavPage.asp?ButHit=prod HTTP/1.1 Host: www.mutualofamerica.com Connection: keep-alive Referer: https://www.mutualofamerica.com/MOAframe.asp?Main=javascript%3aalert(document.cookie)//770f415b&ButHit=prod 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.10 (KHTML, like Gecko) Chrome/8.0.552.224 Safari/534.10 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: ASPSESSIONIDAQCDQDDR=KJEHNODAIJKNJPNEMPHJBJDF
Response
HTTP/1.1 200 OK Date: Fri, 31 Dec 2010 17:34:12 GMT Server: Microsoft-IIS/6.0 X-Powered-By: ASP.NET Content-Length: 8666 Content-Type: text/html Cache-control: private
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> <html LANG="en-US"> <head> <title>Mutual of America Navigation page</title> <meta name=keywords content="Mutual of America,Insurance,Retirement Pla ...[SNIP]...
7. HTML does not specify charsetpreviousnext There are 2 instances of this issue:
If a web response states that it contains HTML content but does not specify a character set, then the browser may analyse the HTML and attempt to determine which character set it appears to be using. Even if the majority of the HTML actually employs a standard character set such as UTF-8, the presence of non-standard characters anywhere in the response may cause the browser to interpret the content using a different character set. This can have unexpected results, and can lead to cross-site scripting vulnerabilities in which non-standard encodings like UTF-7 can be used to bypass the application's defensive filters.
In most cases, the absence of a charset directive 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 HTML content, the application should include within the Content-type header a directive specifying a standard recognised character set, for example charset=ISO-8859-1.
GET /MOAframe.asp?Main=Products/prod_main.asp&ButHit=prod HTTP/1.1 Host: www.mutualofamerica.com Accept: */* Accept-Language: en User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0) Connection: close Cookie: ASPSESSIONIDAQCDQDDR=KJEHNODAIJKNJPNEMPHJBJDF;
Response
HTTP/1.1 200 OK Connection: close Date: Fri, 31 Dec 2010 17:31:45 GMT Server: Microsoft-IIS/6.0 X-Powered-By: ASP.NET Content-Length: 5346 Content-Type: text/html Cache-control: private
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">
<html>
<head> <title>Mutual of America</title> <meta name="GENERATOR" content="Microsoft ...[SNIP]...
GET /MoaFrame.asp?hideBtn=1&Main=https://www.mutualofamerica.com/products/info/inforequest.asp?code=main&ButHit=prod HTTP/1.1 Host: www.mutualofamerica.com Accept: */* Accept-Language: en User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0) Connection: close Cookie: ASPSESSIONIDAQCDQDDR=KJEHNODAIJKNJPNEMPHJBJDF;
Response
HTTP/1.1 200 OK Connection: close Date: Fri, 31 Dec 2010 17:32:36 GMT Server: Microsoft-IIS/6.0 X-Powered-By: ASP.NET Content-Length: 5395 Content-Type: text/html Cache-control: private
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">
<html>
<head> <title>Mutual of America</title> <meta name="GENERATOR" content="Microsoft ...[SNIP]...
The response contains the following Content-type statement:
Content-Type: image/jpeg
The response states that it contains a JPEG image. However, it actually appears to contain a GIF image.
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 /images/yrc_nav_calculator.jpg HTTP/1.1 Host: www.mutualofamerica.com Proxy-Connection: keep-alive Referer: http://www.mutualofamerica.com/ Accept: */* User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.10 (KHTML, like Gecko) Chrome/8.0.552.224 Safari/534.10 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: ASPSESSIONIDAQCDQDDR=KJEHNODAIJKNJPNEMPHJBJDF
Response
HTTP/1.1 200 OK Content-Length: 2237 Content-Type: image/jpeg Last-Modified: Tue, 10 Feb 2009 21:00:00 GMT Accept-Ranges: bytes ETag: "0c84989c28bc91:41b" Server: Microsoft-IIS/6.0 X-Powered-By: ASP.NET Date: Fri, 31 Dec 2010 17:28:45 GMT
The server presented a valid, trusted SSL certificate. This issue is purely informational.
The server presented the following certificates:
Server certificate
Issued to:
www.mutualofamerica.com
Issued by:
VeriSign Class 3 Secure Server CA - G2
Valid from:
Tue Nov 10 18:00:00 CST 2009
Valid to:
Wed Jan 04 17:59:59 CST 2012
Certificate chain #1
Issued to:
VeriSign Class 3 Secure Server CA - G2
Issued by:
VeriSign Trust Network
Valid from:
Tue Mar 24 19:00:00 CDT 2009
Valid to:
Sun Mar 24 18:59:59 CDT 2019
Certificate chain #2
Issued to:
VeriSign Trust Network
Issued by:
VeriSign Trust Network
Valid from:
Sun May 17 19:00:00 CDT 1998
Valid to:
Tue Aug 01 18:59:59 CDT 2028
Issue background
SSL helps to protect the confidentiality and integrity of information in transit between the browser and server, and to provide authentication of the server's identity. To serve this purpose, the server must present an SSL certificate which is valid for the server's hostname, is issued by a trusted authority and is valid for the current date. If any one of these requirements is not met, SSL connections to the server will not provide the full protection for which SSL is designed.
It should be noted that various attacks exist against SSL in general, and in the context of HTTPS web connections. It may be possible for a determined and suitably-positioned attacker to compromise SSL connections without user detection even when a valid SSL certificate is used.Report generated by XSS.CX at Fri Dec 31 12:12:40 CST 2010.