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

Issue 1085973003: Make error messages for cross-domain access OOPIF-friendly. (Closed)

Created:
5 years, 8 months ago by alexmos
Modified:
5 years, 8 months ago
Reviewers:
haraken, Nate Chapin, dcheng
CC:
arv+blink, blink-reviews, blink-reviews-bindings_chromium.org, site-isolation-reviews_chromium.org, vivekg_samsung, vivekg
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Target Ref:
refs/heads/master
Project:
blink
Visibility:
Public.

Description

Make error messages for cross-domain access OOPIF-friendly. * Make crossDomainAccessErrorMessage and sanitizedCrossDomainAccessErrorMessage non-virtual members of DOMWindow, and tweak the logic to also work on RemoteDOMWindows using replicated origins. * Change BindingSecurity::shouldAllowAccessToFrame to actually throw exceptions when encountering a RemoteFrame. Previously, we returned false without throwing exceptions, which was breaking expectations for layout tests when running with --site-per-process. BUG=478254, 477150 TEST=Run http/tests/security/cross-frame-access-set-window-properties.html with --site-per-process, and ensure the calls that are supposed to throw exceptions actually do so. Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=194331

Patch Set 1 #

Total comments: 5

Patch Set 2 : #

Total comments: 6

Patch Set 3 : canAccessDocument -> canAccessFrame, convert printErrorMessage to use callingWindow. #

Patch Set 4 : Make things work when shouldAllowAccessToNode passes a Document with a null frame() #

Patch Set 5 : Undo accidental change #

Patch Set 6 : Fix compile #

Patch Set 7 : Rebase #

Patch Set 8 : Rebase (pull in CL to print errors on calling window) #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+97 lines, -130 lines) Patch
M Source/bindings/core/v8/BindingSecurity.cpp View 1 2 3 4 5 6 7 1 chunk +15 lines, -25 lines 4 comments Download
M Source/core/frame/DOMWindow.h View 1 chunk +3 lines, -5 lines 0 comments Download
M Source/core/frame/DOMWindow.cpp View 1 2 3 4 5 6 7 3 chunks +75 lines, -1 line 0 comments Download
M Source/core/frame/LocalDOMWindow.h View 2 chunks +0 lines, -4 lines 0 comments Download
M Source/core/frame/LocalDOMWindow.cpp View 1 2 3 4 5 6 7 1 chunk +0 lines, -78 lines 0 comments Download
M Source/core/frame/LocalFrame.cpp View 1 2 3 4 5 6 7 1 chunk +4 lines, -5 lines 0 comments Download
M Source/core/frame/RemoteDOMWindow.h View 1 chunk +0 lines, -2 lines 0 comments Download
M Source/core/frame/RemoteDOMWindow.cpp View 1 chunk +0 lines, -10 lines 0 comments Download

Messages

Total messages: 21 (3 generated)
alexmos
Daniel, what do you think about this? I discovered we weren't throwing exceptions when trying ...
5 years, 8 months ago (2015-04-15 17:15:17 UTC) #2
dcheng
+haraken as the general bindings reviewer, +japhet for more insight on isInsecureScriptAccess https://codereview.chromium.org/1085973003/diff/1/Source/bindings/core/v8/BindingSecurity.cpp File Source/bindings/core/v8/BindingSecurity.cpp ...
5 years, 8 months ago (2015-04-15 21:03:49 UTC) #4
haraken
https://codereview.chromium.org/1085973003/diff/20001/Source/bindings/core/v8/BindingSecurity.cpp File Source/bindings/core/v8/BindingSecurity.cpp (right): https://codereview.chromium.org/1085973003/diff/20001/Source/bindings/core/v8/BindingSecurity.cpp#newcode96 Source/bindings/core/v8/BindingSecurity.cpp:96: if (target->isRemoteFrame() && target->domWindow()) { Shouldn't this be something ...
5 years, 8 months ago (2015-04-16 03:41:19 UTC) #5
alexmos
Please take another look. I've turned canAccessDocument into canAccessFrame to make things more uniform. I ...
5 years, 8 months ago (2015-04-17 16:49:06 UTC) #6
haraken
> I also changed the cross-domain access error messages to be printed on the > ...
5 years, 8 months ago (2015-04-18 23:41:54 UTC) #7
alexmos
> Yeah, using a calling window makes a lot of more sense. Can we make ...
5 years, 8 months ago (2015-04-20 23:39:55 UTC) #8
alexmos
On 2015/04/20 23:39:55, alexmos wrote: > > Yeah, using a calling window makes a lot ...
5 years, 8 months ago (2015-04-22 19:55:50 UTC) #9
haraken
On 2015/04/22 19:55:50, alexmos wrote: > On 2015/04/20 23:39:55, alexmos wrote: > > > Yeah, ...
5 years, 8 months ago (2015-04-23 04:35:56 UTC) #10
alexmos
> bindings/ looks good. Can we add a test? Is there something in particular for ...
5 years, 8 months ago (2015-04-23 06:49:41 UTC) #11
haraken
On 2015/04/23 06:49:41, alexmos wrote: > > bindings/ looks good. Can we add a test? ...
5 years, 8 months ago (2015-04-23 07:38:10 UTC) #12
alexmos
Thanks! dcheng@: could you please take a look at the Source/core stuff?
5 years, 8 months ago (2015-04-23 17:04:26 UTC) #13
dcheng
https://codereview.chromium.org/1085973003/diff/140001/Source/bindings/core/v8/BindingSecurity.cpp File Source/bindings/core/v8/BindingSecurity.cpp (right): https://codereview.chromium.org/1085973003/diff/140001/Source/bindings/core/v8/BindingSecurity.cpp#newcode87 Source/bindings/core/v8/BindingSecurity.cpp:87: return target && canAccessFrame(isolate, target->document().securityOrigin(), target->document().domWindow(), exceptionState); Would it ...
5 years, 8 months ago (2015-04-23 17:39:58 UTC) #14
alexmos
https://codereview.chromium.org/1085973003/diff/140001/Source/bindings/core/v8/BindingSecurity.cpp File Source/bindings/core/v8/BindingSecurity.cpp (right): https://codereview.chromium.org/1085973003/diff/140001/Source/bindings/core/v8/BindingSecurity.cpp#newcode87 Source/bindings/core/v8/BindingSecurity.cpp:87: return target && canAccessFrame(isolate, target->document().securityOrigin(), target->document().domWindow(), exceptionState); On 2015/04/23 ...
5 years, 8 months ago (2015-04-23 17:45:28 UTC) #15
dcheng
https://codereview.chromium.org/1085973003/diff/140001/Source/bindings/core/v8/BindingSecurity.cpp File Source/bindings/core/v8/BindingSecurity.cpp (right): https://codereview.chromium.org/1085973003/diff/140001/Source/bindings/core/v8/BindingSecurity.cpp#newcode87 Source/bindings/core/v8/BindingSecurity.cpp:87: return target && canAccessFrame(isolate, target->document().securityOrigin(), target->document().domWindow(), exceptionState); On 2015/04/23 ...
5 years, 8 months ago (2015-04-23 18:01:25 UTC) #16
alexmos
https://codereview.chromium.org/1085973003/diff/140001/Source/bindings/core/v8/BindingSecurity.cpp File Source/bindings/core/v8/BindingSecurity.cpp (right): https://codereview.chromium.org/1085973003/diff/140001/Source/bindings/core/v8/BindingSecurity.cpp#newcode87 Source/bindings/core/v8/BindingSecurity.cpp:87: return target && canAccessFrame(isolate, target->document().securityOrigin(), target->document().domWindow(), exceptionState); On 2015/04/23 ...
5 years, 8 months ago (2015-04-23 21:25:23 UTC) #17
dcheng
lgtm I think it'd be nice to figure out if we can converge the behavior ...
5 years, 8 months ago (2015-04-23 21:41:21 UTC) #18
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1085973003/140001
5 years, 8 months ago (2015-04-23 21:55:42 UTC) #20
commit-bot: I haz the power
5 years, 8 months ago (2015-04-23 23:29:47 UTC) #21
Message was sent while issue was closed.
Committed patchset #8 (id:140001) as
https://src.chromium.org/viewvc/blink?view=rev&revision=194331

Powered by Google App Engine
This is Rietveld 408576698