Add a way for cookie-clearing exceptions to not also affect cookie partitioning
Categories
(Core :: Privacy: Anti-Tracking, enhancement, P2)
Tracking
()
People
(Reporter: twisniewski, Assigned: emz)
References
(Blocks 1 open bug)
Details
(Keywords: priv-triaged, Whiteboard: [privacy:priority_queue])
Attachments
(4 external files, 4 obsolete files)
Right now, I believe that if a user sets a cookie-clearing exception (via Cookies and Site data > Delete cookies and site data when Firefox closes > Manage Exceptions), it also ends up disabling partitioning for that cookie.
According to :pbz, this should be because the two share the same underlying permission, rather than having a separate one for each use-case.
I'm not 100% sure what implications it would have to add this complexity, given that cookie-clearing is less relevant with partitioning on, but it sounds like something that would at least be nice to have (as there will always be desired exceptions, especially for users wishing to be as strict as possible).
As Total Cookie Protection has been shipped to all Firefox users I think this ticket is very very relevant.
Given that TCP is presented in the ETP section of the UI, and exceptions are instead in the Cookie and Site Data part, it is also not very easy to figure out for end users that they might be disabling partitioning for a certain domain. On top of that it is most likely to affect users who want to sanitize on close (so privacy conscious ones), and who are instead introducing a hole in this otherwise great mechanism.
| Comment hidden (me-too) |
| Comment hidden (advocacy) |
| Assignee | ||
Updated•3 years ago
|
| Assignee | ||
Updated•3 years ago
|
| Assignee | ||
Comment 4•3 years ago
|
||
We had a brief discussion with the team about this today. The overlap of this permission seems unexpected for users so this is worth addressing.
I'm in favor of changing the permission used for shutdown clearing exceptions to a new one. Updating our existing cookie permission that's consumed all over anti-tracking code is probably more work.
When we switch over we also need to migrate existing values over. Since we can't tell apart "cookie" exceptions and clear-on-shutdown exceptions we should migrate everything over and only separate the mechanism going forward.
Apologies for the comment without any additional information, but is this issue still planned to be addressed? There do not seem to be any comments since five months ago, so it is not clear to me.
While I would like to fix it myself, I do not have enough experience with the source code (namely zero) to actually conduct such a large change by myself.
| Assignee | ||
Updated•3 years ago
|
| Assignee | ||
Comment 6•3 years ago
|
||
Apologies for the comment without any additional information, but is this issue still planned to be addressed? There do not seem to be any comments since five months ago, so it is not clear to me.
While I would like to fix it myself, I do not have enough experience with the source code (namely zero) to actually conduct such a large change by myself.
Yes! But we can't prioritize it in the short-term. I'm adding this to our internal backlog.
| Assignee | ||
Comment 7•3 years ago
•
|
||
Ideally we can split up the two permissions into separate permissions with separate management UI:
- "cookie" permissions: These can be used to relax cookie restrictions for specific sites, such as disabling Total Cookie Protection, or enabling cookies if they're blocked globally. They can also be used to have stricter rules or block cookies for a specific site. This permission is currently exposed via the permissions panel when you visit a site, it's also shown in the pageInfo window permissions tab. They also need a global management UI in preferences (that's currently the "manage exceptions" button).
- "shutdownclearing" exception permissions (NEW): These will be used for exempting sites from being cleared on shutdown by our Sanitizer.sys.mjs code. To preserve current functionality they should also support clearing only specific sites by setting not an
ALLOWfor the permission value/capability but e.g. aSESSION. This permission does not have to exposed on a per-site basis in the permission panel or pageInfo window.
As already mentioned, when splitting up the two permissions we will need a migration mechanism so that all "cookie" permissions are also added as shutdown exceptions one-off. After the migration they will be split.
| Comment hidden (advocacy) |
| Assignee | ||
Updated•2 years ago
|
| Assignee | ||
Comment 10•2 years ago
|
||
https://searchfox.org/mozilla-central/query/default?q=calls-to%3A%27mozilla%3A%3Anet%3A%3ACookieJarSettings%3A%3ACookiePermission%27%20depth%3A4 shows all the calls to the cookie permission getter.
I believe this is where partitioning gets disabled for explicit "cookie" ALLOW permissions: https://searchfox.org/mozilla-central/rev/4582d908c17fbf7924f5699609fe4a12c28ddc4a/toolkit/components/antitracking/StorageAccess.cpp#484
| Assignee | ||
Comment 11•2 years ago
|
||
William, would you like to take this one next? This work would involve adding a separate permission type / id for clearing on shutdown.
Comment 12•2 years ago
|
||
Yeah I can definitely take this one after I fix up 1658094. Would extra UI elements be in the scope of this bug or would this just be separating the two permissions with a way to add them independently coming later?
Comment 13•2 years ago
|
||
Updated•2 years ago
|
Updated•2 years ago
|
Updated•2 years ago
|
Comment 14•2 years ago
|
||
(In reply to u716861 from comment #3)
Oh wow this is a horrific discovery.
Sorry for the disturbance, but can someone please explain to me how this affects me as a user who uses "cookie + site data delete on close" with exceptions?
Is this feature not working properly or does it reduce security when handling cookies?
Many thanks and regards, Martin
Comment 15•1 year ago
|
||
Comment 16•1 year ago
|
||
Glad to see there's been effort put into this, thank you @wwen.
The last comment on the proposed fix is from Aug 2024 and states "we're still blocked on a final UX". Any chance we can get an update on the status?
| Assignee | ||
Updated•1 year ago
|
Updated•1 year ago
|
| Assignee | ||
Updated•1 year ago
|
Comment 17•10 months ago
|
||
This bug was elevated from P3 to P2 7 months ago.
Mozilla defines P2 as:
Fix in the next release cycle or the following (nightly + 1 or nightly + 2)
Nightly was 142a at the time status was changed to P2. (+1 would've been 143a, +2 would've been 144a)
Is something blocking progress on this issue? Is progress being made behind the scenes?
A status update would be much appreciated.
Comment 18•10 months ago
|
||
(In reply to XE from comment #17)
This bug was elevated from P3 to P2 7 months ago.
Mozilla defines P2 as:
Fix in the next release cycle or the following (nightly + 1 or nightly + 2)
Nightly was 142a at the time status was changed to P2. (+1 would've been 143a, +2 would've been 144a)
Is something blocking progress on this issue? Is progress being made behind the scenes?
A status update would be much appreciated.
Apparently it has been fixed since August of last year but has yet to be accepted pending changes based on the revision attached to the bug report: https://phabricator.services.mozilla.com/D215233
Comment 19•10 months ago
|
||
This work was blocked on new UI for the additional menus that would be required. iirc this was pushed to be either part of or post settings redesign and I am not sure what the progress on that is right now.
@emz: maybe you have a better answer on this?
| Assignee | ||
Comment 20•10 months ago
|
||
Settings redesign is currently WIP. You can already see some of it in Nightly if you flip browser.settings-redesign.enabled.
We'll revisit this bug once we've shipped the new design. Keeping the NI.
Comment 21•9 months ago
|
||
This has a high impact as most users are unaware of the privacy implication and there is no workaround, severity should be S2.
Comment 22•8 months ago
|
||
Does this also affect cookies when Multi Account Containers are in use? For example, if a user sets firefox to delete cookies on quit but has exceptions for sites to maintain logins, but only uses those sites within specific Multi Account Containers rather than a bare tab with FPI (which is broken in this case when exceptions are made).
| Assignee | ||
Comment 23•5 months ago
|
||
Taking over this patch. This will need some work because we now need to integrate with the redesigned settings.
| Assignee | ||
Comment 24•5 months ago
|
||
Today the "Manage Exceptions…" dialog under Cookies and Site Data writes the
"cookie" permission, which also disables Total Cookie Protection partitioning
for the listed sites. Users who add a clear-on-shutdown exception unknowingly
disable TCP for that site.
This change separates the two roles:
- "cookie" keeps its original meaning (cookie allow/deny/session, ETP
relaxation) and no longer exempts a site from clear-on-shutdown. - A new "persist-data-on-shutdown" permission is the dedicated shutdown
exception. The Sanitizer consults it instead of "cookie" when deciding
whether to keep a principal's data on shutdown.
The siteSettings cleaner now takes a clearHonoringExceptions argument:
shutdown uses CLEAR_SITE_PERMISSIONS so PermissionsCleaner preserves the
new exception type, while a manual Clear Now uses CLEAR_PERMISSIONS so the
user can wipe their exception list via the existing Site Settings UI. The
manual "Clear Recent History" dialog passes clearHonoringExceptions=false
for the same reason.
A new "Manage Exceptions…" button is added under the "Clear history when
Firefox closes" checkbox in both the redesigned History subpanel
(about:preferences#history) and the legacy custom-history layout. It opens
the permissions dialog with permissionType="persist-data-on-shutdown".
| Assignee | ||
Comment 25•5 months ago
|
||
Existing users have set clear-on-shutdown exceptions via the old "cookie"
permission. After the permission split, those records no longer exempt a
site from shutdown clearing. To preserve user expectations across the
upgrade, bump APP_DATA_VERSION to 174 and duplicate each cookie ALLOW
permission as a persist-data-on-shutdown ALLOW.
DENY is not duplicated (irrelevant to persistence). SESSION is not
duplicated either: its "clear on shutdown" intent is preserved by the
SESSION-wins-over-exception branch in the Sanitizer, so making it an
exception too would be wrong.
The xpcshell test verifies the three capabilities behave as described and
that re-running the migration is idempotent.
| Assignee | ||
Comment 26•5 months ago
|
||
Updates existing sanitize and cleardata tests to use the new permission
type where the test's intent was a clear-on-shutdown exception. Leaves
cookie permission usages alone where they're testing cookie behaviour
itself (DENY blocks cookies, SESSION semantics).
Adds:
-
test_shutdown_exception_permission.js — rewritten to cover the
permission split: CLEAR_SHUTDOWN_EXCEPTIONS targets
persist-data-on-shutdown only, CLEAR_SITE_PERMISSIONS now also clears
"cookie" while still preserving persist-data-on-shutdown. -
browser_shutdownClearingExceptions.js — end-to-end test for the new
"Manage Exceptions…" button under "Clear history when Nightly closes",
registered in both the legacy and settings-redesign privacy panes.
Exercises the disabled-state bound to sanitizeOnShutdown, the
permissions sub-dialog, and persistence across re-opens. -
Additional cases in browser_sanitize-cookie-exceptions.js covering
cookie SESSION winning over a persist-data-on-shutdown exception
(same principal and parent-domain), and parent-domain exceptions
protecting subdomain data via the permission manager's ancestor walk. -
Additional cases in browser_sanitize-sitepermissions.js asserting that
a manual Site Settings clear wipes persist-data-on-shutdown while a
shutdown-context Site Settings clear preserves it.
| Assignee | ||
Comment 27•5 months ago
|
||
Today the "Manage Exceptions…" dialog under Cookies and Site Data writes the
"cookie" permission, which also disables Total Cookie Protection partitioning
for the listed sites. Users who add a clear-on-shutdown exception unknowingly
disable TCP for that site.
This change separates the two roles:
- "cookie" keeps its original meaning (cookie allow/deny/session, ETP
relaxation) and no longer exempts a site from clear-on-shutdown. - A new "persist-data-on-shutdown" permission is the dedicated shutdown
exception. The Sanitizer consults it instead of "cookie" when deciding
whether to keep a principal's data on shutdown.
The siteSettings cleaner now takes a clearHonoringExceptions argument:
the shutdown path uses CLEAR_SITE_PERMISSIONS so PermissionsCleaner
preserves the new exception type, while a manual Clear Now uses
CLEAR_PERMISSIONS so the user can wipe their exception list via the
existing Site Settings UI. The manual "Clear Recent History" dialog
relies on the default falsy clearHonoringExceptions to take the manual
branch automatically.
A new "Manage Exceptions…" button is added under the "Clear history when
Firefox closes" checkbox in both the redesigned History subpanel
(about:preferences#history) and the legacy custom-history layout. It opens
the permissions dialog with permissionType="persist-data-on-shutdown".
| Assignee | ||
Comment 28•5 months ago
|
||
Existing users have set clear-on-shutdown exceptions via the old "cookie"
permission. After the permission split, those records no longer exempt a
site from shutdown clearing. To preserve user expectations across the
upgrade, bump APP_DATA_VERSION to 174 and duplicate each cookie ALLOW
permission as a persist-data-on-shutdown ALLOW.
DENY is not duplicated (irrelevant to persistence). SESSION is not
duplicated either: its "clear on shutdown" intent is preserved by the
SESSION-wins-over-exception branch in the Sanitizer, so making it an
exception too would be wrong.
The xpcshell test verifies the three capabilities behave as described and
that re-running the migration is idempotent.
| Assignee | ||
Comment 29•5 months ago
|
||
Updates existing sanitize and cleardata tests to use the new permission
type where the test's intent was a clear-on-shutdown exception. Leaves
cookie permission usages alone where they're testing cookie behaviour
itself (DENY blocks cookies, SESSION semantics).
Adds:
-
test_shutdown_exception_permission.js — rewritten to cover the
permission split: CLEAR_SHUTDOWN_EXCEPTIONS targets
persist-data-on-shutdown only, CLEAR_SITE_PERMISSIONS now also clears
"cookie" while still preserving persist-data-on-shutdown. -
browser_shutdownClearingExceptions.js — focused mochitest for the new
"Manage Exceptions…" button under "Clear history when Firefox closes",
registered in both the legacy and settings-redesign privacy panes.
Asserts the button's disabled state follows
privacy.sanitize.sanitizeOnShutdown, and that clicking it opens the
permissions sub-dialog wired for permissionType="persist-data-on-shutdown".
Generic permissions-dialog mechanics (add/save/cancel/remove) are
already owned by existing tests under preferences/tests/etp/. -
Additional cases in browser_sanitize-cookie-exceptions.js covering
cookie SESSION winning over a persist-data-on-shutdown exception
(same principal and parent-domain), parent-domain exceptions
protecting subdomain data via the permission manager's ancestor walk,
and the "general sanitizeOnShutdown is off but a few SESSION origins
are tagged" flow (SESSION origins cleared, untagged origins preserved). -
Additional cases in browser_sanitize-sitepermissions.js asserting that
a manual Site Settings clear wipes persist-data-on-shutdown while a
shutdown-context Site Settings clear preserves it.
| Assignee | ||
Comment 30•5 months ago
|
||
Reflects the permission split in the antitracking data-sanitization
reference:
- "cookie" ALLOW no longer exempts a site from clear-on-shutdown.
- "persist-data-on-shutdown" ALLOW is the new exception, with a note
that "cookie" SESSION on the same principal still forces clearing. - siteSettings clearing now distinguishes the shutdown path
(CLEAR_SITE_PERMISSIONS, exception preserved) from the manual Clear
Now path (CLEAR_PERMISSIONS, exception wiped) so the existing UI can
fully clear the exception list.
Updated•5 months ago
|
Updated•5 months ago
|
Updated•5 months ago
|
Updated•5 months ago
|
| Assignee | ||
Comment 31•5 months ago
|
||
Fenix also has a clear on shutdown feature, but it looks like they don't have an exception mechanism. No code updates needed for Fenix specifically and no migration.
Comment 32•4 months ago
|
||
| Assignee | ||
Comment 33•4 months ago
|
||
Good news: I've managed to incorporate the new (separate) shutdown clearing exceptions in both the old and the new settings design. I've also added a migration so all cookie allow exceptions are copied to the shutdown clearing exceptions one time. Feel free to manually delete the cookie allow exceptions in the other dialog if you no longer need them.
Comment 34•4 months ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/69a567a9df5c
https://hg.mozilla.org/mozilla-central/rev/7166aacf7dc1
https://hg.mozilla.org/mozilla-central/rev/ffd1357e6177
https://hg.mozilla.org/mozilla-central/rev/d7f249df4e73
Comment 35•4 months ago
|
||
This would be nice to have in ESR153, but IDK if you're willing to do that (i.e current beta) - maybe backport later after it's had time to bake?
| Assignee | ||
Comment 36•4 months ago
|
||
(In reply to Thorin [:thorin] from comment #35)
This would be nice to have in ESR153, but IDK if you're willing to do that (i.e current beta) - maybe backport later after it's had time to bake?
Sorry, I think it's too risky for an uplift or a backport. It also contains a migration which makes it more complex.
Comment 37•4 months ago
|
||
:emz Did you want to include this in the 154 release notes? Please nominate if so.
| Assignee | ||
Comment 38•4 months ago
|
||
Release Note Request (optional, but appreciated)
[Why is this notable]:
Clear on shutdown exceptions used to rely on the same permission as cookie exceptions. That meant if a user wanted to exempt a site from shutdown clearing they would also allow it to set cookies and bypass some tracking protections. Now shutdown exceptions are separate permissions and do not influence cookie settings.
[Suggested wording]:
Exceptions for sites that have their cookies & site data cleared on shutdown can now be set without exempting the site from tracking protection and other cookie restrictions.
[Links (documentation, blog post, etc)]: -
Updated•4 months ago
|
| Assignee | ||
Updated•2 months ago
|
Description
•