I completed the game, but I honestly don't know: why wouldn't inject a script tag directly in level 2 work?
As before, using <script> ... as a payload won't work
because the browser won't execute scripts added after the
page has loaded.
How do you solve level 3?This is the URL I used:
https://xss-game.appspot.com/level3/frame#'><script>alert('bla')</script>
But the hint is hinting at something more like this, I think: https://xss-game.appspot.com/level3/frame#' onerror="alert('bla')">
Can somebody explain why the first one worked? Are they wrong when they say that the browser won't execute scripts added after the page has loaded?the src opens with a single quote and looks for the 'num' var. So instead of num in the URL, you close the single quote and then close the image tag, and then run your script.
The real problem is the substring(1) function which passes the "num", instead of making sure the length is 1 it is allowing everything.