cross-site scripting

An attack in which someone gets their own script to run inside your page, where it can read data, act as the user or steal tokens.

Script running in your origin can do anything the logged-in user can do.

In more detail

XSS stands for cross-site scripting. It happens when untrusted input is inserted into a page as code, for example through innerHTML or an unescaped template. Defences include textContent, output encoding, Content Security Policy and Trusted Types.

Example

In the course a search term <script>steal()</script> is reflected unescaped into the page.

Related terms

Taught in

References

Certification courses