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

Issue 2706923002: Rework security checks to be based on Window rather than Frame. (Closed)

Created:
3 years, 10 months ago by dcheng
Modified:
3 years, 7 months ago
Reviewers:
haraken, Yuki
CC:
chromium-reviews, blink-reviews, dglazkov+blink, blink-reviews-html_chromium.org, blink-reviews-bindings_chromium.org, kinuko+watch, jochen (gone - plz use gerrit), adithyas
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Rework security checks to be based on Window rather than Frame. Previously, the security checks were based on the frame of the window, rather than the window itself. This is because Location had a pointer to the Frame, not the DOMWindow. However, this means that checks that could not distinguish between accesses on same-origin detached frames vs cross-origin detached frames, since a detached Window/Location has a nulled out Frame pointer. Now that Location is associated with a DOMWindow, the security checks should use DOMWindow. This allows the access checks to distinguish same origin and cross origin access on a detached window, correctly throwing an exception on detached cross-origin access. This also matches Firefox behavior. BUG=694111 Review-Url: https://codereview.chromium.org/2706923002 Cr-Commit-Position: refs/heads/master@{#472412} Committed: https://chromium.googlesource.com/chromium/src/+/1d357b6a46d70097aa28428b1f106284f7fd9990

Patch Set 1 #

Patch Set 2 : rebase #

Patch Set 3 : Rebase tests. #

Patch Set 4 : Fix tests #

Patch Set 5 : Ignore sessionStorage. #

Patch Set 6 : New test #

Patch Set 7 : rebaseline #

Patch Set 8 : Fix test typo #

Total comments: 22

Patch Set 9 : Address review comments. #

Total comments: 8

Patch Set 10 : host -> holder #

Patch Set 11 : rebase #

Patch Set 12 : Rebase across Blink rename #

Patch Set 13 : rebase #

Patch Set 14 : Meh #

Total comments: 2

Patch Set 15 : meh #

Total comments: 4

Patch Set 16 : Do not hardcode V8Window::wrapperTypeInfo #

Unified diffs Side-by-side diffs Delta from patch set Stats (+240 lines, -817 lines) Patch
M third_party/WebKit/LayoutTests/fast/dom/Window/orphaned-frame-access.html View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +28 lines, -26 lines 0 comments Download
D third_party/WebKit/LayoutTests/fast/dom/Window/orphaned-frame-access-expected.txt View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +5 lines, -11 lines 0 comments Download
M third_party/WebKit/LayoutTests/fast/dom/Window/property-access-on-cached-properties-after-frame-navigated.html View 1 2 3 chunks +3 lines, -5 lines 0 comments Download
M third_party/WebKit/LayoutTests/fast/dom/Window/property-access-on-cached-properties-after-frame-navigated-expected.txt View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 2 chunks +10 lines, -10 lines 0 comments Download
M third_party/WebKit/LayoutTests/fast/dom/Window/property-access-on-cached-properties-after-frame-removed.html View 1 2 1 chunk +0 lines, -3 lines 0 comments Download
M third_party/WebKit/LayoutTests/fast/dom/Window/property-access-on-cached-properties-after-frame-removed-and-gced.html View 1 2 1 chunk +0 lines, -3 lines 0 comments Download
M third_party/WebKit/LayoutTests/fast/dom/Window/property-access-on-cached-properties-after-frame-removed-and-gced-expected.txt View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 2 chunks +10 lines, -10 lines 0 comments Download
M third_party/WebKit/LayoutTests/fast/dom/Window/property-access-on-cached-properties-after-frame-removed-expected.txt View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 2 chunks +10 lines, -10 lines 0 comments Download
M third_party/WebKit/LayoutTests/fast/dom/Window/property-access-on-cached-window-after-frame-navigated.html View 1 2 2 chunks +2 lines, -1 line 0 comments Download
M third_party/WebKit/LayoutTests/fast/dom/Window/property-access-on-cached-window-after-frame-navigated-expected.txt View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/LayoutTests/fast/dom/Window/property-access-on-cached-window-after-frame-removed.html View 1 2 3 1 chunk +4 lines, -1 line 0 comments Download
M third_party/WebKit/LayoutTests/fast/dom/Window/property-access-on-cached-window-after-frame-removed-and-gced.html View 1 2 3 1 chunk +4 lines, -1 line 0 comments Download
M third_party/WebKit/LayoutTests/fast/dom/Window/property-access-on-cached-window-after-frame-removed-and-gced-expected.txt View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/LayoutTests/fast/dom/Window/property-access-on-cached-window-after-frame-removed-expected.txt View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/LayoutTests/fast/dom/Window/resources/window-property-collector.js View 1 2 3 4 5 6 7 1 chunk +4 lines, -1 line 0 comments Download
A third_party/WebKit/LayoutTests/http/tests/security/detached-window-cross-origin-access.html View 1 2 3 4 5 1 chunk +28 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/http/tests/security/detached-window-cross-origin-access-expected.txt View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +10 lines, -0 lines 0 comments Download
M third_party/WebKit/LayoutTests/platform/linux/fast/dom/Window/property-access-on-cached-properties-after-frame-navigated-expected.txt View 1 2 3 4 5 6 1 chunk +0 lines, -114 lines 0 comments Download
M third_party/WebKit/LayoutTests/platform/linux/fast/dom/Window/property-access-on-cached-properties-after-frame-removed-and-gced-expected.txt View 1 2 3 4 5 6 1 chunk +0 lines, -114 lines 0 comments Download
M third_party/WebKit/LayoutTests/platform/linux/fast/dom/Window/property-access-on-cached-properties-after-frame-removed-expected.txt View 1 2 3 4 5 6 1 chunk +0 lines, -114 lines 0 comments Download
D third_party/WebKit/LayoutTests/platform/linux/fast/dom/Window/property-access-on-cached-window-after-frame-navigated-expected.txt View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +0 lines, -237 lines 0 comments Download
M third_party/WebKit/Source/bindings/core/v8/BindingSecurity.h View 1 2 3 4 5 6 7 8 9 10 11 12 4 chunks +6 lines, -16 lines 0 comments Download
M third_party/WebKit/Source/bindings/core/v8/BindingSecurity.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 16 chunks +99 lines, -95 lines 0 comments Download
M third_party/WebKit/Source/bindings/core/v8/V8Initializer.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 3 chunks +3 lines, -28 lines 0 comments Download
M third_party/WebKit/Source/bindings/core/v8/custom/V8WindowCustom.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 2 chunks +3 lines, -8 lines 0 comments Download
M third_party/WebKit/Source/bindings/templates/interface_base.cpp.tmpl View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 2 chunks +4 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceCheckSecurity.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +4 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/frame/Location.h View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +0 lines, -2 lines 0 comments Download

Messages

Total messages: 71 (51 generated)
dcheng
Thoughts? The new layout test in this CL does not pass without this patch. It's ...
3 years, 9 months ago (2017-03-06 06:59:47 UTC) #21
Yuki
LGTM. https://codereview.chromium.org/2706923002/diff/140001/third_party/WebKit/Source/bindings/core/v8/BindingSecurity.cpp File third_party/WebKit/Source/bindings/core/v8/BindingSecurity.cpp (right): https://codereview.chromium.org/2706923002/diff/140001/third_party/WebKit/Source/bindings/core/v8/BindingSecurity.cpp#newcode51 third_party/WebKit/Source/bindings/core/v8/BindingSecurity.cpp:51: bool canAccessFrameInternal(const LocalDOMWindow* accessingWindow, Should we rename these ...
3 years, 9 months ago (2017-03-06 08:42:43 UTC) #24
haraken
This CL overall looks good. Would it be possible to split the CL into a ...
3 years, 9 months ago (2017-03-06 08:45:26 UTC) #25
dcheng
On 2017/03/06 08:45:26, haraken wrote: > This CL overall looks good. Would it be possible ...
3 years, 9 months ago (2017-03-06 08:56:30 UTC) #26
dcheng
https://codereview.chromium.org/2706923002/diff/140001/third_party/WebKit/Source/bindings/core/v8/BindingSecurity.cpp File third_party/WebKit/Source/bindings/core/v8/BindingSecurity.cpp (right): https://codereview.chromium.org/2706923002/diff/140001/third_party/WebKit/Source/bindings/core/v8/BindingSecurity.cpp#newcode51 third_party/WebKit/Source/bindings/core/v8/BindingSecurity.cpp:51: bool canAccessFrameInternal(const LocalDOMWindow* accessingWindow, On 2017/03/06 08:42:43, Yuki(slow_til_mar08) wrote: ...
3 years, 9 months ago (2017-03-07 05:48:10 UTC) #31
Yuki
LGTM.
3 years, 9 months ago (2017-03-07 05:56:23 UTC) #32
haraken
LGTM https://codereview.chromium.org/2706923002/diff/160001/third_party/WebKit/Source/bindings/core/v8/BindingSecurity.cpp File third_party/WebKit/Source/bindings/core/v8/BindingSecurity.cpp (right): https://codereview.chromium.org/2706923002/diff/160001/third_party/WebKit/Source/bindings/core/v8/BindingSecurity.cpp#newcode109 third_party/WebKit/Source/bindings/core/v8/BindingSecurity.cpp:109: if (V8Window::wrapperTypeInfo.equals(type)) Previously we were using findInstanceInPrototypeChain. Would ...
3 years, 9 months ago (2017-03-07 08:53:58 UTC) #33
dcheng
https://codereview.chromium.org/2706923002/diff/160001/third_party/WebKit/Source/bindings/core/v8/BindingSecurity.cpp File third_party/WebKit/Source/bindings/core/v8/BindingSecurity.cpp (right): https://codereview.chromium.org/2706923002/diff/160001/third_party/WebKit/Source/bindings/core/v8/BindingSecurity.cpp#newcode109 third_party/WebKit/Source/bindings/core/v8/BindingSecurity.cpp:109: if (V8Window::wrapperTypeInfo.equals(type)) On 2017/03/07 08:53:57, haraken wrote: > > ...
3 years, 9 months ago (2017-03-07 09:06:47 UTC) #34
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2706923002/180001
3 years, 9 months ago (2017-03-07 09:47:23 UTC) #37
dcheng
On 2017/03/07 10:02:28, dcheng wrote: > The CQ bit was unchecked by mailto:dcheng@chromium.org Actually I ...
3 years, 9 months ago (2017-03-07 10:04:19 UTC) #39
dcheng
FWIW, I rebased this across some of the platform bindings refactoring CLs. I'm going to ...
3 years, 7 months ago (2017-05-15 02:06:01 UTC) #48
dcheng
On 2017/05/15 02:06:01, dcheng (in AEST) wrote: > FWIW, I rebased this across some of ...
3 years, 7 months ago (2017-05-15 02:06:25 UTC) #49
dcheng
https://codereview.chromium.org/2706923002/diff/260001/third_party/WebKit/LayoutTests/fast/dom/Window/orphaned-frame-access-expected.txt File third_party/WebKit/LayoutTests/fast/dom/Window/orphaned-frame-access-expected.txt (right): https://codereview.chromium.org/2706923002/diff/260001/third_party/WebKit/LayoutTests/fast/dom/Window/orphaned-frame-access-expected.txt#newcode3 third_party/WebKit/LayoutTests/fast/dom/Window/orphaned-frame-access-expected.txt:3: FAIL Indexed property access on detached Window assert_equals: Indexed ...
3 years, 7 months ago (2017-05-15 06:15:32 UTC) #54
Yuki
https://codereview.chromium.org/2706923002/diff/260001/third_party/WebKit/LayoutTests/fast/dom/Window/orphaned-frame-access-expected.txt File third_party/WebKit/LayoutTests/fast/dom/Window/orphaned-frame-access-expected.txt (right): https://codereview.chromium.org/2706923002/diff/260001/third_party/WebKit/LayoutTests/fast/dom/Window/orphaned-frame-access-expected.txt#newcode3 third_party/WebKit/LayoutTests/fast/dom/Window/orphaned-frame-access-expected.txt:3: FAIL Indexed property access on detached Window assert_equals: Indexed ...
3 years, 7 months ago (2017-05-15 06:55:27 UTC) #55
dcheng
On 2017/05/15 06:55:27, Yuki wrote: > https://codereview.chromium.org/2706923002/diff/260001/third_party/WebKit/LayoutTests/fast/dom/Window/orphaned-frame-access-expected.txt > File > third_party/WebKit/LayoutTests/fast/dom/Window/orphaned-frame-access-expected.txt > (right): > > ...
3 years, 7 months ago (2017-05-15 07:08:19 UTC) #56
dcheng
PTAL, I reverted the web-visible changes for now. Diff PS14 and PS15. I tested to ...
3 years, 7 months ago (2017-05-17 05:36:02 UTC) #57
Yuki
LGTM. https://codereview.chromium.org/2706923002/diff/280001/third_party/WebKit/Source/bindings/core/v8/custom/V8WindowCustom.cpp File third_party/WebKit/Source/bindings/core/v8/custom/V8WindowCustom.cpp (right): https://codereview.chromium.org/2706923002/diff/280001/third_party/WebKit/Source/bindings/core/v8/custom/V8WindowCustom.cpp#newcode162 third_party/WebKit/Source/bindings/core/v8/custom/V8WindowCustom.cpp:162: if (!impl->GetFrame()) Do you want the same comment ...
3 years, 7 months ago (2017-05-17 06:31:26 UTC) #60
dcheng
https://codereview.chromium.org/2706923002/diff/280001/third_party/WebKit/Source/bindings/core/v8/custom/V8WindowCustom.cpp File third_party/WebKit/Source/bindings/core/v8/custom/V8WindowCustom.cpp (right): https://codereview.chromium.org/2706923002/diff/280001/third_party/WebKit/Source/bindings/core/v8/custom/V8WindowCustom.cpp#newcode162 third_party/WebKit/Source/bindings/core/v8/custom/V8WindowCustom.cpp:162: if (!impl->GetFrame()) On 2017/05/17 06:31:25, Yuki wrote: > Do ...
3 years, 7 months ago (2017-05-17 07:13:24 UTC) #61
commit-bot: I haz the power
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2706923002/300001
3 years, 7 months ago (2017-05-17 09:38:18 UTC) #68
commit-bot: I haz the power
3 years, 7 months ago (2017-05-17 10:46:38 UTC) #71
Message was sent while issue was closed.
Committed patchset #16 (id:300001) as
https://chromium.googlesource.com/chromium/src/+/1d357b6a46d70097aa28428b1f10...

Powered by Google App Engine
This is Rietveld 408576698