Skip to content
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

Merged
merged 1 commit into from
Sep 4, 2024

Conversation

weizman
Copy link
Member

@weizman weizman commented Apr 23, 2024

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

@weizman weizman linked an issue Jul 4, 2024 that may be closed by this pull request
@weizman weizman self-assigned this Jul 25, 2024
} 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 => {
Copy link
Member

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 ?

Copy link
Member Author

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.

Copy link
Member Author

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

@weizman weizman merged commit cebd9cb into main Sep 4, 2024
2 checks passed
@weizman weizman deleted the weizman/address-navigation-bypass branch September 4, 2024 12:33
@weizman weizman mentioned this pull request Sep 18, 2024
@masatokinugawa
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

LavaDome bypass via text fragments
3 participants