Skip to content

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

Description

@t2ym

[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
            },
          },
        },
      },
    },

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions