Refactor the ShouldRFP functions (again) to support per-feature control
Categories
(Core :: Privacy: Anti-Tracking, enhancement)
Tracking
()
Tracking | Status | |
---|---|---|
firefox113 | --- | fixed |
People
(Reporter: tjr, Assigned: tjr)
References
(Blocks 2 open bugs)
Details
Attachments
(6 files)
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review |
As we are nearing completion of the fine-grained RFP control cutover, we also want to re-architect how RFP controls all of the various things that RFP controls. Specifically, we want to add the ability to have a middle level of fingerprinting resistance, less strict than Tor's, and with less breakage (we don't have a good name for this now, so we're going to refer to it as RFP-Lite). We're going to do some experiments with this mode to test for web breakage, but we don't have plans to expose it as a configurable toggle for users right now.
To support the ability to move things out of this mode (or into it) and to run experiments, we'll actually be able to control the features in this mode with a preference, similar to ETP (but not exactly like that).
- In nsRFPService.h/cpp create an enum that will (eventually) contain an entry for every feature controlled by RFP. It will be an incrementing integer (not a bitfield) with numerals assigned when the enum value is created and never re-used.
- In nsRFPService.h/cpp create a method that - given an enum value - returns true or false for whether we should enable fingerprinting resistance for the value. This function does not take into account fine-grained context information - it only takes into account whether we are in RFP-Mode or RFP-Lite mode (or no-RFP-mode, but we shouldn't ever reach this function if that is the case.)
- I think the default implementation for this will be a constant array defined in the source code, but I'm just guessing this will be the fastest at runtime.
- Create a preference that can hold overrides for RFP-Lite. When the preference changes, an observer in nsRFPService will update a runtime table that we will consult before the hard-coded table.
- The overrides will only be for RFP-Lite, they will not work if you have the general RFP preference on. If someone really wants to have an RFP mode that enables everything except <foo>, they can do this by enabling everything for RFP-Lite, but it will be verbose. That is okay.
- I envision this preference being a string of the form "+5,-6,+9" to indicate that the features 5 and 9 (which were default-disabled) get enabled for RFP-Lite, and the feature 6 (default-enabled) gets disabled.
- All of the ShouldResistFingerprinting functions in nsContentUtils will get an optional enum value at the end, where the default value is ::Unknown. Eventually we'll prevent you from omitting the argument, but this will be the transition method.
- We will cut over all the ShouldRFP callsites - a component at a time ideally so the enum values we add are clustered together logically - adding enum values where-ever it makes sense to distinguish separate behaviors. I'm not sure at this point how liberal we want to be with assigning new enums for different things. Probably only one enum for e.g. all the navigator overrides, but maybe a separate enum for navigator overrides on workers? We should be cognizent of the fact that users will set these values and changing their behavior later would probably be worse than being overly-verbose in the beginning.
- We'll add our new check (I'll call it the feature check) in the ShouldRFP functions in nsContentUtils either before or after the fine-grained checks (I'll call them the context checks) depending on which check is faster. I expect the feature check is going to be faster, but we can test.
- We'll add a new RFP-Lite preference probably.
Comment 1•2 years ago
|
||
The overrides will only be for RFP-Lite, they will not work if you have the general RFP preference on
good
This is with my Firefox hat on, Tor Browser can lock prefs etc so they are fine. I don't like the idea of a pref for the features. A lite mode doesn't protect in any meaningful way if users can fiddle with it, not in a crowd (advanced scripts) or when made front facing or part of PB mode, and especially without randomized canvas for naive scripts. Ignorant users will use/abuse it and think they're protected. I'd prefer hardcoding it like Brave does for standard vs aggressive shields. IMO, lite should have randomized canvas (for naive scripts). Perhaps you can enforce canvas in the pref at runtime? IDK where we're at with randomized canvas long term but it's the only thing that currently makes the difference in FP protection in Firefox (because we have no crowd).
We can still reduce breakage/compat, such as devicePixelRatio = 2 to stop blur issues, make HTTP header userAgent spoof TB only behind a flag. Improve usability with larger newwin sizes (already a pref: use a better aspect ratio for today's desktops/laptops), etc.
Maybe lite mode can have some different solutions for some metrics but still be protected: brave does this and it makes sense in places. The pref is binary for each feature on/off, so how would you work that in to be future proof?
tom, I don't get the reasoning behind allowing users to toggle any of the entire feature set. Why not just have privacy.resistFingerprinting be an integer : 0=off, 1=lite, 2=everything
Assignee | ||
Comment 2•2 years ago
|
||
Updated•2 years ago
|
Assignee | ||
Comment 3•2 years ago
|
||
Depends on D170888
Assignee | ||
Comment 4•2 years ago
|
||
Depends on D170889
Assignee | ||
Comment 5•2 years ago
|
||
The default value for the target is Unknown, so all callsites
keep working.
We also add a Target value used for Document precomputation. This
value is enabled in RFP Lite mode, and allows us to precompute
ShouldRFP and cache it for faster computations later. (The later
computations will still check the Target, but won't need to do the
other expensive checks.)
Depends on D170890
Assignee | ||
Comment 6•2 years ago
|
||
Depends on D170891
Assignee | ||
Comment 7•2 years ago
|
||
Depends on D170892
Assignee | ||
Updated•2 years ago
|
Comment 9•2 years ago
|
||
Backed out 7 changesets (bug 1815307) for causing mochitest failures at test_bug1729861.html
Backout: https://hg.mozilla.org/integration/autoland/rev/cb52c727e207edf1ee99b99986413f02b218c4af
Failure log: https://treeherder.mozilla.org/logviewer?job_id=409146901&repo=autoland&lineNumber=4830
Comment 10•2 years ago
|
||
Comment 11•2 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/4bf25baa467c
https://hg.mozilla.org/mozilla-central/rev/bb935b219495
https://hg.mozilla.org/mozilla-central/rev/48086381500b
https://hg.mozilla.org/mozilla-central/rev/d8f2a5765d40
https://hg.mozilla.org/mozilla-central/rev/cc164f9e33dd
https://hg.mozilla.org/mozilla-central/rev/7de181e66ddf
Assignee | ||
Updated•2 years ago
|
Updated•2 years ago
|
Description
•