Cross-Site Scripting (XSS) is a security attack that allows a hacker to inject malicious code into a trusted website. The code usually runs as JavaScript in the visitor’s web browser.
If a website does not properly check user input, an attacker can use XSS to steal login details, hijack user sessions, display fake content or redirect visitors to malicious websites.
Although XSS is an attack rather than a legitimate technology, it is commonly seen in attacks against: