user.js icon indicating copy to clipboard operation
user.js copied to clipboard

UserAgent info from headers vs JavaScript show different OS [solved: RFP by design]

Open quantizzed opened this issue 7 years ago • 2 comments

Hi!

The current version (v66) of the user.js results in two different readings for the user agent. For example, here's what I get on BrowserSpy:

UserAgent from header | Mozilla/5.0 (Windows NT 6.1; rv:60.0) Gecko/20100101 Firefox/60.0

User Agent from JavaScript | Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/60.0

My true platform is Linux x86_64.

Is this a bug or a feature?

quantizzed avatar Apr 28 '19 14:04 quantizzed

Its a feature, from RFP (4501)

Initially, RFP spoofed everyone as Windows. This broke shit, and at the end of the day you can't really hide the OS. So instead they spoofed everyone as Windows, Mac, Linux, or Android. Then Tor Browser decided that to reduce almost all breakage, they would not lie via JS, i.e stick to 4 OSes (since that's what most sites use for providing functionality), but they would reduce HTTP headers to 2 OSes (windows, Android) .. and that's where we're at.

some history (the numbers are bugzillas)

 ** 1333651 & 1383495 & 1396468 - spoof Navigator API (see section 4700) (FF56+)
      FF56: The version number will be rounded down to the nearest multiple of 10
      FF57: The version number will match current ESR (1393283, 1418672, 1418162, 1511763)
      FF59: The OS will be reported as Windows, OSX, Android, or Linux (to reduce breakage) (1404608)
      FF66: The OS in HTTP Headers will be reduced to Windows or Android (1509829)

But, at some stage, they are going to do this, and then hopefully that means they can then reduce JS to 2 OSes, and JS vs HTTP Headers will once again be in sync (as per the specs)

While we can't really hide the major OS, lets not give away free entropy, make the bastards work for it.

Thorin-II avatar Apr 28 '19 15:04 Thorin-II

Thanks for the detailed answer.

quantizzed avatar Apr 28 '19 15:04 quantizzed