Implement is-cross-origin internally so it doesn't throw#111
Merged
Conversation
Member
weizman
commented
Jun 23, 2023
- is-cross-origin throws if received object isn't a window
- this apparently is possible (dom clobbering with indexes 😱)
- no reason for it to throw, just continue to next window in frames array
- in fact, no reason for this to be an external package at all, implement internally instead
- making Snow a deps-free project 🎉
Member
Author
|
This allowed Snow bypass: (function(){
const ifr = document.createElement('iframe');
const ifr2 = document.createElement('iframe');
document.body.appendChild(ifr);
const div = document.createElement('div');
div.id='0';
setTimeout(() => { ifr2.contentWindow.alert.call(top,1); }, 500);
try { ifr.contentWindow.document.body.appendChild(div); } catch {}
document.body.appendChild(ifr2);
}()); |
Member
Author
|
Update, #111 was not strong enough, the |
Merged
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.