This question is relating to the code window.location = window.location
as a method to refresh the page and is not concerned with redirections / other variables.
My understanding is as follows:
window.location = window.location
causes the page to refresh, as the browser will navigate to the same location the user is already on.
Any change to this variable via DOM manipulation will cause the page to reload/load the attackers page, thus these lines will not able to be executed with an altered value and so are not a candidates for cross site scripting attacks.
Is this correct?
Edit: What I'm really asking is if there is a way to change window.location
without causing a page reload, so that then when the window.location = window.location
call is made, the browser will be sent to another location.
window.location = window.location
and the page reloads... then the same will happen again... and you'll enter infinite loop. – Besomwindow.location.reload()
? – Boonewindow.location
without the attacker already having full control over your page – Boonewindow.location
until after the payload has executed. – Yoko