-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Secure access to window origin on iOS #42539
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Fwiw, I expect window.origin is not the only place this is happening (JS inserted code is using page editable versions of WebAPIs) and so it might be good to expand the scope of this issue. I’m 99% sure I’ve used JS (not TS) static analysis tools too that can check for instances too. Happy to root around for them if it’d be helpful |
@pes10k I think it'd be good if you have any tools to run static analysis for this if we want to include more than just |
yeah, @Brandon-T fixed a lot of similar issues on iOS already, we now save original copies of such objects and access the frozen copies. Also we only care if by modifying a JS object the web page can somehow affect privacy/security of the browser/user. Most of the times though these edits only allow the page to attack itself, but there is not much we can do about. |
I believe most other WebAPIs we are using are already locked down by our firefox.js script. If other issues are found I think best we open a followup issue and not hold the window origin fix (given it's P2 priority). cc @stoletheminerals |
- Generic cosmetic filter list rules are not applied on some sites (brave/brave-browser#42471). - Local frames fix (brave/brave-browser#40649). - Use secure $.windowOrigin (brave/brave-browser#42539).
- Generic cosmetic filter list rules are not applied on some sites (brave/brave-browser#42471). - Local frames fix (brave/brave-browser#40649). - Use secure $.windowOrigin (brave/brave-browser#42539).
- Generic cosmetic filter list rules are not applied on some sites (brave/brave-browser#42471). - Local frames fix (brave/brave-browser#40649). - Use secure $.windowOrigin (brave/brave-browser#42539). - Fix pulse on some subreddits with Shields and Night Mode enabled on iOS (brave/brave-browser#43096)
- Generic cosmetic filter list rules are not applied on some sites (brave/brave-browser#42471). - Local frames fix (brave/brave-browser#40649). - Use secure $.windowOrigin (brave/brave-browser#42539). - Fix pulse on some subreddits with Shields and Night Mode enabled on iOS (brave/brave-browser#43096)
- Generic cosmetic filter list rules are not applied on some sites (brave/brave-browser#42471). - Local frames fix (brave/brave-browser#40649). - Use secure $.windowOrigin (brave/brave-browser#42539). - Fix pulse on some subreddits with Shields and Night Mode enabled on iOS (brave/brave-browser#43096)
- Generic cosmetic filter list rules are not applied on some sites (brave/brave-browser#42471). - Local frames fix (brave/brave-browser#40649). - Use secure $.windowOrigin (brave/brave-browser#42539). - Fix pulse on some subreddits with Shields and Night Mode enabled on iOS (brave/brave-browser#43096) - Improve cosmetic filtering performance on iOS (brave/brave-browser#42530)
- Generic cosmetic filter list rules are not applied on some sites (brave/brave-browser#42471). - Local frames fix (brave/brave-browser#40649). - Use secure $.windowOrigin (brave/brave-browser#42539). - Fix pulse on some subreddits with Shields and Night Mode enabled on iOS (brave/brave-browser#43096) - Improve cosmetic filtering performance on iOS (brave/brave-browser#42530)
* Use cosmetic filter script from core, share procedural filters. * Align content_cosmetic_ios.js with changes to SelectorsPollerScript.js: - Generic cosmetic filter list rules are not applied on some sites (brave/brave-browser#42471). - Local frames fix (brave/brave-browser#40649). - Use secure $.windowOrigin (brave/brave-browser#42539). - Fix pulse on some subreddits with Shields and Night Mode enabled on iOS (brave/brave-browser#43096) - Improve cosmetic filtering performance on iOS (brave/brave-browser#42530) * Fix unit tests by initializing BraveCore resource bundle for testing. * Update Selectors Poller script name references. --------- Co-authored-by: Stephen Heaps <[email protected]> Co-authored-by: Kyle Hickinson <[email protected]>
Description
window.origin
is marked readonly, but is replaceable. We should store a secured copy of thewindow.origin
so a site can't change thewindow.origin
to circumvent out scripts.Follow up to brave/brave-core#26622 (comment).
Steps to Reproduce
stephenheaps.github.io/$first-party
to the custom filtershttps://stephenheaps.github.io/local-frames/ad.txt
were blocked. At this pointhttps://stephenheaps.github.io/local-frames/ad.txt
is cached, so we need to use a different URLlocal-iframe
in the bottom right cornerfetch
wasn't blocked:The text was updated successfully, but these errors were encountered: