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

[vulnerability][demo][acl] No ACLs for iframe.contentWindow #238

Closed
t2ym opened this issue Apr 12, 2018 · 0 comments
Closed

[vulnerability][demo][acl] No ACLs for iframe.contentWindow #238

t2ym opened this issue Apr 12, 2018 · 0 comments

Comments

@t2ym
Copy link
Owner

t2ym commented Apr 12, 2018

[vulnerability][demo][acl] No ACLs for iframe.contentWindow

Root Cause

  • ACLs for global objects are not applied to iframe.contentWindow, which is a global object.

WARNING

    HTMLIFrameElement: {
      [S_CHAIN]: () => acl.HTMLElement,
      [S_PROTOTYPE]: {
        [S_CHAIN]: S_CHAIN,
        [S_INSTANCE]: {
          [S_CHAIN]: S_CHAIN,
          contentDocument: '---',
          contentWindow: '---',
        },
      },
    },

Fix

    HTMLIFrameElement: {
      [S_CHAIN]: () => acl.HTMLElement,
      [S_PROTOTYPE]: {
        [S_CHAIN]: S_CHAIN,
        [S_INSTANCE]: {
          [S_CHAIN]: S_CHAIN,
          contentWindow: {
            [S_DEFAULT]: '---',
            '@iframe_contentWindow_accessor': function _iframeContentWindowAcl(
                normalizedThisArg,
                normalizedArgs /* ['property', args], ['property', value], etc. */,
                aclArgs /* [name, isStatic, isObject, property, opType, context] */,
                hookArgs /* [f, thisArg, args, context, newTarget] */,
                applyAcl /* for recursive application of ACL */) {
              let opType = aclArgs[4];
              if (opType === 'r') {
                Policy.trackClass('window', normalizedThisArg[normalizedArgs[0]]);
              }
              return 'r--'[opTypeMap[opType]] === opType; // equivalent to 'r--' acl
            },
          },
        },
      },
    },
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant