Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fingerprinting v3: Accept-Language #20096

Closed
pes10k opened this issue Dec 14, 2021 · 5 comments · Fixed by brave/brave-core#12234
Closed

Fingerprinting v3: Accept-Language #20096

pes10k opened this issue Dec 14, 2021 · 5 comments · Fixed by brave/brave-core#12234
Labels
feature/shields/fingerprint The fingerprinting (aka: "device recognition") protection provided in Shields OS/Android Fixes related to Android browser functionality OS/Desktop privacy/tracking Preventing sites from tracking users across the web privacy privacy-pod Feature work for the Privacy & Web Compatibility pod QA/Yes release-notes/include

Comments

@pes10k
Copy link
Contributor

pes10k commented Dec 14, 2021

This is a sub-issue of the larger fingerprint defense reorganization issue: #11770

Currently Brave (like most browsers) will in some configurations report fine-grained information about language preferences in the request Accept-Language header.

For example, setting the system language preference to "French (Switzerland)" sends Accept-Language: fr-FR,fr;q=0.9; setting it to "French (Canadian)" sends Accept-Language: fr-CA,fr;q=0.9. The fr-<WHATEVER> bit ends up being a useful distinguishing bit for fingerprinters.

This issue is to address this fingerprinting concern as follows:

default protection:

  • Drop any non-alphabet related variants So, both of the above examples would become fr;q=0.9 (we'd drop fr-FR and fr-CA). Do not drop alphabet variants though (e.g., sr-Latn).
  • When there is only one weight (i.e., the q), farble it and report a randomly determined value between 0.5 and 0.9.

max protection:

  • always report Accept-Language: en-US,en;q=X.X
  • farble the weight / q with a randomly determined value between 0.5 and 0.9.
@pes10k pes10k added privacy privacy/tracking Preventing sites from tracking users across the web feature/shields/fingerprint The fingerprinting (aka: "device recognition") protection provided in Shields OS/Android Fixes related to Android browser functionality privacy-pod Feature work for the Privacy & Web Compatibility pod OS/Desktop labels Dec 14, 2021
@pes10k
Copy link
Contributor Author

pes10k commented Dec 14, 2021

@fmarier pointed out that this is likely not a great idea, and that there are cases where the variants are useful. So, more planning is needed for the default protections category. Possibilities include:

  1. manually constructing equivalence classes to farble between
  2. only reporting the preferred language (and so stripping out 2nd, 3rd etc preferences)

Im going to brain some more on this, see what other browsers are doing, and revise the default protection approach. But farbling the weight, and reporting a fixed value in the max protection category seem like good options never the less 🤞

@fmarier
Copy link
Member

fmarier commented Dec 15, 2021

For reference, here's how my laptop is set:

LANG=fr_CA.UTF-8
LANGUAGE=
LC_CTYPE="fr_CA.UTF-8"
LC_NUMERIC=en_CA.UTF-8
LC_TIME=en_CA.UTF-8
LC_COLLATE="fr_CA.UTF-8"
LC_MONETARY=en_CA.UTF-8
LC_MESSAGES="fr_CA.UTF-8"
LC_PAPER=en_CA.UTF-8
LC_NAME=en_CA.UTF-8
LC_ADDRESS=en_CA.UTF-8
LC_TELEPHONE=en_CA.UTF-8
LC_MEASUREMENT=en_CA.UTF-8
LC_IDENTIFICATION=en_CA.UTF-8
LC_ALL=

and that ends up with the following odd request header:

accept-language: en-US,en;q=0.9,fr-CA;q=0.8,fr;q=0.7

navigator.languages is even weirder:

$ navigator.languages
['en_US', 'en', 'fr_CA']

@pes10k
Copy link
Contributor Author

pes10k commented Dec 15, 2021

Additional data:

  • I wasn't able to find any information about Firefox reducing the granularity of accept-language. Not sure where i got that idea, maybe i was conflating with Tor (or enabling non-default features in Firefox)
  • Safari seems to only, by design, report the most preferred language, as an intentional anti-fingerprinting strategy: https://bugs.webkit.org/show_bug.cgi?id=3510#c27

Safari doing so makes me think this is likely to have acceptable WebComapt implications. We could also create a flag or system preference for this (and possibly align it with font fingerprinting protections) so that users have a global escape valve if needed

@ShivanKaul
Copy link
Collaborator

I'm guessing the plan is for it to be opt-out via a setting in brave://settings?

@pes10k
Copy link
Contributor Author

pes10k commented Mar 1, 2022

yep yep!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature/shields/fingerprint The fingerprinting (aka: "device recognition") protection provided in Shields OS/Android Fixes related to Android browser functionality OS/Desktop privacy/tracking Preventing sites from tracking users across the web privacy privacy-pod Feature work for the Privacy & Web Compatibility pod QA/Yes release-notes/include
Projects
None yet
5 participants