-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Issues with content filtering in local frames on iOS #40649
Comments
as an example of why this matters for a scriptlet, consider the following: a filter list has the rule However,
|
We will need to do this check for |
@ShivanKaul you should still check data, and make sure that parent frames can't access |
Verified on Ensured the following using the test plan mentioned in brave/brave-core#26622 (comment)
|
- 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).
Description
Brave iOS mishandles some aspects of content filtering in local frames (e.g., frames with the url
about:blank
, or otherwise inherit the security origin of the parent frame, w/o having that origin in the frame's URL)first-party
orthird-party
filtersThe root reason is that checks for the frame's origin are done using
window.location.href
, which will be something likeabout:blank
, even though the frame's code is running with access to cookies/etc for the parent frame.This is also a concern for scriptlets, which also aren't executed in iOS in local frames. This is a problem bc the parent frame can access the global object for the child local frame to re-obtain access to unmodified JS structures and prototypes (and so circumvent the scriptlets)
Steps to reproduce
The below is a general example of the vulnerability. The different issues discussed above can all be exploited through slightly different means.
This filter list rule should block all first-party image requests on
site.example
:site.example$first-party,img
However, if you run the following JS in a page hosted from
site.example
, the image request will not be blockedThe casue
Actual result
the image request to
//site.example/image.png
will not be blocked.Expected result
the image request to
//site.example/image.png
shoud be blocked.Reproduces how often
Easily reproduced
Brave version
all versions
Device/iOS version
all versions
Affected browser versions
Reproducibility
Miscellaneous information
Feel free to contact @pes10k with any questions about this. These vulnerabilities were the result of an ongoing research project between Brave an the University of California, San Diego
The text was updated successfully, but these errors were encountered: