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

dom tame poc #29056

Draft
wants to merge 9 commits into
base: main
Choose a base branch
from
Draft

dom tame poc #29056

wants to merge 9 commits into from

Conversation

weizman
Copy link
Member

@weizman weizman commented Dec 10, 2024

works nicely, still needs to tame addEventListener (EventMessage.prototype window leaking props).
test by:

  • yarn dist
  • lookup document.createElement("div"); under the entire dist/chrome folder
  • pick the one within common-1.js (should have the string "50px" right after it)
  • paste the following code right after it
  • visit the extension with your devtools open
;(function test1(){ debugger;
    try {
        document.createElement('a').ownerDocument.location
    } catch (e) {
        e.message === 'NOT ALLOWED(document): location';
    }
    try {
        document.createElement('a').ownerDocument.open
    } catch (e) {
        e.message === 'NOT ALLOWED(document): open';
    }
    try {
        document.createElement('a').ownerDocument.defaultView.alert
    } catch (e) {
        e.message === 'NOT ALLOWED(window): alert';
    }
    try {
        document.createElement('a').ownerDocument.body.getRootNode() === document.createElement('a').ownerDocument
    } catch {}
    try {
        document.createElement('a').ownerDocument.body.parentNode.parentNode === document.createElement('a').ownerDocument
    } catch {}
}());

@metamaskbot metamaskbot added team-lavamoat INVALID-PR-TEMPLATE PR's body doesn't match template labels Dec 10, 2024
@weizman
Copy link
Member Author

weizman commented Dec 11, 2024

this works! fc178c0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
INVALID-PR-TEMPLATE PR's body doesn't match template team-lavamoat
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants