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

TOCTOU bug. shadowRoot property modified _after_ node is added to the DOM tree. #11

Open
init-js opened this issue Aug 13, 2016 · 0 comments

Comments

@init-js
Copy link

init-js commented Aug 13, 2016

This is less important, given that shadowRoot is no longer a property in recent versions of Chrome.

The protections of the content script should still be put in place on objects and prototypes before the application has a chance to use them.

inputBox.parentNode.removeChild(inputBox);
inputBox = inputBox.cloneNode();
Object.defineProperty(inputBox, "shadowRoot", {configurable: false});
parentBox.appendChild(inputBox);

The page code above makes the shadowRoot property non configurable on the object before it is added to the DOM. The mutation observer in shadowcrypt (the one in charge of deleting that attribute) runs only after the element is added. Reconfiguration will fail.

Would be a good idea to make sure the properties modified have the expected flags before they are modified.

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

1 participant