javascript - When are dynamic scripts executed? -
i doing google xss games (https://xss-game.appspot.com/level2), couldn't quite figure out why level 2 wasn't working way expecting. though hint says script tags won't work, didn't know why. question when dynamic script tags executed , vary browser?
i tried simple as:
<script>alert();</script>
and while adds element page, doesn't had hoped.
i found post has same problem, solution answer, not explanation: dynamically added script not execute
if site sanitizes script tags allows other html - opens xss. hint in level 2 text in message window having html formatting (italic, color etc.) assumption here - html tags allowed.
so can enter like
<i>hello xss</i>
into message window display text in italic. dom element can have event handler attached - can include executable javascript event handler without script tags.
try entering message window:
<i onmouseover="alert(1)">hello xss</i>
and after submitting message wave mouse on message text.
Comments
Post a Comment