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

Issue 1262353002: Add access checks to V8WrapperInstationScope. (Closed)

Created:
5 years, 4 months ago by epertoso
Modified:
4 years, 8 months ago
CC:
blink-reviews, blink-reviews-bindings_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

Add access checks to V8WrapperInstationScope. We skip those access checks when dealing with Location, as V8Location has its own checks in place according to the Location's cross-origin policy (https://html.spec.whatwg.org/multipage/browsers.html#security-location). BUG=455160 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=201908

Patch Set 1 #

Total comments: 7

Patch Set 2 : Update #

Patch Set 3 : Update #

Total comments: 2

Patch Set 4 : Update #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+30 lines, -8 lines) Patch
M Source/bindings/core/v8/V8DOMWrapper.h View 1 2 3 4 chunks +7 lines, -1 line 1 comment Download
M Source/bindings/core/v8/V8DOMWrapper.cpp View 1 2 3 3 chunks +17 lines, -1 line 0 comments Download
M Source/bindings/templates/interface.cpp View 1 2 3 1 chunk +2 lines, -2 lines 0 comments Download
M Source/bindings/tests/results/core/V8TestInterface.cpp View 1 2 3 1 chunk +2 lines, -2 lines 0 comments Download
M Source/bindings/tests/results/modules/V8TestInterface5.cpp View 1 2 3 1 chunk +2 lines, -2 lines 0 comments Download

Messages

Total messages: 30 (4 generated)
epertoso
5 years, 4 months ago (2015-07-30 10:22:03 UTC) #2
haraken
Add more explanations to the CL description. https://codereview.chromium.org/1262353002/diff/1/Source/bindings/core/v8/V8DOMWrapper.cpp File Source/bindings/core/v8/V8DOMWrapper.cpp (right): https://codereview.chromium.org/1262353002/diff/1/Source/bindings/core/v8/V8DOMWrapper.cpp#newcode76 Source/bindings/core/v8/V8DOMWrapper.cpp:76: bool withSecurityCheck ...
5 years, 4 months ago (2015-07-30 10:43:36 UTC) #4
Yuki
https://codereview.chromium.org/1262353002/diff/1/Source/bindings/core/v8/V8DOMWrapper.cpp File Source/bindings/core/v8/V8DOMWrapper.cpp (right): https://codereview.chromium.org/1262353002/diff/1/Source/bindings/core/v8/V8DOMWrapper.cpp#newcode76 Source/bindings/core/v8/V8DOMWrapper.cpp:76: bool withSecurityCheck = !type->equals(&V8Window::wrapperTypeInfo) && !type->equals(&V8Location::wrapperTypeInfo); On 2015/07/30 10:43:36, ...
5 years, 4 months ago (2015-07-30 11:00:54 UTC) #6
haraken
shiino-san: Do you have any suggestion about benchmarks we should try? https://codereview.chromium.org/1262353002/diff/1/Source/bindings/core/v8/V8DOMWrapper.cpp File Source/bindings/core/v8/V8DOMWrapper.cpp (right): ...
5 years, 4 months ago (2015-07-30 11:08:06 UTC) #7
epertoso
On 2015/07/30 at 11:08:06, haraken wrote: > shiino-san: Do you have any suggestion about benchmarks ...
5 years, 4 months ago (2015-07-30 12:10:35 UTC) #8
Yuki
> On 2015/07/30 at 11:08:06, haraken wrote: > > shiino-san: Do you have any suggestion ...
5 years, 4 months ago (2015-07-30 13:33:47 UTC) #9
haraken
On 2015/07/30 13:33:47, Yuki wrote: > > On 2015/07/30 at 11:08:06, haraken wrote: > > ...
5 years, 4 months ago (2015-07-30 13:36:51 UTC) #10
epertoso
On 2015/07/30 at 13:36:51, haraken wrote: > On 2015/07/30 13:33:47, Yuki wrote: > > > ...
5 years, 4 months ago (2015-08-04 08:13:17 UTC) #11
haraken
On 2015/08/04 08:13:17, epertoso wrote: > On 2015/07/30 at 13:36:51, haraken wrote: > > On ...
5 years, 4 months ago (2015-08-04 08:15:42 UTC) #12
epertoso
On 2015/08/04 at 08:15:42, haraken wrote: > On 2015/08/04 08:13:17, epertoso wrote: > > On ...
5 years, 4 months ago (2015-08-12 13:08:53 UTC) #13
jochen (gone - plz use gerrit)
i think that's an acceptable regression.
5 years, 4 months ago (2015-08-12 16:31:16 UTC) #14
haraken
On 2015/08/12 16:31:16, jochen (ooo) wrote: > i think that's an acceptable regression. That sounds ...
5 years, 4 months ago (2015-08-12 23:31:40 UTC) #15
epertoso
On 2015/08/12 at 23:31:40, haraken wrote: > On 2015/08/12 16:31:16, jochen (ooo) wrote: > > ...
5 years, 4 months ago (2015-08-20 10:54:41 UTC) #16
haraken
On 2015/08/20 10:54:41, epertoso wrote: > On 2015/08/12 at 23:31:40, haraken wrote: > > On ...
5 years, 4 months ago (2015-08-20 11:44:39 UTC) #17
epertoso
On 2015/08/20 at 11:44:39, haraken wrote: > On 2015/08/20 10:54:41, epertoso wrote: > > On ...
5 years, 3 months ago (2015-09-08 08:30:20 UTC) #18
haraken
On 2015/09/08 08:30:20, epertoso wrote: > On 2015/08/20 at 11:44:39, haraken wrote: > > On ...
5 years, 3 months ago (2015-09-08 08:48:07 UTC) #19
epertoso
https://codereview.chromium.org/1262353002/diff/40001/Source/bindings/core/v8/V8DOMWrapper.h File Source/bindings/core/v8/V8DOMWrapper.h (right): https://codereview.chromium.org/1262353002/diff/40001/Source/bindings/core/v8/V8DOMWrapper.h#newcode124 Source/bindings/core/v8/V8DOMWrapper.h:124: if (withSecurityCheck) { On 2015/09/08 at 08:48:07, haraken wrote: ...
5 years, 3 months ago (2015-09-08 09:29:36 UTC) #20
haraken
On 2015/09/08 09:29:36, epertoso wrote: > https://codereview.chromium.org/1262353002/diff/40001/Source/bindings/core/v8/V8DOMWrapper.h > File Source/bindings/core/v8/V8DOMWrapper.h (right): > > https://codereview.chromium.org/1262353002/diff/40001/Source/bindings/core/v8/V8DOMWrapper.h#newcode124 > ...
5 years, 3 months ago (2015-09-08 09:30:09 UTC) #21
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1262353002/60001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1262353002/60001
5 years, 3 months ago (2015-09-08 09:32:35 UTC) #23
commit-bot: I haz the power
Committed patchset #4 (id:60001) as https://src.chromium.org/viewvc/blink?view=rev&revision=201908
5 years, 3 months ago (2015-09-08 10:42:17 UTC) #24
haraken
https://codereview.chromium.org/1262353002/diff/60001/Source/bindings/core/v8/V8DOMWrapper.h File Source/bindings/core/v8/V8DOMWrapper.h (right): https://codereview.chromium.org/1262353002/diff/60001/Source/bindings/core/v8/V8DOMWrapper.h#newcode124 Source/bindings/core/v8/V8DOMWrapper.h:124: if (contextForWrapper == m_context) epertoso@ and jochen@: I'm getting ...
5 years ago (2015-12-22 07:17:51 UTC) #25
jochen (gone - plz use gerrit)
On 2015/12/22 at 07:17:51, haraken wrote: > https://codereview.chromium.org/1262353002/diff/60001/Source/bindings/core/v8/V8DOMWrapper.h > File Source/bindings/core/v8/V8DOMWrapper.h (right): > > https://codereview.chromium.org/1262353002/diff/60001/Source/bindings/core/v8/V8DOMWrapper.h#newcode124 ...
4 years, 11 months ago (2016-01-07 10:06:07 UTC) #26
haraken
On 2016/01/07 10:06:07, jochen wrote: > On 2015/12/22 at 07:17:51, haraken wrote: > > > ...
4 years, 11 months ago (2016-01-07 10:53:28 UTC) #27
haraken
(Updating the old thread just FYI...) On 2016/01/07 10:06:07, jochen wrote: > On 2015/12/22 at ...
4 years, 8 months ago (2016-04-20 07:22:35 UTC) #28
jochen (gone - plz use gerrit)
On 2016/04/20 at 07:22:35, haraken wrote: > (Updating the old thread just FYI...) > > ...
4 years, 8 months ago (2016-04-20 07:43:13 UTC) #29
haraken
4 years, 8 months ago (2016-04-20 07:45:41 UTC) #30
Message was sent while issue was closed.
On 2016/04/20 07:43:13, jochen wrote:
> On 2016/04/20 at 07:22:35, haraken wrote:
> > (Updating the old thread just FYI...)
> > 
> > On 2016/01/07 10:06:07, jochen wrote:
> > > On 2015/12/22 at 07:17:51, haraken wrote:
> > > >
> > >
>
https://codereview.chromium.org/1262353002/diff/60001/Source/bindings/core/v8...
> > > > File Source/bindings/core/v8/V8DOMWrapper.h (right):
> > > > 
> > > >
> > >
>
https://codereview.chromium.org/1262353002/diff/60001/Source/bindings/core/v8...
> > > > Source/bindings/core/v8/V8DOMWrapper.h:124: if (contextForWrapper ==
> > > m_context)
> > > > 
> > > > epertoso@ and jochen@: I'm getting a bit confused. In what scenario can
> > > info.Holder()->CreationContext() be different from
> isolate->GetCurrentContext()?
> > > > 
> > > > Imagine that you have a main frame and an iframe. Imagine that you
execute
> the
> > > following code in the main frame.
> > > > 
> > > > - If you call iframe.contentDocument, in the binding callback for
> > > contentDocument, which context do the isolate->GetCurrentContext and the
> > > info.Holder()->CreationContext return?
> > > > 
> > > > (My guess is that both return the iframe's context.)
> > > 
> > > current context will be the main frame, while creation context will be the
> > > iframe
> > > 
> > > > 
> > > > - If you call iframe.contentDocument.createElement(), in the binding
> callback
> > > for createElement(), which context do the isolate->GetCurrentContext and
the
> > > info.Holder()->CreationContext return?
> > > > 
> > > > (My guess is that both return the iframe's context.)
> > > 
> > > same as above
> > 
> > I noticed that our theory is not right.
> > 
> > When we call iframe.contentDocument, in the C++ callback for
contentDocument:
> > 
> > - info.Holder()->CreationContext points to the main frame's context.
> > - isolate->GetCurrentContext points to the main frame's context.
> > 
> > When we call iframe.contentDocument.createElement(), in the C++ callback for
> createElement:
> > 
> > - info.Holder()->CreationContext points to iframe's context.
> > - isolate->GetCurrentContext points to iframe's context.
> > 
> > This is because V8 updates the current context to
> info.Holder()->CreationContext before V8 calls back binding methods
>
(https://code.google.com/p/chromium/codesearch#chromium/src/v8/src/execution.c...).
> > 
> > So info.Holder()->CreationContext should be equal to
> isolate->GetCurrentContext at the point when V8 calls back binding methods. I
> don't know when these two point to different contexts when we create a new
> wrapper via V8WrapperInstantiationScope.
> 
> given that we still see crashes on document.all and performance.now I suspect
> that it's possible.
> 
> I know why we crash on document.all - it's implemented via an interceptor and
> the above reasoning doesn't hold. I don't know what goes wrong with
> performance.now

Trying to add a release-assert to understand when those two point to different
contexts: https://codereview.chromium.org/1901393002.

Powered by Google App Engine
This is Rietveld 408576698