Cross-site Scripting (XSS)
- •
def
- •
a web application vulnerability that lets an attacker run their own script (commonly JavaScript) in the context of a trusted site, taking advantage of the trust a user has for that site
- •
- •
types
- •
non-persistent (reflected) XSS — a malicious script is embedded in a link (e.g., via a vulnerable search box); when the victim clicks it, the script runs in their browser as if it came from the legitimate server, stealing credentials/session IDs/cookies
- •
persistent (stored) XSS — the attacker posts a message containing the malicious payload to a public page (e.g., a social network); every viewer of that page then runs the payload too, letting it spread
- •
- •
example
- •
June 2017 — a researcher found an XSS vulnerability in Subaru's web front-end; a valid authentication token (which never expired) could be stolen via a malicious link, granting full access to someone else's connected car
- •
- •
- •