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

Issue 16625012: Remove ExtensionURLInfo, make security decisions in render process (Closed)

Created:
7 years, 6 months ago by jamesr
Modified:
7 years, 5 months ago
CC:
asargent_no_longer_on_chrome, chromium-reviews, extensions-reviews_chromium.org, Avi (use Gerrit), creis+watch_chromium.org, nkostylev+watch_chromium.org, feature-media-reviews_chromium.org, oshima+watch_chromium.org, ajwong+watch_chromium.org, chromium-apps-reviews_chromium.org, native-client-reviews_googlegroups.com, stevenjb+watch_chromium.org, davemoore+watch_chromium.org, nasko
Visibility:
Public.

Description

Remove ExtensionURLInfo, make security decisions in render process When asking if an extension should have access to a given frame, we need to consider the frame's URL and also if the frame is sandboxed. We check the latter by asking if the frame's security origin is the unique origin. However, we can only usefully do this in the render process when examining a frame. In the browser process or other common code, there's no useful origin to use other than one that duplicates information in the URL. This does security checks in the render process before doing any URL-based lookups and then uses URLs from that point on. R=abarth, mpcomplete BUG=259982, 237267 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=212302

Patch Set 1 #

Total comments: 4

Patch Set 2 : avoid setting source_url if the source security origin is unique #

Patch Set 3 : rebased #

Patch Set 4 : #

Patch Set 5 : fix nacl #

Total comments: 4

Patch Set 6 : rebased and review feedback #

Total comments: 10

Patch Set 7 : Inline IsSandboxedPage check into dispatcher.cc with TODO #

Total comments: 8

Patch Set 8 : address feedback #

Unified diffs Side-by-side diffs Delta from patch set Stats (+143 lines, -236 lines) Patch
M chrome/browser/chrome_content_browser_client.cc View 1 2 3 4 5 6 12 chunks +19 lines, -21 lines 0 comments Download
M chrome/browser/chromeos/offline/offline_load_page.cc View 1 2 3 4 5 6 1 chunk +1 line, -2 lines 0 comments Download
M chrome/browser/extensions/extension_function_dispatcher.cc View 1 2 3 4 5 6 7 2 chunks +1 line, -5 lines 0 comments Download
M chrome/browser/extensions/extension_info_map_unittest.cc View 5 chunks +4 lines, -18 lines 0 comments Download
M chrome/browser/extensions/extension_process_manager.cc View 1 2 3 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/browser/extensions/extension_service.cc View 1 2 3 2 chunks +3 lines, -6 lines 0 comments Download
M chrome/browser/extensions/extension_web_ui.cc View 1 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/extensions/navigation_observer.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/extensions/tab_helper.cc View 1 2 3 1 chunk +2 lines, -3 lines 0 comments Download
M chrome/browser/geolocation/chrome_geolocation_permission_context.cc View 1 1 chunk +1 line, -3 lines 0 comments Download
M chrome/browser/media/media_stream_capture_indicator.cc View 1 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/nacl_host/nacl_file_host.cc View 1 2 3 1 chunk +1 line, -2 lines 0 comments Download
M chrome/browser/nacl_host/nacl_host_message_filter.cc View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/notifications/balloon.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/browser/notifications/notification_options_menu_model.cc View 3 chunks +3 lines, -6 lines 0 comments Download
M chrome/browser/renderer_host/pepper/pepper_extensions_common_message_filter.h View 1 1 chunk +0 lines, -2 lines 0 comments Download
M chrome/browser/renderer_host/pepper/pepper_extensions_common_message_filter.cc View 1 2 chunks +0 lines, -3 lines 0 comments Download
M chrome/browser/tab_contents/tab_util.cc View 1 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/ui/app_modal_dialogs/javascript_dialog_manager.cc View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/ui/browser.cc View 1 2 3 4 5 1 chunk +1 line, -2 lines 0 comments Download
M chrome/browser/ui/fullscreen/fullscreen_exit_bubble_type.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M chrome/common/extensions/extension_messages.h View 1 2 3 4 5 6 1 chunk +0 lines, -3 lines 0 comments Download
M chrome/common/extensions/extension_process_policy.h View 3 chunks +4 lines, -4 lines 0 comments Download
M chrome/common/extensions/extension_process_policy.cc View 2 chunks +3 lines, -3 lines 0 comments Download
M chrome/common/extensions/extension_set.h View 1 2 3 4 5 6 3 chunks +4 lines, -33 lines 0 comments Download
M chrome/common/extensions/extension_set.cc View 1 2 3 4 5 6 4 chunks +15 lines, -54 lines 0 comments Download
M chrome/common/extensions/extension_set_unittest.cc View 1 chunk +6 lines, -6 lines 0 comments Download
M chrome/renderer/chrome_content_renderer_client.cc View 1 2 3 4 5 6 6 chunks +8 lines, -11 lines 0 comments Download
M chrome/renderer/extensions/app_bindings.cc View 1 2 chunks +8 lines, -5 lines 0 comments Download
M chrome/renderer/extensions/dispatcher.h View 1 2 3 4 5 6 7 2 chunks +8 lines, -3 lines 0 comments Download
M chrome/renderer/extensions/dispatcher.cc View 1 2 3 4 5 6 7 7 chunks +37 lines, -21 lines 0 comments Download
M chrome/renderer/extensions/request_sender.cc View 1 2 3 3 chunks +1 line, -7 lines 0 comments Download
M chrome/renderer/extensions/resource_request_policy.cc View 1 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 31 (0 generated)
jamesr
7 years, 6 months ago (2013-06-10 23:05:49 UTC) #1
abarth-chromium
https://codereview.chromium.org/16625012/diff/1/chrome/browser/extensions/extension_function_dispatcher.cc File chrome/browser/extensions/extension_function_dispatcher.cc (left): https://codereview.chromium.org/16625012/diff/1/chrome/browser/extensions/extension_function_dispatcher.cc#oldcode361 chrome/browser/extensions/extension_function_dispatcher.cc:361: WebSecurityOrigin::createFromString(params.source_origin), Should we check source_origin here?
7 years, 6 months ago (2013-06-10 23:12:32 UTC) #2
jamesr
Matt, Adam - mind taking a look at this change?
7 years, 6 months ago (2013-06-10 23:17:25 UTC) #3
jamesr
https://codereview.chromium.org/16625012/diff/1/chrome/browser/extensions/extension_function_dispatcher.cc File chrome/browser/extensions/extension_function_dispatcher.cc (left): https://codereview.chromium.org/16625012/diff/1/chrome/browser/extensions/extension_function_dispatcher.cc#oldcode361 chrome/browser/extensions/extension_function_dispatcher.cc:361: WebSecurityOrigin::createFromString(params.source_origin), On 2013/06/10 23:12:32, abarth wrote: > Should we ...
7 years, 6 months ago (2013-06-10 23:36:46 UTC) #4
Charlie Reis
Drive-by question: I'm concerned about the "make security decisions in render process" part. Is this ...
7 years, 6 months ago (2013-06-11 00:04:43 UTC) #5
jamesr
More precisely I'm moving code that makes security decisions to a different place - I'm ...
7 years, 6 months ago (2013-06-11 00:17:31 UTC) #6
Charlie Reis
On 2013/06/11 00:17:31, jamesr wrote: > More precisely I'm moving code that makes security decisions ...
7 years, 6 months ago (2013-06-11 00:47:59 UTC) #7
jamesr
Yes, in the current state of the code the browser process just has to trust ...
7 years, 6 months ago (2013-06-11 01:50:23 UTC) #8
jamesr
On 2013/06/10 23:12:32, abarth wrote: > https://codereview.chromium.org/16625012/diff/1/chrome/browser/extensions/extension_function_dispatcher.cc > File chrome/browser/extensions/extension_function_dispatcher.cc (left): > > https://codereview.chromium.org/16625012/diff/1/chrome/browser/extensions/extension_function_dispatcher.cc#oldcode361 > ...
7 years, 6 months ago (2013-06-11 20:07:17 UTC) #9
Matt Perry
This feels like decentralizing the IsSandbox check away from ExtensionSet and into a bunch of ...
7 years, 6 months ago (2013-06-11 21:17:45 UTC) #10
jamesr
The browser side won't have access to WebSecurityOrigin soon and it can't do anything useful ...
7 years, 6 months ago (2013-06-11 21:21:06 UTC) #11
Matt Perry
On 2013/06/11 21:21:06, jamesr wrote: > Another way to factor this would be to > ...
7 years, 6 months ago (2013-06-12 00:13:14 UTC) #12
asargent_no_longer_on_chrome
On 2013/06/11 20:07:17, jamesr wrote: > Unfortunately, I'm pretty sure the code as exists in ...
7 years, 6 months ago (2013-06-12 23:12:21 UTC) #13
jamesr
https://codereview.chromium.org/16625012/diff/1/chrome/browser/extensions/extension_function_dispatcher.cc File chrome/browser/extensions/extension_function_dispatcher.cc (left): https://codereview.chromium.org/16625012/diff/1/chrome/browser/extensions/extension_function_dispatcher.cc#oldcode361 chrome/browser/extensions/extension_function_dispatcher.cc:361: WebSecurityOrigin::createFromString(params.source_origin), On 2013/06/10 23:36:46, jamesr wrote: > On 2013/06/10 ...
7 years, 5 months ago (2013-07-10 20:38:58 UTC) #14
jamesr
https://codereview.chromium.org/16625012/diff/1/chrome/browser/extensions/extension_function_dispatcher.cc File chrome/browser/extensions/extension_function_dispatcher.cc (left): https://codereview.chromium.org/16625012/diff/1/chrome/browser/extensions/extension_function_dispatcher.cc#oldcode361 chrome/browser/extensions/extension_function_dispatcher.cc:361: WebSecurityOrigin::createFromString(params.source_origin), Sorry, the source_origin will be "null", so we ...
7 years, 5 months ago (2013-07-10 20:39:55 UTC) #15
jamesr
OK, I believe this code is actually correct without any special origin handling. I've documented ...
7 years, 5 months ago (2013-07-12 23:22:05 UTC) #16
Tom Sepez
Rubberstamp LGTM on removing member,
7 years, 5 months ago (2013-07-12 23:25:51 UTC) #17
abarth-chromium
I didn't see any problems, but I'm not sure I would even if they were ...
7 years, 5 months ago (2013-07-13 00:25:39 UTC) #18
Nico
On 2013/07/12 23:22:05, jamesr wrote: > OK, I believe this code is actually correct without ...
7 years, 5 months ago (2013-07-14 00:07:13 UTC) #19
Nico
non-extensions chrome/ lgtm (with BUG= line in CL description added as mentioned above). There's one ...
7 years, 5 months ago (2013-07-14 00:12:40 UTC) #20
jamesr
https://codereview.chromium.org/16625012/diff/31001/chrome/renderer/chrome_content_renderer_client.cc File chrome/renderer/chrome_content_renderer_client.cc (right): https://codereview.chromium.org/16625012/diff/31001/chrome/renderer/chrome_content_renderer_client.cc#newcode1143 chrome/renderer/chrome_content_renderer_client.cc:1143: !opener.isUnique() && !!extensions.GetExtensionOrAppByURL( On 2013/07/14 00:12:41, Nico wrote: > ...
7 years, 5 months ago (2013-07-15 19:31:11 UTC) #21
Matt Perry
+kalman, could you take a look at the changes to dispatcher.cc? https://codereview.chromium.org/16625012/diff/43001/chrome/renderer/extensions/dispatcher.cc File chrome/renderer/extensions/dispatcher.cc (right): ...
7 years, 5 months ago (2013-07-15 21:24:30 UTC) #22
not at google - send to devlin
+miket, are you the sandboxed page reference these days? So long as we actually do ...
7 years, 5 months ago (2013-07-15 22:09:12 UTC) #23
not at google - send to devlin
https://codereview.chromium.org/16625012/diff/43001/chrome/renderer/extensions/dispatcher.cc File chrome/renderer/extensions/dispatcher.cc (right): https://codereview.chromium.org/16625012/diff/43001/chrome/renderer/extensions/dispatcher.cc#newcode1439 chrome/renderer/extensions/dispatcher.cc:1439: UserScriptSlave::GetDataSourceURLForFrame(frame))) { On 2013/07/15 22:09:12, kalman wrote: > I ...
7 years, 5 months ago (2013-07-15 22:27:09 UTC) #24
jamesr
https://codereview.chromium.org/16625012/diff/43001/chrome/renderer/extensions/dispatcher.cc File chrome/renderer/extensions/dispatcher.cc (right): https://codereview.chromium.org/16625012/diff/43001/chrome/renderer/extensions/dispatcher.cc#newcode1439 chrome/renderer/extensions/dispatcher.cc:1439: UserScriptSlave::GetDataSourceURLForFrame(frame))) { On 2013/07/15 22:27:10, kalman wrote: > However ...
7 years, 5 months ago (2013-07-15 22:55:26 UTC) #25
not at google - send to devlin
https://codereview.chromium.org/16625012/diff/43001/chrome/renderer/extensions/dispatcher.cc File chrome/renderer/extensions/dispatcher.cc (right): https://codereview.chromium.org/16625012/diff/43001/chrome/renderer/extensions/dispatcher.cc#newcode1439 chrome/renderer/extensions/dispatcher.cc:1439: UserScriptSlave::GetDataSourceURLForFrame(frame))) { On 2013/07/15 22:55:27, jamesr wrote: > On ...
7 years, 5 months ago (2013-07-15 23:00:52 UTC) #26
jamesr
On 2013/07/15 23:00:52, kalman wrote: > https://codereview.chromium.org/16625012/diff/43001/chrome/renderer/extensions/dispatcher.cc > File chrome/renderer/extensions/dispatcher.cc (right): > > https://codereview.chromium.org/16625012/diff/43001/chrome/renderer/extensions/dispatcher.cc#newcode1439 > ...
7 years, 5 months ago (2013-07-16 01:06:56 UTC) #27
not at google - send to devlin
lgtm. had another look at the renderer code, and as I mentioned in the bug, ...
7 years, 5 months ago (2013-07-17 23:48:24 UTC) #28
jamesr
https://codereview.chromium.org/16625012/diff/57001/chrome/renderer/extensions/dispatcher.cc File chrome/renderer/extensions/dispatcher.cc (right): https://codereview.chromium.org/16625012/diff/57001/chrome/renderer/extensions/dispatcher.cc#newcode1023 chrome/renderer/extensions/dispatcher.cc:1023: effective_frame_url = UserScriptSlave::GetDataSourceURLForFrame(frame); On 2013/07/17 23:48:24, kalman wrote: > ...
7 years, 5 months ago (2013-07-18 00:12:12 UTC) #29
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/jamesr@chromium.org/16625012/63001
7 years, 5 months ago (2013-07-18 00:24:38 UTC) #30
commit-bot: I haz the power
7 years, 5 months ago (2013-07-18 09:28:58 UTC) #31
Message was sent while issue was closed.
Change committed as 212302

Powered by Google App Engine
This is Rietveld 408576698