Closed Bug 1904054 Opened 2 years ago Closed 6 months ago

When an mv3 extension is force_installed via policy, users should not be able to change host permissions

Categories

(WebExtensions :: General, enhancement, P3)

enhancement

Tracking

(firefox153 fixed)

RESOLVED FIXED
153 Branch
Tracking Status
firefox153 --- fixed

People

(Reporter: mkaply, Assigned: mkaply)

References

(Blocks 1 open bug)

Details

Attachments

(1 external file)

In Chrome and Edge, if an extension is force_installed, users cannot change the host permissions.

See:

https://github.com/mozilla/policy-templates/discussions/1111

Our permissions system is a bit different from Chromium, I'm not sure we want this to be the default behavior for all extensions, maybe have a separate opt-in policy?

And in any case, if we ever support this, we'd need to have it clear in the UI that permissions can't be revoked because the extension is controlled by the administrator.

Severity: -- → N/A
Type: defect → enhancement
Priority: -- → P3

I'm not sure we want this to be the default behavior for all extensions, maybe have a separate opt-in policy?

I thought about that, but it seemed redundant since it only happens if the extension is installed via policy anyway.

depending on the usecase, it might be that it only works for admin only extensions.

And in any case, if we ever support this, we'd need to have it clear in the UI that permissions can't be revoked because the extension is controlled by the administrator.

Definitely.

See Also: → 1907844

So for my reference:

diff --git a/toolkit/mozapps/extensions/content/aboutaddons.js b/toolkit/mozapps/extensions/content/aboutaddons.js
index a5ffdf71b835..57f6f541c3ea 100644
--- a/toolkit/mozapps/extensions/content/aboutaddons.js
+++ b/toolkit/mozapps/extensions/content/aboutaddons.js
@@ -2053,6 +2053,10 @@ class AddonPermissionsList extends HTMLElement {
           // mark it as checked if ANY of the "all sites" permission is granted.
           checked = await AddonCard.optionalAllSitesGranted(this.addon.id);
           toggle.toggleAttribute("permission-all-sites", true);
+          if (addon.isInstalledByEnterprisePolicy) {
+            toggle.setAttribute("disabled", "true");
+            toggle.setAttribute("support-page", "admin");
+          }
         }

         toggle.pressed = checked;

We need a SUMO article for generic "managed by an admin"

bug 1989401 opened to create SUMO page.

@mkaply, how should Firefox handle situations where an extension has a minimal set of permissions in "host_permissions" and has "optional_host_permissions" set to ["<all_urls">] or similar? I see a couple of different options:

  1. Force installed extensions are authoritative for their host_permissions and optional_host_permissions. All host permission requests made by the extension are auto-granted and the user is not notified.

NOTE: This approach has a couple of drawbacks. First, it makes it easier for a compromised extension with <all_urls> in optional host permissions to hide up data access at rest by requesting a permission during an attack and releasing it as soon as the attack is complete. Second, depending on the implementation of the extension, this may block users form enabling an extension in legitimate cases, such as manually granting access to an internally hosted version of an enterprise service.

  1. Force installed extensions are only authoritative for their host_permissions. Users can manually add/remove optional_host_permissions and the user must conform any optional host permissions requests made by the extension.

NOTE: Depending on the implementation of the extension, this approach may prevent extensions from operating as expected due to both denied host permission requests and manually removed host permission grants.

  1. Expand the ExtensionSettings policy to support the runtime_allowed_hosts and runtime_blocked_hosts fields from Chrome's version of the policy. Users can modify any host permissions that are not expressly declared in the extension's section of the ExtensionSettings policy. That is, URLs matching patterns declared in runtime_allowed_hosts cannot be manually revoked a user and URLs matching patterns declared in runtime_blocked_hosts cannot be manually granted by a user.

NOTE: I feel this option is the most robust because it allows sysadmins to maintain control over both hosts that should be allowed for an internal deployment and hosts that should not be.

I mean I guess my question would be what does Chrome do :)

Assignee: nobody → mozilla
Status: NEW → ASSIGNED
Attachment #9571771 - Attachment description: Bug 1904054 - Don't allow host permissions to be changed when installed by policy. r?rpl → WIP: Bug 1904054 - Don't allow host permissions to be changed when installed by policy. r?rpl
Attachment #9571771 - Attachment description: WIP: Bug 1904054 - Don't allow host permissions to be changed when installed by policy. r?rpl → Bug 1904054 - Don't allow host permissions to be changed when installed by policy. r?rpl
Status: ASSIGNED → RESOLVED
Closed: 6 months ago
Resolution: --- → FIXED
Target Milestone: --- → 153 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: