|
|
Blink bindings: use v8 to enforce method call access checks
Current, method calls on cross-origin interfaces perform manual access
checks in the generated bindings. However, v8 also has the capability
to perform the access check itself if the function template specifies
SetAcceptsAnyReceiver(false).
Using SetAcceptsAnyReceiver(false) has several advantages:
- Removes the need for the EventTarget performance hack, since the fast
path for same context access is simply a pointer comparison.
- Removes the need for the complicated binding template logic to
handle DOMWindow/LocalDOMWindow.
- Enforces access checks more consistently throughout the bindings
- Reduces the amount of generated bindings code
- Makes the access check failure more consistent for a detached window:
when a frame is removed from the DOM, v8 allows the access, while the
custom Blink method call access check denies it. This was a behavior
difference between accessors and methods, and now behaves the same
for both. Note that there are still some differences, which will be
resolved by a followup patch to base access checks off DOMWindow
instead of Frame.
The main disadvantage is that the thrown security error is less precise:
however, this is already a problem for every other cross-origin access.
The right solution is to resolve the longstanding TODO to plumb through
object/property information from v8 in the failed access check callback.
BUG=none
Review-Url: https://codereview.chromium.org/2713413002
Cr-Commit-Position: refs/heads/master@{#453397}
Committed: https://chromium.googlesource.com/chromium/src/+/4bf51e553baa31ca6b1ab7e45f8dffc9ca114641
Total comments: 11
Total comments: 1
|
Unified diffs |
Side-by-side diffs |
Delta from patch set |
Stats (+506 lines, -510 lines) |
Patch |
 |
M |
third_party/WebKit/LayoutTests/http/tests/fetch/chromium/discarded-window.html
|
View
|
1
2
3
|
1 chunk |
+20 lines, -12 lines |
1 comment
|
Download
|
 |
M |
third_party/WebKit/LayoutTests/http/tests/security/aboutBlank/xss-DENIED-set-opener-expected.txt
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
third_party/WebKit/LayoutTests/http/tests/security/cross-frame-access-call.html
|
View
|
1
|
1 chunk |
+27 lines, -27 lines |
0 comments
|
Download
|
 |
M |
third_party/WebKit/LayoutTests/http/tests/security/cross-frame-access-call-expected.txt
|
View
|
1
|
1 chunk |
+27 lines, -28 lines |
0 comments
|
Download
|
 |
M |
third_party/WebKit/LayoutTests/http/tests/security/cross-frame-access-dispatchEvent-expected.txt
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
third_party/WebKit/LayoutTests/http/tests/security/promise-realm.html
|
View
|
1
2
3
|
1 chunk |
+2 lines, -7 lines |
0 comments
|
Download
|
 |
M |
third_party/WebKit/Source/bindings/core/v8/V8DOMConfiguration.h
|
View
|
|
5 chunks |
+36 lines, -18 lines |
0 comments
|
Download
|
 |
M |
third_party/WebKit/Source/bindings/core/v8/V8DOMConfiguration.cpp
|
View
|
1
2
3
4
|
2 chunks |
+7 lines, -3 lines |
0 comments
|
Download
|
 |
M |
third_party/WebKit/Source/bindings/templates/interface_base.cpp.tmpl
|
View
|
1
2
3
4
5
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
third_party/WebKit/Source/bindings/templates/methods.cpp.tmpl
|
View
|
1
2
3
4
5
6
|
2 chunks |
+5 lines, -33 lines |
0 comments
|
Download
|
 |
M |
third_party/WebKit/Source/bindings/tests/results/core/V8TestCallbackFunctions.cpp
|
View
|
1
|
1 chunk |
+8 lines, -8 lines |
0 comments
|
Download
|
 |
M |
third_party/WebKit/Source/bindings/tests/results/core/V8TestException.cpp
|
View
|
1
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
third_party/WebKit/Source/bindings/tests/results/core/V8TestIntegerIndexed.cpp
|
View
|
1
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
third_party/WebKit/Source/bindings/tests/results/core/V8TestIntegerIndexedGlobal.cpp
|
View
|
1
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
third_party/WebKit/Source/bindings/tests/results/core/V8TestIntegerIndexedPrimaryGlobal.cpp
|
View
|
1
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
third_party/WebKit/Source/bindings/tests/results/core/V8TestInterface.cpp
|
View
|
1
|
5 chunks |
+51 lines, -51 lines |
0 comments
|
Download
|
 |
M |
third_party/WebKit/Source/bindings/tests/results/core/V8TestInterface2.cpp
|
View
|
1
|
2 chunks |
+15 lines, -15 lines |
0 comments
|
Download
|
 |
M |
third_party/WebKit/Source/bindings/tests/results/core/V8TestInterface3.cpp
|
View
|
1
|
1 chunk |
+2 lines, -2 lines |
0 comments
|
Download
|
 |
M |
third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceCheckSecurity.cpp
|
View
|
1
|
2 chunks |
+1 line, -6 lines |
0 comments
|
Download
|
 |
M |
third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceGarbageCollected.cpp
|
View
|
1
|
2 chunks |
+10 lines, -10 lines |
0 comments
|
Download
|
 |
M |
third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceNode.cpp
|
View
|
1
|
1 chunk |
+3 lines, -3 lines |
0 comments
|
Download
|
 |
M |
third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceOriginTrialEnabled.cpp
|
View
|
1
|
1 chunk |
+2 lines, -2 lines |
0 comments
|
Download
|
 |
M |
third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceSecureContext.cpp
|
View
|
1
|
2 chunks |
+6 lines, -6 lines |
0 comments
|
Download
|
 |
M |
third_party/WebKit/Source/bindings/tests/results/core/V8TestObject.cpp
|
View
|
1
3
4
5
|
3 chunks |
+238 lines, -238 lines |
0 comments
|
Download
|
 |
M |
third_party/WebKit/Source/bindings/tests/results/core/V8TestSpecialOperations.cpp
|
View
|
1
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
third_party/WebKit/Source/bindings/tests/results/core/V8TestTypedefs.cpp
|
View
|
1
|
1 chunk |
+8 lines, -8 lines |
0 comments
|
Download
|
 |
M |
third_party/WebKit/Source/bindings/tests/results/modules/V8TestInterface2Partial.cpp
|
View
|
1
|
2 chunks |
+2 lines, -2 lines |
0 comments
|
Download
|
 |
M |
third_party/WebKit/Source/bindings/tests/results/modules/V8TestInterface5.cpp
|
View
|
1
|
2 chunks |
+16 lines, -16 lines |
0 comments
|
Download
|
 |
M |
third_party/WebKit/Source/bindings/tests/results/modules/V8TestInterfacePartial.cpp
|
View
|
1
|
2 chunks |
+4 lines, -4 lines |
0 comments
|
Download
|
 |
M |
third_party/WebKit/Source/core/frame/DOMWindowTimers.cpp
|
View
|
1
2
3
|
1 chunk |
+2 lines, -0 lines |
0 comments
|
Download
|
 |
M |
third_party/WebKit/Source/modules/fetch/GlobalFetch.cpp
|
View
|
1
2
3
|
1 chunk |
+4 lines, -0 lines |
0 comments
|
Download
|
 |
M |
third_party/WebKit/Source/web/tests/WebFrameTest.cpp
|
View
|
1
2
3
4
5
|
1 chunk |
+2 lines, -3 lines |
0 comments
|
Download
|
Total messages: 30 (22 generated)
|