New issue
Advanced search Search tips

Issue 658194 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Jan 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 2
Type: Bug-Security



Sign in to add a comment

Security: Promise constructor can be used to bypass Function constructor restrictions

Project Member Reported by jochen@chromium.org, Oct 21 2016

Issue description

In  issue 656274 , pimvdb@live.nl provided the following work around for the security restrictions on the Function constructor:

  var parent_Promise = fetch.call(parent).constructor;
  var parent_Function = parent_Promise.constructor;
  new parent_Promise(function(resolve) {
    resolve();
  }).then(function() {
    var f = new parent_Function("document.body.style.backgroundColor = 'red';");
    f();
  });

fetch.call(parent) giving you a promise from the wrong realm is already fixed, however, if we have another bug where you can get hold of a promise from the wrong context, this work around would still apply, so we should fix it.

I consider adding a call to our access check to the promise constructor (Bultins::AllowDynamicFunction). Probably makes sense to add a fast-path for when the promise constructor's realm and the current realm are the same.
 
Labels: Pri-2

Comment 2 by adamk@chromium.org, Oct 21 2016

What's special about Promise here? Doesn't this apply to any object?

Comment 3 by jochen@chromium.org, Oct 21 2016

when we execute microtasks, we enter the context of the promise, but we lost the rest of the stack, so we can't check beyond the promise's context.

Labels: Security_Severity-Medium Security_Impact-Stable
Project Member

Comment 5 by sheriffbot@chromium.org, Oct 23 2016

Labels: M-55
Project Member

Comment 6 by sheriffbot@chromium.org, Oct 23 2016

Labels: -Pri-2 Pri-1

Comment 7 by adamk@chromium.org, Oct 24 2016

Are Promises the only problem here, or does this occur with other async callbacks from the browser?

Comment 8 by jochen@chromium.org, Oct 26 2016

e.g. setTimeout does an access check internally (as hopefully all others do as well): https://cs.chromium.org/chromium/src/out/Debug/gen/blink/bindings/core/v8/V8Window.cpp?rcl=1477451763&l=5877
Cc: gsat...@chromium.org
Labels: -Pri-1 -M-55 M-56 Pri-2
Project Member

Comment 10 by sheriffbot@chromium.org, Nov 16 2016

jochen: Uh oh! This issue still open and hasn't been updated in the last 14 days. This is a serious vulnerability, and we want to ensure that there's progress. Could you please leave an update with the current status and any potential blockers?

If you're not the right owner for this issue, could you please remove yourself as soon as possible or help us find the right one?

If the issue is fixed or you can't reproduce it, please close the bug. If you've started working on a fix, please set the status to Started.

Thanks for your time! To disable nags, add the Disable-Nags label.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Project Member

Comment 11 by sheriffbot@chromium.org, Nov 30 2016

jochen: Uh oh! This issue still open and hasn't been updated in the last 28 days. This is a serious vulnerability, and we want to ensure that there's progress. Could you please leave an update with the current status and any potential blockers?

If you're not the right owner for this issue, could you please remove yourself as soon as possible or help us find the right one?

If the issue is fixed or you can't reproduce it, please close the bug. If you've started working on a fix, please set the status to Started.

Thanks for your time! To disable nags, add the Disable-Nags label.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Anything more to be done here, or can we close this as Fixed?
Cc: bmeu...@chromium.org
we still need to implement the actual check
Labels: -M-56 M-57
Status: Fixed (was: Assigned)
Project Member

Comment 17 by sheriffbot@chromium.org, Jan 12 2017

Labels: -Restrict-View-SecurityTeam Restrict-View-SecurityNotify
Labels: Release-0-57
Labels: -Release-0-57 Release-0-M57
Project Member

Comment 20 by sheriffbot@chromium.org, Apr 21 2017

Labels: -Restrict-View-SecurityNotify allpublic
This bug has been closed for more than 14 weeks. Removing security view restrictions.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot

Sign in to add a comment