The website or application is vulnerable to DOM-based cross-site-scripting (XSS). Cross-site scripting allows a malicious attacker to trick your web application into emitting the JavaScript or HTML code of his choice. This malicious code will appear to come from your web application when it runs in the browser of an unsuspecting user.
Whereas traditional XSS takes advantage of vulnerable back-end CGI scripts to directly emit the code into served pages, DOM-based XSS takes advantage of vulnerable JavaScript scripts which execute directly in the user's browser. For example, a the following vulnerable script can be used to launch an XSS attack:
var loc = document.location + '?gotoHomepage=1'; document.write('<a href="' + loc + '">Home</a>');
In this case, the JavaScript variable "document.location" is under the direct control of an attacker, but it is being written directly into the document content without escaping. An attacker could construct a URL containing <script> tags in it and trick an unsuspecting user into visiting the vulnerable website. A URL such as http://your_application/index.html?"><script>alert(document.cookie)</script> can be constructed that would cause the script above to write the attacker's malicious script tags directly into the user's document, where they will be executed.
An exploit script can be made to:
The two most common methods of attack are:
In both scenarios, the URL will generally link to the trusted site, but will contain additional data that is used to trigger the XSS attack.
Note that SSL connectivity does not protect against this issue.
With Rapid7 live dashboards, I have a clear view of all the assets on my network, which ones can be exploited, and what I need to do in order to reduce the risk in my environment in real-time. No other tool gives us that kind of value and insight.
– Scott Cheney, Manager of Information Security, Sierra View Medical Center