New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 715184 link

Starred by 14 users

Issue metadata

Status: Verified
Owner:
Buried. Ping if important.
Closed: May 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Android , Windows , Chrome , Mac
Pri: 1
Type: Bug


Show other hotlists

Hotlists containing this issue:
Hotlist-1


Sign in to add a comment

`clients*.google.com` is excluded from Web Request API.

Project Member Reported by mkwst@chromium.org, Apr 25 2017

Issue description

We exclude a number of origins that Chrome uses for internal requests via `WebRequestPermissions::IsSensitiveURL()` (https://cs.chromium.org/chromium/src/extensions/browser/api/web_request/web_request_permissions.cc?l=45). Yan reports that GMail is using some of those origins for ad requests (https://twitter.com/bcrypt/status/856888877423837185). If that's the case, I think it's reasonable to narrow the exclusion.

Marking this as ReleaseBlock-Stable for M60 to resolve, either by narrowing the exclusion, or chatting with internal teams about the way we expect those origins to be used. If we can merge something back to M59, so much the better.

rdevlin.cronin@, msramek@: Can you triage this between your teams?
 

Comment 1 by jen...@gmail.com, Apr 25 2017

other extension devs have also noticed that client[*].google.com origins appear to be used broadly for things that should be intercept-able: https://groups.google.com/a/chromium.org/d/msg/chromium-extensions/lJfiGYpnIq4/vwSBV8hrK3IJ, https://groups.google.com/a/chromium.org/forum/#!topic/chromium-extensions/-CEsQjfZLaI

-Yan
Cc: jawag@chromium.org waff...@chromium.org
Oof.

The reason we block those is largely laid out in the function comment:

    // Check for "clients[0-9]*.google.com" hosts.
    // This protects requests to several internal services such as sync,
    // extension update pings, captive portal detection, fraudulent certificate
    // reporting, autofill and others.

We *shouldn't* let extensions intercept those requests due to the fairly massive risks.

I think this is something where, like Mike suggests, we need to clarify what exactly these origins may or may not be used for.

Comment 3 by mkwst@chromium.org, Apr 25 2017

Thanks for taking a look!
> We *shouldn't* let extensions intercept those requests due to the fairly massive risks.

Yup. Understood and agreed. Internal Chrome requests should remain opaque to extensions.

One option is to more clearly enumerate the services we expect Chrome to be using, and narrow the carveouts to path-level rather than origin-level. That requires a bit more discipline about the services we rely on, but seems like it would lead to better outcomes. I think there's already some work in this direction via the `DefineNetworkTrafficAnnotation` additions that might make things simpler...

Or, if all teams have named their directories as well as the GMail team has, we can simply add `&& !base::StartsWith(url.path_piece(), "/ads/", base::CompareCase::SENSITIVE)` to the various checks. :)
Being more disciplined about which paths we use in chrome sounds great to me, but I'm worried that getting to that state will be painful (and might involve costly mistakes.)

from the same function:
    // This protects requests to safe browsing, link doctor, and possibly
    // others.

"possibly others" does not instill much confidence in our ability to pinpoint which services we rely on being protected... :)
Agreed that network annotations could help us here.

Currently, we define the "target" field (website, Google service, other). The "Google service" target should cover all internal requests that go to Google (but not all internal requests as they might go elsewhere), and should not cover content area requests for clients*.google.com, since those would be classified as "website".

However, currently the entire annotation is extracted except the ID; this would require us to leave that annotation field in. +rhalavati@ to please check if this makes sense.

But this might not be ready for M60. At the very moment, I'm not sure if there is a better differentiator than path, as Mike suggested.
Cc: rhalavati@chromium.org
> we need to clarify what exactly these origins may or may not be used for
IIRC clients* is not just for Chrome: it is for serving content from any automated or non-user-facing AJAX-like queries, as a way to isolate www.google.com from vulnerabilities or accidental DoS. It is used by several teams outside of the browser: http://shortn/_4dwFzlb0XF (sorry, Googlers-only).

I don't think we'll have any trying to maintain a list of exceptions like /ads/. It's probably more feasible to have Chrome be more disciplined as suggested. I feel that we should be able to discover all the URLs Chrome is using with some CodeSearching - I recall that there was an initiative (from Opera?) a while ago to move all such URLs into constants files. (Caveat: There's also the chance of a component-extension or default component using such a URL.)

It seems like annotations are the way to go here.

Comment 8 by battre@chromium.org, Apr 25 2017

Mea culpa. When I wrote that code, I had the apparently wrong assumption that client == Chrome. I wonder whether we should - as a quick fix - keep the current regex but whitelist all requests from renderers to be exposed to the web request API. But I have no idea whether this would whitelist too much. My concern is that the network request annotations might slip the M60 feature freeze.
Cc: igrigo...@chromium.org

Comment 10 by palmer@google.com, Apr 27 2017

Given the point in #2 (the need to protect Chrome-internal requests from extensions), and given the limitations of distinguishing request type by hostname, URL path, or with annotations: Is it possible to instead have Chrome-internal requests use a totally different request context, one that doesn't have extensions hooks installed?

I'm ignorant about the design and implementation of this stuff, so maybe my question is off-base. But it seems like nobody has raised or addressed the possibility yet.

Comment 11 by vabr@chromium.org, Apr 27 2017

Cc: -vabr@chromium.org
I don't think I have anything to contribute in addition to the people already active here.
Attaching a sample extension that just writes the network requests observed by the extension to console.log of the extension's background page. This can be used to manually test the proposed effect of https://codereview.chromium.org/2845943003:

1) Install the extension and open the console of its background page.
2) Open https://example.com, go to dev tools and the console, execute
   window.fetch("https://clients1.google.com", {mode: 'no-cors'})
   .then(response=>response.blob())
   .then(r=>console.log(r));
3) Observe that the console of 1) shows the request to https://clients1.google.com
4) Repeat 2) for chrome://settings instead of https://example.com
5) Observe that the console of 1) does not show the request to https://clients1.google.com

webrequestlogging.zip
821 bytes Download
Cc: -battre@chromium.org rdevlin....@chromium.org
Owner: battre@chromium.org
Status: Assigned (was: Available)
battre@ has a patch up for this; passing ownership to him.
webrequestlogging.zip
821 bytes Download
Project Member

Comment 15 by bugdroid1@chromium.org, May 11 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/14ca4ff2719095e31e2f4cc49d1d5e8d5af175ce

commit 14ca4ff2719095e31e2f4cc49d1d5e8d5af175ce
Author: battre <battre@chromium.org>
Date: Thu May 11 14:31:48 2017

Limit protection of clients[0-9]*.google.com to requests from browser.

The WebRequest API protected network requests to clients[0-9]*.google.com from
being visible or modified by extensions. This was built under the assumption
that these domains are only used by Chrome internally, which was invalid. This
CL restrictes the protection to only those network requests that originate from
the browser. Requests from the renderers are exposed to extensions.

BUG= 715184 
TEST= https://crbug.com/715184#c12 

Review-Url: https://codereview.chromium.org/2845943003
Cr-Commit-Position: refs/heads/master@{#470949}

[modify] https://crrev.com/14ca4ff2719095e31e2f4cc49d1d5e8d5af175ce/extensions/browser/api/web_request/web_request_permissions.cc
[modify] https://crrev.com/14ca4ff2719095e31e2f4cc49d1d5e8d5af175ce/extensions/browser/api/web_request/web_request_permissions.h
[modify] https://crrev.com/14ca4ff2719095e31e2f4cc49d1d5e8d5af175ce/extensions/browser/api/web_request/web_request_permissions_unittest.cc

Cc: msrchandra@chromium.org
Labels: Needs-Feedback
As per Comment# 12 tested the issue on Windows, Mac and Linux on Chrome Dev# 60.0.3100.0 and observing the following error in console. 
Attaching a screenshot for reference.
@mkwst -- Could you please let us know what the expected behavior which would help us triage further.
Thanks in Advance.
715184.png
121 KB View Download

Comment 17 by mkwst@chromium.org, May 16 2017

Cc: battre@chromium.org
Labels: Merge-Request-59
Owner: mkwst@chromium.org
msrchandra@: That looks correct to me. The request to `client1,google.com` is showing up in the extension, which wasn't happening before.

Dear release managers, WDYT about merging this change back to beta? (battre@: I think you're busy at the moment, so I can handle the merge if folks approve it.)
Project Member

Comment 18 by sheriffbot@chromium.org, May 16 2017

Labels: -Merge-Request-59 Hotlist-Merge-Approved Merge-Approved-59
Your change meets the bar and is auto-approved for M59. Please go ahead and merge the CL to branch 3071 manually. Please contact milestone owner if you have questions.
Owners: amineer@(Android), cmasso@(iOS), gkihumba@(ChromeOS), Abdul Syed@(Desktop)

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Project Member

Comment 19 by bugdroid1@chromium.org, May 16 2017

Labels: -merge-approved-59 merge-merged-3071
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/210763c75ffa0245904ff82e31d6e08e5b28ed89

commit 210763c75ffa0245904ff82e31d6e08e5b28ed89
Author: Mike West <mkwst@google.com>
Date: Tue May 16 11:26:57 2017

Limit protection of clients[0-9]*.google.com to requests from browser.

The WebRequest API protected network requests to clients[0-9]*.google.com from
being visible or modified by extensions. This was built under the assumption
that these domains are only used by Chrome internally, which was invalid. This
CL restrictes the protection to only those network requests that originate from
the browser. Requests from the renderers are exposed to extensions.

BUG= 715184 
TEST= https://crbug.com/715184#c12 

Review-Url: https://codereview.chromium.org/2845943003
Cr-Original-Commit-Position: refs/heads/master@{#470949}
Review-Url: https://codereview.chromium.org/2886573003 .
Cr-Commit-Position: refs/branch-heads/3071@{#578}
Cr-Branched-From: a106f0abbf69dad349d4aaf4bcc4f5d376dd2377-refs/heads/master@{#464641}

[modify] https://crrev.com/210763c75ffa0245904ff82e31d6e08e5b28ed89/extensions/browser/api/web_request/web_request_permissions.cc
[modify] https://crrev.com/210763c75ffa0245904ff82e31d6e08e5b28ed89/extensions/browser/api/web_request/web_request_permissions.h
[modify] https://crrev.com/210763c75ffa0245904ff82e31d6e08e5b28ed89/extensions/browser/api/web_request/web_request_permissions_unittest.cc

Comment 20 by mkwst@chromium.org, May 16 2017

Status: Fixed (was: Assigned)
Labels: TE-Verified-M60 TE-Verified-60.0.3100.0
@mkwst - Thanks for the update.
As per Comment# 17, the issue is found to be fixed on Chrome Dev# 60.0.3100.0 on Windows, Mac, Linux and Chrome OS (Candy).
Hence adding TE-Verified labels
Labels: TE-Verified-M59 TE-Verified-59.0.3071.61
Verified this issue on Mac OS 10.12, Ubuntu 14.04 and Windows-10 using chrome latest beta M59-59.0.3071.61 by following steps mentioned in the comment #12, Observed `client1,google.com` is showing up in the extension as expected by pasting step=2 code. Hence adding TE-Verified label.
Status: Verified (was: Fixed)

Sign in to add a comment