Closed Bug 2049937 Opened 4 months ago Closed 4 months ago

New clear on shutdown permissions can not be controlled via enterprise policy

Categories

(Toolkit :: Data Sanitization, defect, P1)

Firefox 154
Desktop
Linux
defect

Tracking

()

RESOLVED FIXED
154 Branch
Tracking Status
firefox-esr140 --- unaffected
firefox152 --- unaffected
firefox153 --- unaffected
firefox154 --- fixed

People

(Reporter: nyanbinary, Assigned: emz)

References

(Regression)

Details

(Keywords: regression)

Attachments

(1 external file)

I believe this regressed the behavior of exempting sites cookies from being cleared since in newest Firefox versions when configured via policies my allowlist of sites that are allowed to keep cookies now get cleared on exit even though they are exempted.

Keywords: regression
Regressed by: 1767271
OS: Unspecified → Linux
Hardware: Unspecified → Desktop
Flags: needinfo?(mozilla)

What policy specifically are you using?

Emma, did any of this change with bug 1767271?

Flags: needinfo?(mozilla) → needinfo?(emz)

(In reply to Mike Kaply [:mkaply] from comment #1)

What policy specifically are you using?

Emma, did any of this change with bug 1767271?

We've switched from using the "cookie" permission for clear on shutdown exceptions to a new permission "persist-data-on-shutdown". We did migrate existing entries to this new permission here: https://searchfox.org/firefox-main/rev/850e4be1127e6854cfef5be7beeaf4c054ec69a4/browser/components/ProfileDataUpgrader.sys.mjs#1025-1039 However it's possible that migration doesn't work for enterprise policies. How does the mechanism for setting clear on shutdown exceptions work on enterprise policy side? maybe it still sets cookie perms?

Flags: needinfo?(emz) → needinfo?(mozilla)

Reporter, are you setting exceptions like this currently?

    "Cookies": {
      "Allow": [
        "https://example.com"
      ]
    },
Flags: needinfo?(nyanbinary)
Component: Privacy: Anti-Tracking → Data Sanitization
Product: Core → Toolkit

So we need to change this line:

https://searchfox.org/firefox-main/source/browser/components/enterprisepolicies/Policies.sys.mjs#791

addAllowDenyPermissions("cookie", param.Allow, param.Block);

to "persist-data-on-shutdown"?

Flags: needinfo?(mozilla)

(In reply to Mike Kaply [:mkaply] from comment #4)

So we need to change this line:

https://searchfox.org/firefox-main/source/browser/components/enterprisepolicies/Policies.sys.mjs#791

addAllowDenyPermissions("cookie", param.Allow, param.Block);

to "persist-data-on-shutdown"?

No, that's most likely not sufficient, because the "cookie" permission still has use beyond clear on shutdown exceptions. It allows to change cookie behavior / capabilities. More likely we want a new policy to control shutdown exceptions separately.

I'm happy to take the bug. I'm currently looking into where the allowlist would fit best. probably somewhere here:

  "policies": {
    "SanitizeOnShutdown": {
      "Cache": true,
      "Cookies": true,
      "History": false,
      "Locked": false
      // exception list here
    }
  }
Assignee: nobody → emz
Severity: -- → S2
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Priority: -- → P1

Bug 1767271 moved clear-on-shutdown exceptions to the persist-data-on-shutdown permission, but the enterprise Cookies policy only writes the cookie permission, so policy-managed allowlists are now cleared on shutdown. Add a SanitizeOnShutdown.Exceptions key that writes persist-data-on-shutdown ALLOW permissions.

I'm surprised we don't have test coverage for this! I'm adding some.

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

This will fix an old bug - bug 1888541.

(In reply to Emma Zühlcke [:emz] from comment #3)

Reporter, are you setting exceptions like this currently?

    "Cookies": {
      "Allow": [
        "https://example.com"
      ]
    },

Yes that's correct.

Flags: needinfo?(nyanbinary)
Pushed by ezuehlcke@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/919afe2974bd https://hg.mozilla.org/integration/autoland/rev/ad01fb232647 Add SanitizeOnShutdown.Exceptions policy for clear-on-shutdown exemptions. r=mkaply
Status: ASSIGNED → RESOLVED
Closed: 4 months ago
Resolution: --- → FIXED
Target Milestone: --- → 154 Branch

Thinking about this, the enterprise migration should have happened. We don't delete these items at shutdown...

(In reply to Mike Kaply [:mkaply] from comment #14)

Thinking about this, the enterprise migration should have happened. We don't delete these items at shutdown...

So what's the issue then and will this fix still work?

So what's the issue then and will this fix still work?

This moves where you set these values to a different policy.

I'm looking into the failure.

How do you have Firefox configured otherwise? Do you have it set to clear history on shutdown but add those sites as exceptions in Cookies?

Duplicate of this bug: 1888541
Summary: Cookies are now cleared even when they are exempted from being cleared → New clear on shutdown permissions can not be controlled via enterprise policy
Blocks: 2051574

(In reply to Mike Kaply [:mkaply] from comment #17)

How do you have Firefox configured otherwise? Do you have it set to clear history on shutdown but add those sites as exceptions in Cookies?

Yes I clear everything but allow cookies, also is there supposed to be UI work for this policy because I go to manage exceptions and I dont see the websites anymore (the new policy works though to be clear no longer clearing cookies)

The UI for this is in Preferences->Customize history, clear data on shutdown exceptions (I think)

It won't be there until Firefox 154 though.

QA Whiteboard: [qa-triage-done-c155/b154]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: