We should avoid leaking the amount of cores a user has available by asking window.navigator.hardwareConcurrency. Not sure which value we should give back and if we should return the same one for all users.
Designs
Child items
...
Show closed items
Linked items
0
Link issues together to show that they're related.
Learn more.
Trac: Description: We should avoid leaking the amount of CPUs a user has available by asking window.navigator.hardwareConcurrency. Not sure which value we should give back and if we should return the same one for all users.
to
We should avoid leaking the amount of cores a user has available by asking window.navigator.hardwareConcurrency. Not sure which value we should give back and if we should return the same one for all users.
We should avoid leaking the amount of cores a user has available by asking window.navigator.hardwareConcurrency. Not sure which value we should give back and if we should return the same one for all users.
Of course, one! Are you sure asking to give workers of one site more than 1 core?
Maybe, this can help:
// return the maximum number of cores that navigator.HardwareConcurrency returnspref("dom.maxHardwareConcurrency", 1);
Maybe, this can help:
{{{
// return the maximum number of cores that navigator.HardwareConcurrency returns
pref("dom.maxHardwareConcurrency", 1);
}}}
This pref works, but seems to require a Firefox restart. I suggest we use this pref for now and then in Firefox add a better live behavior once the resistFingerprinting pref is available in Workers.
Maybe, this can help:
{{{
// return the maximum number of cores that navigator.HardwareConcurrency returns
pref("dom.maxHardwareConcurrency", 1);
}}}
This pref works, but seems to require a Firefox restart. I suggest we use this pref for now and then in Firefox add a better live behavior once the resistFingerprinting pref is available in Workers.
Assuming this really gets traction and developers start to check this attribute to deliver better performance to users I was wondering whether we should follow the bucket approach here instead: we could then do something like giving back 1 core if there are less than 4 cores available, and 4 cores if there are more than 3 but less than 8 and 8 if there more than 7. Is that worth the trade-off? Keep in mind that there is a probabilistic approach possible (legacy/trac#18559 (moved)) regardless whether we give a uniform value back or not.
Assuming this really gets traction and developers start to check this attribute to deliver better performance to users I was wondering whether we should follow the bucket approach here instead: we could then do something like giving back 1 core if there are less than 4 cores available, and 4 cores if there are more than 3 but less than 8 and 8 if there more than 7. Is that worth the trade-off? Keep in mind that there is a probabilistic approach possible (legacy/trac#18559 (moved)) regardless whether we give a uniform value back or not.
I like this idea. It also suggests to me that to mitigate the attack in legacy/trac#18559 (moved) we could somehow restrict the use of cores to match the value of window.navigator.hardwareConcurrency that we report. So to match the policy in your example, we would allow the use of 1 core if there are less than 4 cores available, and allow 4 cores to be used if there are more than 3 and less than 8, etc. I'm not sure how easy it would be to do this in practice, but it would give a consistent core count with the patch here, so we can claim to actually hide the number.
Assuming this really gets traction and developers start to check this attribute to deliver better performance to users I was wondering whether we should follow the bucket approach here instead: we could then do something like giving back 1 core if there are less than 4 cores available, and 4 cores if there are more than 3 but less than 8 and 8 if there more than 7. Is that worth the trade-off? Keep in mind that there is a probabilistic approach possible (legacy/trac#18559 (moved)) regardless whether we give a uniform value back or not.
I like this idea. It also suggests to me that to mitigate the attack in legacy/trac#18559 (moved) we could somehow restrict the use of cores to match the value of window.navigator.hardwareConcurrency that we report. So to match the policy in your example, we would allow the use of 1 core if there are less than 4 cores available, and allow 4 cores to be used if there are more than 3 and less than 8, etc. I'm not sure how easy it would be to do this in practice, but it would give a consistent core count with the patch here, so we can claim to actually hide the number.
OKay. Given the time-constraints for getting Tor Browser 7.0 out I'll take the patch you have right now and opened a ticket (legacy/trac#22127 (moved)) for the more elaborate approach.