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

Issue 700404 link

Starred by 10 users

Issue metadata

Status: Fixed
Owner:
Closed: Sep 21
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Windows , Mac
Pri: 1
Type: Bug



Sign in to add a comment

calling clear() on the camera contentSetting will also clear microphone and location settings.

Reported by rglee...@londontrustmedia.com, Mar 10 2017

Issue description

UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.98 Safari/537.36

Steps to reproduce the problem:
1. Create a new extension.
2. from a background script, block access to camera (all URLs).
3. from a background script, block access to location (all URLs).
3. from a background script, block access to microphone (all URLs).
4. visit https://github.com
5. click "Secure" beside the address, observe all three items are blocked.
6. open a browserAction popup that will clear the camera's content setting.
7. click "Secure" again, and notice that in addition to clearing the camera content setting the location and microphone content setting was also clear.

What is the expected behavior?
expected behaviour is only camera content rules are changed.

What went wrong?
clearing the camera's content settings also clears location and microphone content settings.

Did this work before? N/A 

Does this work in other browsers? N/A

Chrome version: 57.0.2987.98  Channel: stable
OS Version: OS X 10.12.3
Flash Version:
 
Cc: brajkumar@chromium.org
Labels: Needs-Feedback
rgleeson@ Could you please provide a sample test case or a extension file for further triaging from chrome-TE end.

Thanks!
Cc: kkaluri@chromium.org
rgleeson@ could you please respond to the comment #1

Thank You...
Hi everyone,
I will try to create a reproduction extension when I have the free time. 

Project Member

Comment 4 by sheriffbot@chromium.org, Mar 20 2017

Labels: -Needs-Feedback
Thank you for providing more feedback. Adding requester "brajkumar@chromium.org" to the cc list and removing "Needs-Feedback" label.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Hi everyone,
Attached is an extension that reproduces the issue.
To reproduce with this extension:
1) Load the extension
2) go to https://www.google.com, and click "Secure" beside address bar.
3) Observe microphone, camera, and location access is blocked.
4) Click browser action icon, click link.
5) click "Secure" beside address bar, and observe that microphone+camera+location are no longer blocked.

The expected behaviour is that microphone.clear() does not clear the content settings for the camera + location.
bug700402.zip
12.8 KB Download
Components: Blink
Components: -Blink Internals>Permissions>Model
Cc: rdevlin....@chromium.org
Components: -Internals>Permissions>Model Platform>Extensions>API
This looks like an issue with the extensions ContentSetting API? Seems like the content setting clearing is a bit overzealous. +rdevlin

Comment 9 by ajha@chromium.org, Mar 30 2017

Labels: M-59 OS-Linux OS-Windows
Status: Untriaged (was: Unconfirmed)
Able to reproduce the issue on the latest canary(59.0.3056.0), stable(57.0.2987.133) on Windows-10, Linux Ubuntu 14.04 as well as per the test steps in C#5.

Similar behavior is seen on older chrome version: 54.0.2786.0. Versions prior to that(50.0.2624.0 showed no microphone/camera/location access even after step 4).

Marking this as Untriaged for more inputs on this.
Cc: raymes@chromium.org
Owner: msramek@chromium.org
Status: Available (was: Untriaged)
msramek: ownership is a bit unclear but I think you have dealt more with issues in this API in the past? Do you want to take a look?
As far as I know it's still an issue. I've implemented a manual workaround, where when camera.clear() is called i recall microphone.block() and so on. So I have to manually track the status of each content setting, then reapply rules when one of them is cleared.


Components: Privacy
Labels: -Pri-2 Hotlist-Privacy Pri-1
Status: Assigned (was: Available)
I did some quick testing.

The deletion happens in ContentSettingsStore::ClearContentSettingsForExtension(). This method does not have the concept of "content type" (this information is explicitly thrown away by the caller ContentSettingsContentSettingClearFunction::Run) and ContentSettingsStore is always on the same memory address.

So yes, all calls to clear() necessarily delete all extension-sourced content settings.

I'll look into fixing this, but I'm puzzled because the way the code is written, it looks pretty deliberate.
CCing myself on this issue.
Labels: Hotlist-GoodFirstBug
Cc: mgalonsky@chromium.org
Owner: mgalonsky@chromium.org
+mgalonsky@, this is the bug I was mentioning to you today. PTAL!
Project Member

Comment 16 by bugdroid1@chromium.org, Sep 14

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

commit f8de26db8c2d1f871e049bfd84e86d83e73353d9
Author: Melissa Galonsky <mgalonsky@chromium.org>
Date: Fri Sep 14 23:52:20 2018

Fix an extension api bug where clearing content settings cleared the
settings for unrelated content types.

The extensions api had a bug where calling clear on an instance of
content settings in turn called a function that did not take content
type as a parameter and cleared all content settings for that extension.
This adds a function that clears the settings set by an extension for a
particular content type.

Bug:  700404 
Change-Id: I29d519a80006a892fa27be50cf54042247032b38
Reviewed-on: https://chromium-review.googlesource.com/1179620
Reviewed-by: Karan Bhatia <karandeepb@chromium.org>
Reviewed-by: Martin Šrámek <msramek@chromium.org>
Commit-Queue: Melissa Galonsky <mgalonsky@chromium.org>
Cr-Commit-Position: refs/heads/master@{#591528}
[modify] https://crrev.com/f8de26db8c2d1f871e049bfd84e86d83e73353d9/chrome/browser/extensions/api/content_settings/content_settings_api.cc
[modify] https://crrev.com/f8de26db8c2d1f871e049bfd84e86d83e73353d9/chrome/browser/extensions/api/content_settings/content_settings_apitest.cc
[modify] https://crrev.com/f8de26db8c2d1f871e049bfd84e86d83e73353d9/chrome/browser/extensions/api/content_settings/content_settings_store.cc
[modify] https://crrev.com/f8de26db8c2d1f871e049bfd84e86d83e73353d9/chrome/browser/extensions/api/content_settings/content_settings_store.h
[add] https://crrev.com/f8de26db8c2d1f871e049bfd84e86d83e73353d9/chrome/test/data/extensions/api_test/content_settings/clearproperlygranular/manifest.json
[add] https://crrev.com/f8de26db8c2d1f871e049bfd84e86d83e73353d9/chrome/test/data/extensions/api_test/content_settings/clearproperlygranular/test.html
[add] https://crrev.com/f8de26db8c2d1f871e049bfd84e86d83e73353d9/chrome/test/data/extensions/api_test/content_settings/clearproperlygranular/test.js

Cc: nepper@chromium.org msramek@chromium.org mkwst@chromium.org markusheintz@chromium.org
 Issue 100349  has been merged into this issue.
Status: Fixed (was: Assigned)

Sign in to add a comment