Last active
August 29, 2015 14:06
-
-
Save andresriancho/3e14b1a695fc80d49145 to your computer and use it in GitHub Desktop.
DOM-XSS for img.src
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
/* In old browsers this worked: <img src=javascript:alert(1)> , tried it for DOM-XSS | |
in the latest Chrome and it's not working. Any payload I can set to | |
"user_controlled_variable" to have javascript execution? | |
Reference for old browsers: https://html5sec.org/#63 | |
.mario mentioned that it is possible to DoS firefox by setting the img.src to "javascript:while(1){}";. | |
* Confirmed with latest Firefox | |
* alert() calls are not allowed | |
* Can't run other javascript code since it is a very restricted javascript sandbox. | |
*/ | |
... | |
el = document.createElement('img'); | |
el.src = user_controlled_variable; | |
... | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment