-
Notifications
You must be signed in to change notification settings - Fork 4
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
Address bypass by navigation to text-fragments links #38
Conversation
} from './native.mjs'; | ||
import {distraction, unselectable} from './element.mjs'; | ||
import {getShadow} from './shadow.mjs'; | ||
|
||
// text-fragments links can be abused to leak shadow internals - block in-app redirection to them | ||
navigation.addEventListener('navigate', event => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(could) maybe add an option to opt-out, starting with unsafe
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's very safe actually (taken from #38 (comment)):
An app should never have a legitimate reason to redirect to such a link within itself, so blocking in-app only attempts should correctly focus on attack attempts only.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I want to create software that's as less dependent on configuration as possible, meaning I'd support configuration only when it's truly necessary
The Navigation API used for this mitigation is not supported by Safari and Firefox, so this change seems to throw an error in both browsers. |
Context @ #35
The protection added is blocking redirection attempts to text-fragments based links that take place within the app itself.
Determining a link is text-fragments based is very straight forward according to the spec.
An app should never have a legitimate reason to redirect to such a link within itself, so blocking in-app only attempts should correctly focus on attack attempts only.
Based on text-fragments based links spec @ https://developer.mozilla.org/en-US/docs/Web/Text_fragments