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

Issue 1383483007: Add scheme exceptions for isSecureContext (Closed)

Created:
5 years, 2 months ago by jww
Modified:
5 years, 2 months ago
CC:
blink-reviews, blink-reviews-api_chromium.org, blink-reviews-dom_chromium.org, chromium-reviews, dglazkov+blink, eae+blinkwatch, rwlbuis, sof
Base URL:
https://chromium.googlesource.com/chromium/src@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Add scheme exceptions for isSecureContext The Privileged Context spec lists an algorithm for whether a powerful feature should be allowed in a given context. This check verifies that the full check from the document that makes the request through all the parent embedders are secure origins. However, we need to provide an exception to this algorithm for extensions, which should be allowed to bypass the Web security model. This CL adds support for a whitelist of schemes (currently just chrome-extension:) that should be allowed to access powerful features, even if the full chain of embedders is not all secure. This extensions the Document::isSecureContext() method to check this whitelist to see if the current origin should bypass. BUG=530507 Committed: https://crrev.com/23d6c8471b207d00a8cf65336067a0891c9a936a Cr-Commit-Position: refs/heads/master@{#354650}

Patch Set 1 #

Total comments: 5

Patch Set 2 : Update check for sandbox #

Total comments: 8

Patch Set 3 : Add browser test #

Patch Set 4 : Nits and fixes #

Total comments: 18

Patch Set 5 : Fixes #

Total comments: 32

Patch Set 6 : Fix Rob and Devlin comments #

Total comments: 2

Patch Set 7 : Rebase on ToT #

Patch Set 8 : Address latest comments #

Total comments: 2

Patch Set 9 : Simplify LoadExtension call #

Total comments: 2

Patch Set 10 : Update comment #

Unified diffs Side-by-side diffs Delta from patch set Stats (+274 lines, -12 lines) Patch
A chrome/browser/extensions/api/webrtc_from_web_accessible_resource_browsertest.cc View 1 2 3 4 5 6 7 8 1 chunk +128 lines, -0 lines 0 comments Download
M chrome/chrome_tests.gypi View 1 2 3 4 5 6 1 chunk +1 line, -0 lines 0 comments Download
M chrome/common/secure_origin_whitelist.h View 1 2 3 4 5 6 7 8 9 1 chunk +9 lines, -3 lines 0 comments Download
M chrome/common/secure_origin_whitelist.cc View 2 chunks +6 lines, -0 lines 0 comments Download
M chrome/renderer/chrome_content_renderer_client.cc View 1 2 3 4 5 6 1 chunk +7 lines, -0 lines 0 comments Download
A chrome/test/data/extensions/api_test/webrtc_from_web_accessible_resource/content_script.js View 1 2 3 4 5 1 chunk +8 lines, -0 lines 0 comments Download
A chrome/test/data/extensions/api_test/webrtc_from_web_accessible_resource/iframe.js View 1 2 3 4 5 1 chunk +17 lines, -0 lines 0 comments Download
A chrome/test/data/extensions/api_test/webrtc_from_web_accessible_resource/iframe_content.html View 1 2 3 4 5 1 chunk +3 lines, -0 lines 0 comments Download
A + chrome/test/data/extensions/api_test/webrtc_from_web_accessible_resource/manifest.json View 1 2 3 4 5 6 7 1 chunk +7 lines, -8 lines 0 comments Download
M third_party/WebKit/Source/core/dom/Document.cpp View 1 2 3 4 5 6 7 1 chunk +34 lines, -1 line 0 comments Download
M third_party/WebKit/Source/platform/weborigin/SchemeRegistry.h View 1 2 3 4 1 chunk +5 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/platform/weborigin/SchemeRegistry.cpp View 1 2 3 2 chunks +21 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/platform/weborigin/SchemeRegistryTest.cpp View 1 2 3 4 1 chunk +20 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/web/WebSecurityPolicy.cpp View 1 2 3 1 chunk +5 lines, -0 lines 0 comments Download
M third_party/WebKit/public/web/WebSecurityPolicy.h View 1 chunk +3 lines, -0 lines 0 comments Download

Messages

Total messages: 34 (4 generated)
jww
Hi Rob. Can you verify that this meets your expectations? Devlin, can you also do ...
5 years, 2 months ago (2015-10-03 01:13:27 UTC) #2
robwu
On 2015/10/03 01:13:27, jww wrote: > I'd love to add a browser test to verify ...
5 years, 2 months ago (2015-10-03 10:25:08 UTC) #3
jww
Thanks for the browser_test suggestion. I'll take a look at it. https://codereview.chromium.org/1383483007/diff/1/third_party/WebKit/Source/core/dom/Document.cpp File third_party/WebKit/Source/core/dom/Document.cpp (right): ...
5 years, 2 months ago (2015-10-03 17:15:07 UTC) #4
robwu
https://codereview.chromium.org/1383483007/diff/1/third_party/WebKit/Source/core/dom/Document.cpp File third_party/WebKit/Source/core/dom/Document.cpp (right): https://codereview.chromium.org/1383483007/diff/1/third_party/WebKit/Source/core/dom/Document.cpp#newcode5669 third_party/WebKit/Source/core/dom/Document.cpp:5669: On 2015/10/03 17:15:06, jww wrote: > On 2015/10/03 10:25:08, ...
5 years, 2 months ago (2015-10-03 17:27:09 UTC) #5
jww
Updated the check, but I'll work on the browser test on Monday. https://codereview.chromium.org/1383483007/diff/1/third_party/WebKit/Source/core/dom/Document.cpp File third_party/WebKit/Source/core/dom/Document.cpp ...
5 years, 2 months ago (2015-10-03 17:56:59 UTC) #6
robwu
https://codereview.chromium.org/1383483007/diff/1/third_party/WebKit/Source/core/dom/Document.cpp File third_party/WebKit/Source/core/dom/Document.cpp (right): https://codereview.chromium.org/1383483007/diff/1/third_party/WebKit/Source/core/dom/Document.cpp#newcode5669 third_party/WebKit/Source/core/dom/Document.cpp:5669: On 2015/10/03 17:56:59, jww wrote: > On 2015/10/03 17:27:09, ...
5 years, 2 months ago (2015-10-03 19:28:51 UTC) #7
Mike West
https://codereview.chromium.org/1383483007/diff/20001/third_party/WebKit/Source/platform/weborigin/SecurityPolicy.cpp File third_party/WebKit/Source/platform/weborigin/SecurityPolicy.cpp (right): https://codereview.chromium.org/1383483007/diff/20001/third_party/WebKit/Source/platform/weborigin/SecurityPolicy.cpp#newcode49 third_party/WebKit/Source/platform/weborigin/SecurityPolicy.cpp:49: using SchemeSet = HashSet<String>; I'd prefer to see this ...
5 years, 2 months ago (2015-10-06 07:22:34 UTC) #8
jww
https://codereview.chromium.org/1383483007/diff/20001/third_party/WebKit/Source/core/dom/Document.cpp File third_party/WebKit/Source/core/dom/Document.cpp (right): https://codereview.chromium.org/1383483007/diff/20001/third_party/WebKit/Source/core/dom/Document.cpp#newcode5661 third_party/WebKit/Source/core/dom/Document.cpp:5661: // themselves and to immediate sanbox frame descendants, but ...
5 years, 2 months ago (2015-10-06 21:53:56 UTC) #9
jww
On 2015/10/06 21:53:56, jww (traveling- slow) wrote: > https://codereview.chromium.org/1383483007/diff/20001/third_party/WebKit/Source/core/dom/Document.cpp > File third_party/WebKit/Source/core/dom/Document.cpp (right): > > ...
5 years, 2 months ago (2015-10-08 14:59:03 UTC) #10
Devlin
https://codereview.chromium.org/1383483007/diff/60001/chrome/browser/extensions/api/webrtc_from_web_accessible_resource_browsertest.cc File chrome/browser/extensions/api/webrtc_from_web_accessible_resource_browsertest.cc (right): https://codereview.chromium.org/1383483007/diff/60001/chrome/browser/extensions/api/webrtc_from_web_accessible_resource_browsertest.cc#newcode73 chrome/browser/extensions/api/webrtc_from_web_accessible_resource_browsertest.cc:73: // Flaky on Windows: http://crbug.com/301887 Why are newly-added tests ...
5 years, 2 months ago (2015-10-08 16:48:32 UTC) #11
robwu
https://codereview.chromium.org/1383483007/diff/60001/chrome/test/data/extensions/api_test/webrtc_from_web_accessible_resource/manifest.json File chrome/test/data/extensions/api_test/webrtc_from_web_accessible_resource/manifest.json (right): https://codereview.chromium.org/1383483007/diff/60001/chrome/test/data/extensions/api_test/webrtc_from_web_accessible_resource/manifest.json#newcode15 chrome/test/data/extensions/api_test/webrtc_from_web_accessible_resource/manifest.json:15: "web_accessible_resources": ["iframe-content.html", "iframe.js"], iframe.js does not need to be ...
5 years, 2 months ago (2015-10-08 21:25:18 UTC) #12
jww
https://codereview.chromium.org/1383483007/diff/60001/chrome/browser/extensions/api/webrtc_from_web_accessible_resource_browsertest.cc File chrome/browser/extensions/api/webrtc_from_web_accessible_resource_browsertest.cc (right): https://codereview.chromium.org/1383483007/diff/60001/chrome/browser/extensions/api/webrtc_from_web_accessible_resource_browsertest.cc#newcode73 chrome/browser/extensions/api/webrtc_from_web_accessible_resource_browsertest.cc:73: // Flaky on Windows: http://crbug.com/301887 On 2015/10/08 16:48:32, Devlin ...
5 years, 2 months ago (2015-10-09 21:39:26 UTC) #13
jww
Ping of Rob and Devlin. --Joel On 2015/10/09 21:39:26, jww (traveling- slow) wrote: > https://codereview.chromium.org/1383483007/diff/60001/chrome/browser/extensions/api/webrtc_from_web_accessible_resource_browsertest.cc ...
5 years, 2 months ago (2015-10-14 08:44:55 UTC) #14
robwu
Looks good overall! https://codereview.chromium.org/1383483007/diff/80001/chrome/browser/extensions/api/webrtc_from_web_accessible_resource_browsertest.cc File chrome/browser/extensions/api/webrtc_from_web_accessible_resource_browsertest.cc (right): https://codereview.chromium.org/1383483007/diff/80001/chrome/browser/extensions/api/webrtc_from_web_accessible_resource_browsertest.cc#newcode88 chrome/browser/extensions/api/webrtc_from_web_accessible_resource_browsertest.cc:88: GetUserMediaInWebAccessibleResourceSuccess) { Could you also add ...
5 years, 2 months ago (2015-10-14 09:05:36 UTC) #15
Devlin
Mostly small stuff https://codereview.chromium.org/1383483007/diff/80001/chrome/browser/extensions/api/webrtc_from_web_accessible_resource_browsertest.cc File chrome/browser/extensions/api/webrtc_from_web_accessible_resource_browsertest.cc (right): https://codereview.chromium.org/1383483007/diff/80001/chrome/browser/extensions/api/webrtc_from_web_accessible_resource_browsertest.cc#newcode9 chrome/browser/extensions/api/webrtc_from_web_accessible_resource_browsertest.cc:9: #include "chrome/common/chrome_switches.h" Do you need all ...
5 years, 2 months ago (2015-10-14 15:24:46 UTC) #16
jww
https://codereview.chromium.org/1383483007/diff/80001/chrome/browser/extensions/api/webrtc_from_web_accessible_resource_browsertest.cc File chrome/browser/extensions/api/webrtc_from_web_accessible_resource_browsertest.cc (right): https://codereview.chromium.org/1383483007/diff/80001/chrome/browser/extensions/api/webrtc_from_web_accessible_resource_browsertest.cc#newcode9 chrome/browser/extensions/api/webrtc_from_web_accessible_resource_browsertest.cc:9: #include "chrome/common/chrome_switches.h" On 2015/10/14 15:24:45, Devlin wrote: > Do ...
5 years, 2 months ago (2015-10-15 18:19:41 UTC) #17
jww
Rob & Devlin, can you take another look? Thanks!
5 years, 2 months ago (2015-10-15 18:25:32 UTC) #18
Devlin
(Just responding to responses. :)) https://codereview.chromium.org/1383483007/diff/80001/chrome/browser/extensions/api/webrtc_from_web_accessible_resource_browsertest.cc File chrome/browser/extensions/api/webrtc_from_web_accessible_resource_browsertest.cc (right): https://codereview.chromium.org/1383483007/diff/80001/chrome/browser/extensions/api/webrtc_from_web_accessible_resource_browsertest.cc#newcode96 chrome/browser/extensions/api/webrtc_from_web_accessible_resource_browsertest.cc:96: ui_test_utils::NavigateToURL(browser(), url); On 2015/10/15 ...
5 years, 2 months ago (2015-10-15 18:34:11 UTC) #19
robwu
https://codereview.chromium.org/1383483007/diff/80001/chrome/browser/extensions/api/webrtc_from_web_accessible_resource_browsertest.cc File chrome/browser/extensions/api/webrtc_from_web_accessible_resource_browsertest.cc (right): https://codereview.chromium.org/1383483007/diff/80001/chrome/browser/extensions/api/webrtc_from_web_accessible_resource_browsertest.cc#newcode96 chrome/browser/extensions/api/webrtc_from_web_accessible_resource_browsertest.cc:96: ui_test_utils::NavigateToURL(browser(), url); On 2015/10/15 18:34:11, Devlin wrote: > On ...
5 years, 2 months ago (2015-10-15 20:56:11 UTC) #20
Devlin
https://codereview.chromium.org/1383483007/diff/80001/chrome/browser/extensions/api/webrtc_from_web_accessible_resource_browsertest.cc File chrome/browser/extensions/api/webrtc_from_web_accessible_resource_browsertest.cc (right): https://codereview.chromium.org/1383483007/diff/80001/chrome/browser/extensions/api/webrtc_from_web_accessible_resource_browsertest.cc#newcode96 chrome/browser/extensions/api/webrtc_from_web_accessible_resource_browsertest.cc:96: ui_test_utils::NavigateToURL(browser(), url); On 2015/10/15 20:56:11, robwu wrote: > On ...
5 years, 2 months ago (2015-10-15 21:21:02 UTC) #21
jww
Latest version. Let me know if it looks good. https://codereview.chromium.org/1383483007/diff/80001/chrome/browser/extensions/api/webrtc_from_web_accessible_resource_browsertest.cc File chrome/browser/extensions/api/webrtc_from_web_accessible_resource_browsertest.cc (right): https://codereview.chromium.org/1383483007/diff/80001/chrome/browser/extensions/api/webrtc_from_web_accessible_resource_browsertest.cc#newcode96 chrome/browser/extensions/api/webrtc_from_web_accessible_resource_browsertest.cc:96: ...
5 years, 2 months ago (2015-10-15 22:38:06 UTC) #22
Devlin
lgtm
5 years, 2 months ago (2015-10-15 22:51:39 UTC) #23
robwu
LGTM, thanks for the functionality! https://codereview.chromium.org/1383483007/diff/140001/chrome/browser/extensions/api/webrtc_from_web_accessible_resource_browsertest.cc File chrome/browser/extensions/api/webrtc_from_web_accessible_resource_browsertest.cc (right): https://codereview.chromium.org/1383483007/diff/140001/chrome/browser/extensions/api/webrtc_from_web_accessible_resource_browsertest.cc#newcode81 chrome/browser/extensions/api/webrtc_from_web_accessible_resource_browsertest.cc:81: LoadExtension(extension_path); The whole function ...
5 years, 2 months ago (2015-10-15 22:52:45 UTC) #24
jww
mkwst@, can you look at the Blink files? thestig@, can you take a look at ...
5 years, 2 months ago (2015-10-15 23:06:02 UTC) #26
Lei Zhang
chrome/ lgtm https://codereview.chromium.org/1383483007/diff/160001/chrome/common/secure_origin_whitelist.h File chrome/common/secure_origin_whitelist.h (right): https://codereview.chromium.org/1383483007/diff/160001/chrome/common/secure_origin_whitelist.h#newcode22 chrome/common/secure_origin_whitelist.h:22: std::set<std::string>* schemes); Might be good to mention ...
5 years, 2 months ago (2015-10-15 23:17:27 UTC) #27
jww
https://codereview.chromium.org/1383483007/diff/160001/chrome/common/secure_origin_whitelist.h File chrome/common/secure_origin_whitelist.h (right): https://codereview.chromium.org/1383483007/diff/160001/chrome/common/secure_origin_whitelist.h#newcode22 chrome/common/secure_origin_whitelist.h:22: std::set<std::string>* schemes); On 2015/10/15 23:17:27, Lei Zhang wrote: > ...
5 years, 2 months ago (2015-10-16 00:55:39 UTC) #28
Mike West
blink LGTM.
5 years, 2 months ago (2015-10-16 20:44:41 UTC) #29
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1383483007/180001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1383483007/180001
5 years, 2 months ago (2015-10-16 20:50:21 UTC) #32
commit-bot: I haz the power
Committed patchset #10 (id:180001)
5 years, 2 months ago (2015-10-17 00:16:12 UTC) #33
commit-bot: I haz the power
5 years, 2 months ago (2015-10-17 00:17:05 UTC) #34
Message was sent while issue was closed.
Patchset 10 (id:??) landed as
https://crrev.com/23d6c8471b207d00a8cf65336067a0891c9a936a
Cr-Commit-Position: refs/heads/master@{#354650}

Powered by Google App Engine
This is Rietveld 408576698