This article is a part of our Web Security Knowledge Base (back to index)
Why “Cross Site Scripting (Reflected)” can be dangerous
Cross site scripting is an attack where a web page executes code that is injected by an adversary. It usually appears, when users input is presented. This attack can be used to impersonate a user, take over control of the session, or even steal API keys.
The attack can be executed e.g. when you application injects the request parameter directly into the HTML code of the page returned to the user:
what results in:
<span>Confirmation: Transaction Complete</span>
and it will be executed locally by the user's browser with full access to the user's personal application/browser data:
How to fix “Cross Site Scripting (Reflected)”
To avoid XSS attacks, ensure that user inputs are escaped and validated. Note that client-side check could be bypassed. Consider using Content Security Policy and HttpOnly cookies. If using CMS use one with an automatic encoding option. Be careful when writing JS scripts, eval and Function could be potential attack vector, if data is not escaped/validated. Avoid redirects under user control.
How does ScanRepeat report “Cross Site Scripting (Reflected)”
ScanRepeat verifies if this is feasible to insert client side script.
Would you like to test your application now against this problem? Sign up for our free trialScan Your Web App Now