Cross-site scripting

The same-origin policy keeps one site's scripts away from another's data, so an attacker who gets a script into a trusted page runs with that page's full authority, and the defence is to encode output for where it lands, backed by a content security policy and HttpOnly cookies.

From Computer Networks and Security.