Reflected cross-site scripting vulnerabilities arise when data is copied from a request and echoed into the application's immediate response in an unsafe way. An attacker can use the vulnerability to construct a request which, if issued by another application user, will cause JavaScript code supplied by the attacker to execute within the user's browser in the context of that user's session with the application.
The attacker-supplied code can perform a wide variety of actions, such as stealing the victim's session token or login credentials, performing arbitrary actions on the victim's behalf, and logging their keystrokes.
Users can be induced to issue the attacker's crafted request in various ways. For example, the attacker can send a victim a link containing a malicious URL in an email or instant message. They can submit the link to popular web sites that allow content authoring, for example in blog comments. And they can create an innocuous looking web site which causes anyone viewing it to make arbitrary cross-domain requests to the vulnerable application (using either the GET or the POST method).
The security impact of cross-site scripting vulnerabilities is dependent upon the nature of the vulnerable application, the kinds of data and functionality which it contains, and the other applications which belong to the same domain and organisation. If the application is used only to display non-sensitive public content, with no authentication or access control functionality, then a cross-site scripting flaw may be considered low risk. However, if the same application resides on a domain which can access cookies for other more security-critical applications, then the vulnerability could be used to attack those other applications, and so may be considered high risk. Similarly, if the organisation which owns the application is a likely target for phishing attacks, then the vulnerability could be leveraged to lend credibility to such attacks, by injecting Trojan functionality into the vulnerable application, and exploiting users' trust in the organisation in order to capture credentials for other applications which it owns. In many kinds of application, such as those providing online banking functionality, cross-site scripting should always be considered high risk.
Remediation background
In most situations where user-controllable data is copied into application responses, cross-site scripting attacks can be prevented using two layers of defences:
Input should be validated as strictly as possible on arrival, given the kind of content which it is expected to contain. For example, personal names should consist of alphabetical and a small range of typographical characters, and be relatively short; a year of birth should consist of exactly four numerals; email addresses should match a well-defined regular expression. Input which fails the validation should be rejected, not sanitised.
User input should be HTML-encoded at any point where it is copied into application responses. All HTML metacharacters, including < > " ' and =, should be replaced with the corresponding HTML entities (< > etc).
In cases where the application's functionality allows users to author content using a restricted subset of HTML tags and attributes (for example, blog comments which allow limited formatting and linking), it is necessary to parse the supplied HTML to validate that it does not use any dangerous syntax; this is a non-trivial task.
The value of REST URL parameter 1 is copied into the HTML document as plain text between tags. The payload 40026%253cscript%253ealert%25281%2529%253c%252fscript%253e0fb22cab633 was submitted in the REST URL parameter 1. This input was echoed as 40026<script>alert(1)</script>0fb22cab633 in the application's response.
This proof-of-concept attack demonstrates that it is possible to inject arbitrary JavaScript into the application's response.
The application attempts to block certain characters that are often used in XSS attacks but this can be circumvented by double URL-encoding the required characters - for example, by submitting %253c instead of the < character.
Remediation detail
There is probably no need to perform a second URL-decode of the value of REST URL parameter 1 as the web server will have already carried out one decode. In any case, the application should perform its input validation after any custom canonicalisation has been carried out.
Request
GET /forgotpass40026%253cscript%253ealert%25281%2529%253c%252fscript%253e0fb22cab633 HTTP/1.1 Host: members.vpnreactor.com Connection: keep-alive Referer: https://members.vpnreactor.com/login 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: PHPSESSID=2257a02bbfd121b14e65693ee8eb926e
The value of REST URL parameter 1 is copied into the HTML document as plain text between tags. The payload f5968%253cscript%253ealert%25281%2529%253c%252fscript%253e01044907c04 was submitted in the REST URL parameter 1. This input was echoed as f5968<script>alert(1)</script>01044907c04 in the application's response.
This proof-of-concept attack demonstrates that it is possible to inject arbitrary JavaScript into the application's response.
The application attempts to block certain characters that are often used in XSS attacks but this can be circumvented by double URL-encoding the required characters - for example, by submitting %253c instead of the < character.
Remediation detail
There is probably no need to perform a second URL-decode of the value of REST URL parameter 1 as the web server will have already carried out one decode. In any case, the application should perform its input validation after any custom canonicalisation has been carried out.
Request
GET /loginf5968%253cscript%253ealert%25281%2529%253c%252fscript%253e01044907c04 HTTP/1.1 Host: members.vpnreactor.com Connection: keep-alive Referer: https://vpnreactor.com/support.aspx 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: PHPSESSID=2257a02bbfd121b14e65693ee8eb926e
The value of REST URL parameter 1 is copied into the HTML document as plain text between tags. The payload fe424%253cscript%253ealert%25281%2529%253c%252fscript%253ee94694082c9410774 was submitted in the REST URL parameter 1. This input was echoed as fe424<script>alert(1)</script>e94694082c9410774 in the application's response.
This proof-of-concept attack demonstrates that it is possible to inject arbitrary JavaScript into the application's response.
The application attempts to block certain characters that are often used in XSS attacks but this can be circumvented by double URL-encoding the required characters - for example, by submitting %253c instead of the < character.
The original request used the POST method, however it was possible to convert the request to use the GET method, to enable easier demonstration and delivery of the attack.
Remediation detail
There is probably no need to perform a second URL-decode of the value of REST URL parameter 1 as the web server will have already carried out one decode. In any case, the application should perform its input validation after any custom canonicalisation has been carried out.
Request
GET /signupfe424%253cscript%253ealert%25281%2529%253c%252fscript%253ee94694082c9410774?__EVENTTARGET=&__EVENTARGUMENT=&__VIEWSTATE=%2FwEPDwUKMTMzNTE2ODM2Ng9kFgICAQ9kFgICAQ8PFgIeBFRleHQFLllPVVIgSVAgQUREUkVTUyBJUyBOT1QgU0VDVVJFOiAxNzMuMTkzLjIxNC4yNDNkZBgBBR5fX0NvbnRyb2xzUmVxdWlyZVBvc3RCYWNrS2V5X18WBAUMSW1hZ2VCdXR0b24zBQxJbWFnZUJ1dHRvbjQFDEltYWdlQnV0dG9uMQUMSW1hZ2VCdXR0b24yCPkwZDN5ZDvKNJCchkTf12NA6z0%3D&__PREVIOUSPAGE=OOgPscQLgvLJLhIh-nevqQ2&__EVENTVALIDATION=%2FwEWCALG6qXeDwLM9PumDwKxovamDwLSwsGJCgLSwv2aBALSwpnTCALSwtXkAgLFpb%2BRA%2BkRJCvj4lNI0fFJXdGWInVElWRk&ImageButton4.x=84&ImageButton4.y=21 HTTP/1.1 Host: members.vpnreactor.com Connection: keep-alive Referer: https://vpnreactor.com/default.aspx Cache-Control: max-age=0 Origin: https://vpnreactor.com 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: PHPSESSID=2257a02bbfd121b14e65693ee8eb926e
Most browsers have a facility to remember user credentials that are entered into HTML forms. This function can be configured by the user and also by applications which employ user credentials. If the function is enabled, then credentials entered by the user are stored on their local computer and retrieved by the browser on future visits to the same application.
The stored credentials can be captured by an attacker who gains access to the computer, either locally or through some remote compromise. Further, methods have existed whereby a malicious web site can retrieve the stored credentials for other applications, by exploiting browser vulnerabilities or through application-level cross-domain attacks.
Issue remediation
To prevent browsers from storing credentials entered into HTML forms, you should include the attribute autocomplete="off" within the FORM tag (to protect all form fields) or within the relevant INPUT tags (to protect specific individual fields).
The TRACE method is designed for diagnostic purposes. If enabled, the web server will respond to requests which use the TRACE method by echoing in its response the exact request which was received.
Although this behaviour is apparently harmless in itself, it can sometimes be leveraged to support attacks against other application users. If an attacker can find a way of causing a user to make a TRACE request, and can retrieve the response to that request, then the attacker will be able to capture any sensitive data which is included in the request by the user's browser, for example session cookies or credentials for platform-level authentication. This may exacerbate the impact of other vulnerabilities, such as cross-site scripting.
Issue remediation
The TRACE method should be disabled on the web server.
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.
The server presented a valid, trusted SSL certificate. This issue is purely informational.
The server presented the following certificates:
Server certificate
Issued to:
members.vpnreactor.com
Issued by:
Go Daddy Secure Certification Authority
Valid from:
Mon Jul 12 19:57:51 CDT 2010
Valid to:
Fri Jul 12 19:57:51 CDT 2013
Certificate chain #1
Issued to:
Go Daddy Secure Certification Authority
Issued by:
Go Daddy Class 2 Certification Authority
Valid from:
Wed Nov 15 19:54:37 CST 2006
Valid to:
Sun Nov 15 19:54:37 CST 2026
Certificate chain #2
Issued to:
Go Daddy Class 2 Certification Authority
Issued by:
http://www.valicert.com/
Valid from:
Tue Jun 29 12:06:20 CDT 2004
Valid to:
Sat Jun 29 12:06:20 CDT 2024
Certificate chain #3
Issued to:
http://www.valicert.com/
Issued by:
http://www.valicert.com/
Valid from:
Fri Jun 25 19:19:54 CDT 1999
Valid to:
Tue Jun 25 19:19:54 CDT 2019
Certificate chain #4
Issued to:
http://www.valicert.com/
Issued by:
http://www.valicert.com/
Valid from:
Fri Jun 25 19:19:54 CDT 1999
Valid to:
Tue Jun 25 19:19:54 CDT 2019
Issue background
SSL helps to protect the confidentiality and integrity of information in transit between the browser and server, and to provide authentication of the server's identity. To serve this purpose, the server must present an SSL certificate which is valid for the server's hostname, is issued by a trusted authority and is valid for the current date. If any one of these requirements is not met, SSL connections to the server will not provide the full protection for which SSL is designed.
It should be noted that various attacks exist against SSL in general, and in the context of HTTPS web connections. It may be possible for a determined and suitably-positioned attacker to compromise SSL connections without user detection even when a valid SSL certificate is used.Report generated by XSS.CX at Wed Apr 06 07:27:50 CDT 2011.