docs.rodeo

MDN Web Docs mirror

Cross-site scripting (XSS)

{{GlossarySidebar}} 

A cross-site scripting (XSS) attack is one in which an attacker is able to get a target site to execute malicious code as though it was part of the website. The code can then do anything that the site’s own code can do. For example, the attacker could:

All XSS attacks depend on a website doing two things:

  1. Accepting some input that could have been crafted by an attacker
  2. Including this input in a page without sanitizing it: that is, without ensuring that it won’t be executable as JavaScript

See also

In this article

View on MDN