Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[demo][acl] ACL can be skipped by cloning global objects #210

Closed
t2ym opened this issue Jan 8, 2018 · 0 comments
Closed

[demo][acl] ACL can be skipped by cloning global objects #210

t2ym opened this issue Jan 8, 2018 · 0 comments

Comments

@t2ym
Copy link
Owner

t2ym commented Jan 8, 2018

[demo][acl] ACL can be skipped by cloning global objects

Root Cause

Assignment of a new global object cancels the ACL for the same object.

Example Reproducible Code

  window.HTMLElement2 = HTMLElement;
  HTMLElement2.prototype.click = null; // ACL for HTMLElement.prototype is bypassed
  Object.defineProperty(window, 'HTMLElement3', { value: HTMLElement });
  HTMLElement3.prototype.click = null; // ACL for HTMLElement.prototype is bypassed
  Object.defineProperty(window, 'HTMLElement4', { get: function () { return HTMLElement; } });
  HTMLElement4.prototype.click = null; // ACL for HTMLElement.prototype is bypassed
  window.__defineGetter__('HTMLElement5', function () { return HTMLElement; });
  HTMLElement5.prototype.click = null; // ACL for HTMLElement.prototype is bypassed
  Object.assign(window, { 'HTMLElement6': HTMLElement });
  HTMLElement6.prototype.click = null; // ACL for HTMLElement.prototype is bypassed
  Object.defineProperties(window, { 'HTMLElement7': { get: function () { return HTMLElement; } }       
  HTMLElement7.prototype.click = null; // ACL for HTMLElement.prototype is bypassed
  Object.defineProperties(window, { 'HTMLElement8': { value: HTMLElement } });
  HTMLElement8.prototype.click = null; // ACL for HTMLElement.prototype is bypassed

Possible Quick Fix

Add ACL to avoid cloning global objects with their own ACLs

Note:

ACL can be hardened to avoid such situations by applying multiple ACLs for the same object. More research required.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant