Closed Bug 2061452 Opened 3 months ago Closed 2 months ago

Page Info doesn't consistently lock policy-managed cookie permissions

Categories

(Firefox :: Enterprise Policies, defect)

defect

Tracking

()

RESOLVED FIXED
156 Branch
Tracking Status
firefox-esr115 --- wontfix
firefox-esr140 --- wontfix
firefox-esr153 --- fixed
firefox153 --- wontfix
firefox154 --- wontfix
firefox155 --- wontfix
firefox156 --- fixed

People

(Reporter: janika, Assigned: janika)

References

(Regression)

Details

(Keywords: regression)

Attachments

(2 external files)

Page Info β†’ Permissions ("Set Cookies") locks the cookie controls inconsistently depending on how the Cookies policy is configured. The two controls are the "Use default" checkbox and the Allow / Allow for Session / Block radio group:

  • Locked: true, no per-site rule for the site β€” both controls locked.
  • Per-site rule (Allow/Block/AllowSession) set with Locked: true β€” only "Use default" is locked; the radios are editable.
  • Per-site rule (Allow/Block/AllowSession) set with Locked:unset|false β€” both "Use default" and the radios are editable.

By contrast, about:preferences#privacy > Browsing Data > Manage Exceptions locks every policy-applied cookie permission.

On Page Info the checkbox is only disabled if Locked == true, while the command lock state is decided purely by state == UNKNOWN, never by the policy scope β€” even though the general rule is that anything set by policy is locked. I believe this was regressed by Bug 1452361 when the Cookies section got special handling.

So I suggest that the checkbox and command should also be disabled when scope == SitePermissions.SCOPE_POLICY.

Set release status flags based on info from the regressing bug 1452361

When initializing the Cookies row on the Page Info, disable the checkbox and
cmd_cookieToggle command when scope == SitePermissions.SCOPE_POLICY, in addition to
the existing prefIsLocked("network.cookie.cookieBehavior") check. This locks cookie
permissions set by the Cookies policy (EXPIRE_POLICY), matching the other permissions

Assignee: nobody → jneuberger
Status: NEW → ASSIGNED
Blocks: 2056598
Status: ASSIGNED → RESOLVED
Closed: 2 months ago
Resolution: --- → FIXED
Target Milestone: --- → 156 Branch

The patch landed in nightly and beta is affected, along with ESR.
:janika, is this bug important enough to require an uplift?

For more information, please visit BugBot documentation.

Flags: needinfo?(jneuberger)

I think we should uplift to esr. Don't worry about 155. It will be there soon enough.

This fix can be verified by repeating the test plan see Bug 2056598 comment 4 until step 1.3. Only difference to before is that "Set Cookies" should now be disabled.

Flags: needinfo?(jneuberger) → qe-verify+

When initializing the Cookies row on the Page Info, disable the checkbox and
cmd_cookieToggle command when scope == SitePermissions.SCOPE_POLICY, in addition to
the existing prefIsLocked("network.cookie.cookieBehavior") check. This locks cookie
permissions set by the Cookies policy (EXPIRE_POLICY), matching the other permissions

Original Revision: https://phabricator.services.mozilla.com/D316902

Attachment #9628412 - Flags: approval-mozilla-esr153?

firefox-esr153 Uplift Approval Request

  • User impact if declined/Reason for urgency: The PermissionManager designed to always lock any policy-set Cookie permissions. Without the fix the policy-set Cookies permissions are only partially locked and remain editable for users via the Page Info Permissions Tab while locked anywhere else.
  • Code covered by automated testing?: yes
  • Fix verified in Nightly?: yes
  • Needs manual QE testing?: yes
  • Steps to reproduce for manual QE testing: See https://bugzilla.mozilla.org/show_bug.cgi?id=2061452#c7 for instructions.
  • Risk associated with taking this patch: low
  • Explanation of risk level: Low
  • String changes made/needed?: No
  • Is Android affected?: no

Updated Uplift Approval Request

Fix verified in Nightly?: no

Steps to reproduce for manual QE testing:

Create a policies.json file in a distribution folder next to the Firefox binary:

  • Windows: <install dir>\distribution\policies.json
  • macOS: Firefox.app/Contents/Resources/distribution/policies.json
  • Linux: <install dir>/distribution/policies.json

Start the browser and confirm the policy is active by visiting about:policies before each scenario β€” it should list the Cookies policy and its config.

---Scenario 1 β€” Cookie behavior locked globally

  1. Set policies.json to { "policies": { "Cookies": { "Locked": true } } }
  2. Launch Firefox with a fresh profile; verify at about:policies that Cookies is active.
  3. Navigate to any site, e.g. https://example.com.
  4. Open Page Info (Ctrl+I on Windows/Linux, Cmd+I on macOS; or click the padlock β†’ More Information) and select the Permissions tab.
  5. Locate the "Set Cookies" row.

Expected:

  • The "Use Default" checkbox is disabled (greyed out, not clickable).
  • Both "Allow"/"Allow for Session"/"Block" radio buttons are disabled.
  • The user cannot change the cookie setting for the site.

---Scenario 2 β€” Per-site permission set by policy (Block list)

  1. Set policies.json to { "policies": { "Cookies": { "Block": ["https://example.org"] } } }
  2. Launch Firefox with a fresh profile; confirm the policy at about:policies.
  3. Navigate to https://example.org (the blocked origin).
  4. Open Page Info (Ctrl+I on Windows/Linux, Cmd+I on macOS; or click the padlock β†’ More Information) β†’ Permissions and find the "Set Cookies" row.

Expected:

  • The "Use Default" checkbox is disabled (greyed out, not clickable).
  • The "Allow"/"Allow for Session"/"Block" radio buttons are disabled.
  • The user cannot change the cookie setting for the site.

---Scenario 3 β€” No policy β†’ controls remain editable

  1. Remove the policies.json file.
  2. Navigate to https://example.org.
  3. Open Page Info (Ctrl+I on Windows/Linux, Cmd+I on macOS; or click the padlock β†’ More Information) β†’ Permissions β†’ "Set Cookies".

Expected:

  • The "Use Default" checkbox is enabled.
  • While "Use Default" is checked, the Allow/Block radio buttons are disabled.
  • Unchecking "Use Default" enables the "Allow"/"Allow for Session"/"Block" radio buttons; re-checking it disables them again.
Attachment #9628412 - Flags: approval-mozilla-esr153? → approval-mozilla-esr153+
QA Whiteboard: [qa-triage-done-c157/b156]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: