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

Issue 648423003: Enforce ScriptForbiddenScope and make it non-fatal. (Closed)

Created:
6 years, 2 months ago by dcheng
Modified:
6 years, 2 months ago
Reviewers:
haraken, esprehn, eseidel
CC:
arv+blink, blink-reviews, blink-reviews-bindings_chromium.org, blink-reviews-dom_chromium.org, dglazkov+blink, eae+blinkwatch, rwlbuis, sof, site-isolation-reviews_chromium.org, jochen (gone - plz use gerrit)
Project:
blink
Visibility:
Public.

Description

Enforce ScriptForbiddenScope for user scripts. ScriptForbiddenScope used to trigger a fatal assert if Blink tried to execute script in a forbidden scope. This was problematic because plugins often tried to run scripts inside these scopes. To prevent these crashes, AllowSuperUnsafeScripts was added as an opt out to allow plugin-triggered scripts to execute script anyway in these dangerous contexts. This lead to bugs like https://crbug.com/367210, where something that should be "impossible" wasn't. In order to prevent random code from having to work around edge cases that only happen when script shouldn't even be running, the entry points for executing user script have been updated to first check if scripting is forbidden. If it is, they just return undefined or an empty object as appropriate. A followup patch will attempt to apply a similar approach for handling internal scripts. BUG=363099, 371084 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=183650

Patch Set 1 #

Patch Set 2 : Getting ambitious #

Total comments: 2

Patch Set 3 : Make it stack allocated again #

Patch Set 4 : Trim superfluous includes #

Total comments: 6

Patch Set 5 : Consistify #

Unified diffs Side-by-side diffs Delta from patch set Stats (+10 lines, -32 lines) Patch
M Source/bindings/core/v8/NPV8Object.cpp View 1 3 chunks +0 lines, -6 lines 0 comments Download
M Source/bindings/core/v8/V8RecursionScope.h View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M Source/bindings/core/v8/V8ScriptRunner.cpp View 1 2 3 4 4 chunks +7 lines, -0 lines 0 comments Download
M Source/core/dom/Microtask.cpp View 1 2 2 chunks +2 lines, -1 line 0 comments Download
M Source/platform/ScriptForbiddenScope.h View 1 1 chunk +0 lines, -12 lines 0 comments Download
M Source/platform/ScriptForbiddenScope.cpp View 1 1 chunk +0 lines, -10 lines 0 comments Download
M Source/web/WebPluginContainerImpl.cpp View 1 1 chunk +0 lines, -2 lines 0 comments Download

Messages

Total messages: 16 (3 generated)
dcheng
This is inspired from the discussion at https://groups.google.com/a/chromium.org/forum/#!topic/site-isolation-dev/GFIl9QBbiL0 and the linked bugs. Originally, what I ...
6 years, 2 months ago (2014-10-13 22:56:35 UTC) #3
esprehn
This definitely can't be heap allocated. To unsubscribe from this group and stop receiving emails ...
6 years, 2 months ago (2014-10-13 23:53:29 UTC) #4
dcheng
I've made this stack allocated once more, and added checks to ScriptForbiddenScope::isScriptForbidden() before trying to ...
6 years, 2 months ago (2014-10-14 01:02:36 UTC) #5
haraken
> Finally--is there a performance concern from making V8RecursionScope heap-allocated? I don't have much concern ...
6 years, 2 months ago (2014-10-14 01:04:30 UTC) #6
haraken
On 2014/10/14 01:04:30, haraken wrote: > > Finally--is there a performance concern from making V8RecursionScope ...
6 years, 2 months ago (2014-10-14 01:06:39 UTC) #7
haraken
The patch set 4 looks good except that you need to take care of MicrotaskSuppression. ...
6 years, 2 months ago (2014-10-14 01:09:18 UTC) #8
dcheng
On 2014/10/14 at 01:09:18, haraken wrote: > The patch set 4 looks good except that ...
6 years, 2 months ago (2014-10-14 02:46:28 UTC) #9
haraken
On 2014/10/14 02:46:28, dcheng wrote: > On 2014/10/14 at 01:09:18, haraken wrote: > > The ...
6 years, 2 months ago (2014-10-14 05:06:00 UTC) #10
dcheng
OK, thank you for the explanation. I've updated the patch description to better reflect the ...
6 years, 2 months ago (2014-10-14 05:47:30 UTC) #11
haraken
LGTM It makes sense to address MicroTaskSuppression in a follow-up. https://codereview.chromium.org/648423003/diff/40002/Source/bindings/core/v8/V8ScriptRunner.cpp File Source/bindings/core/v8/V8ScriptRunner.cpp (right): https://codereview.chromium.org/648423003/diff/40002/Source/bindings/core/v8/V8ScriptRunner.cpp#newcode180 ...
6 years, 2 months ago (2014-10-14 05:55:30 UTC) #12
dcheng
https://codereview.chromium.org/648423003/diff/40002/Source/bindings/core/v8/V8ScriptRunner.cpp File Source/bindings/core/v8/V8ScriptRunner.cpp (right): https://codereview.chromium.org/648423003/diff/40002/Source/bindings/core/v8/V8ScriptRunner.cpp#newcode180 Source/bindings/core/v8/V8ScriptRunner.cpp:180: return v8::Undefined(isolate); On 2014/10/14 05:55:29, haraken wrote: > > ...
6 years, 2 months ago (2014-10-14 06:42:09 UTC) #13
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/648423003/230001
6 years, 2 months ago (2014-10-14 06:42:55 UTC) #15
commit-bot: I haz the power
6 years, 2 months ago (2014-10-14 07:51:16 UTC) #16
Message was sent while issue was closed.
Committed patchset #5 (id:230001) as 183650

Powered by Google App Engine
This is Rietveld 408576698