|
|
|
|
|
by stonewareslord
1362 days ago
|
|
I don't think this article is complete. It mentions no pollution, which is true of window and most HTML elements, but not always. Check this out, you can set an img name to getElementById and now document.getElementById is the image element! Here's a minimal example (https://jsfiddle.net/wc5dn9x2/): <img id="asdf" name="getElementById" />
<script>
// The img object
console.log(document.getElementById);
// TypeError: document.getElementById is not a function :D
console.log(document.getElementById('asdf'));
</script>
I tried poking around for security vulnerabilities with this but couldn't find any :(It seems that the names overwrite properties on document with themselves only for these elements: embed form iframe img object Edit: Here's how I found this: https://jsfiddle.net/wc5dn9x2/1/ |
|