Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(594)

Issue 265503002: Re-enable Object.observe and add enforcement for security invariants. (Closed)

Created:
6 years, 7 months ago by rafaelw
Modified:
6 years, 7 months ago
CC:
danno, adamk
Visibility:
Public.

Description

Re-enable Object.observe and add enforcement for security invariants. This patch reverts r21062 which disabled Object.observe and the relevant tests. It also adds enforcement for the following three invariants: 1) No observer may receive a change record describing changes to an object which is in different security origin (context have differing security tokens) 2) No observer may receive a change record whose context's security token is different from that of the object described by the change. 3) Object.getNotifier will return null if the caller and the provided object are in differing security origins Further, it ensures that the global object can never be observed nor a notifier retrieved for it. Tests are included. R=verwaest@chromium.org, rossberg LOG=Y Committed: https://code.google.com/p/v8/source/detail?r=21122

Patch Set 1 #

Patch Set 2 : cleanup #

Total comments: 22

Patch Set 3 : last #

Patch Set 4 : sync #

Patch Set 5 : sync #

Patch Set 6 : throw on Observe or getNotifier with global object #

Total comments: 1

Patch Set 7 : cr comment #

Unified diffs Side-by-side diffs Delta from patch set Stats (+262 lines, -374 lines) Patch
M src/api.cc View 1 chunk +1 line, -16 lines 0 comments Download
M src/messages.js View 1 2 3 4 5 1 chunk +1 line, -0 lines 0 comments Download
M src/object-observe.js View 1 2 3 4 5 6 7 chunks +16 lines, -20 lines 0 comments Download
M src/objects.h View 1 2 3 4 5 6 1 chunk +2 lines, -0 lines 0 comments Download
M src/objects.cc View 1 2 3 4 5 6 1 chunk +15 lines, -0 lines 0 comments Download
M src/runtime.h View 1 2 3 4 5 6 2 chunks +3 lines, -2 lines 0 comments Download
M src/runtime.cc View 1 2 3 4 5 6 2 chunks +31 lines, -25 lines 0 comments Download
M test/cctest/cctest.status View 1 2 3 4 5 6 1 chunk +0 lines, -4 lines 0 comments Download
M test/cctest/test-object-observe.cc View 1 2 3 4 5 6 chunks +181 lines, -295 lines 0 comments Download
M test/mjsunit/es7/object-observe.js View 1 2 3 4 5 6 chunks +12 lines, -4 lines 0 comments Download
M test/mjsunit/mjsunit.status View 1 chunk +0 lines, -8 lines 0 comments Download

Messages

Total messages: 9 (0 generated)
rafaelw
6 years, 7 months ago (2014-04-30 03:17:11 UTC) #1
dcarney
Seems reasonable to me, but I wonder if we care about the access_check bit at ...
6 years, 7 months ago (2014-04-30 07:16:36 UTC) #2
rossberg
https://codereview.chromium.org/265503002/diff/20001/src/object-observe.js File src/object-observe.js (right): https://codereview.chromium.org/265503002/diff/20001/src/object-observe.js#newcode442 src/object-observe.js:442: var needsAccessCheck = %IsAccessCheckNeeded(changeRecord.object); I believe you always need ...
6 years, 7 months ago (2014-04-30 11:28:32 UTC) #3
adamk
+abarth for web security
6 years, 7 months ago (2014-04-30 16:24:33 UTC) #4
rafaelw
So backing up a level here, the core concern here has to do with leaking ...
6 years, 7 months ago (2014-04-30 19:47:06 UTC) #5
rafaelw
All comments addressed except for concerns regarding splice and file re-org. As discussed with Toon ...
6 years, 7 months ago (2014-05-02 03:22:32 UTC) #6
Toon Verwaest
lgtm with nit https://codereview.chromium.org/265503002/diff/100001/src/objects.cc File src/objects.cc (right): https://codereview.chromium.org/265503002/diff/100001/src/objects.cc#newcode1966 src/objects.cc:1966: ASSERT(this->IsJSFunction()); This assert is done already ...
6 years, 7 months ago (2014-05-02 13:47:59 UTC) #7
rafaelw
Committed patchset #7 manually as r21122 (presubmit successful).
6 years, 7 months ago (2014-05-02 13:55:18 UTC) #8
rossberg
6 years, 7 months ago (2014-05-05 09:25:10 UTC) #9
Message was sent while issue was closed.
On 2014/05/02 03:22:32, rafaelw wrote:
> All comments addressed except for concerns regarding splice and file re-org.
As
> discussed with Toon & Andreas, non-security concerns can wait for follow-on
> patches.

In that follow-up CL, please also reorganise the various ObserverSecurity tests
into one loop that covers all possible combinations, as I suggested in my
comments.

Powered by Google App Engine
This is Rietveld 408576698