Glossary
What is XSS? (Cross-Site Scripting)
A type of attack in which an attacker plants a malicious script in a trusted web page so that it runs in other users' browsers.
XSS occurs when an application reflects user input onto a page without sanitizing it sufficiently. The malicious script runs in the victim’s browser as if the site were trusted; it can steal session information, change page content or redirect the user.
The main types are reflected XSS, stored XSS and XSS that originates from scripts in the browser. The core defense is encoding output appropriately for its context, validating input and using content security policies.
A WAF can provide additional protection by blocking requests that contain suspicious script patterns, but it does not replace fixing the code. XSS is considered within the injection family under the OWASP Top 10. For a similar risk on the server side, see SQL injection.