EXERCISE 1 — The root cause of XSS in "data vs code" terms ========================================================== THE ROOT CAUSE (data vs code): A web page is HTML -- a mix of MARKUP (code: tags, scripts, attributes the browser ACTS on) and TEXT (data: content meant only to be DISPLAYED). XSS occurs when untrusted input that should be treated as DATA (just shown to the user) is instead inserted into the page in a position where the browser treats it as CODE (parses and executes it). - The browser parses whatever bytes are in the HTML. It has no idea which characters came from the trusted developer and which from an attacker -- it just follows HTML rules. So if attacker text contains markup like EXECUTES: - The developer wrote a template like: