Closed Bug 1714185 Opened 3 years ago Closed 3 years ago

navigator.oscpu returns "Linux x86_64" even if privacy.resistFingerprinting is enabled

Categories

(Core :: DOM: Security, defect)

Firefox 90
defect

Tracking

()

RESOLVED INVALID

People

(Reporter: harshtheking, Unassigned)

References

Details

(Keywords: csectype-disclosure, privacy, Whiteboard: [fingerprinting])

Attachments

(1 file)

Attached image firefox_nightly.png

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0

Steps to reproduce:

Go to about config
enable privacy.resistFingerprinting
open any page
open console
evaluate navigator.oscpu

Actual results:

It outputs: "Linux x86_64"

Expected results:

It should output: "Windows NT x.y; Win64; x64"

Could be the console runs at the wrong privilege level to get the spoofing? Or maybe it's just broken. We're supposed to have tests for this so it would be interesting to figure out how this slipped through if it's broken.

This isn't a vulnerability that needs to be hidden -- if it's broken it's better if people know so they can protect themselves

Group: firefox-core-security
Component: Untriaged → DOM: Security
Product: Firefox → Core
Whiteboard: [fingerprinting]

One test that looks like it should check for this is browser/components/resistfingerprinting/test/browser/browser_navigator.js

(In reply to SoulHarsh007 from comment #0)

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0
...
Actual results:

It outputs: "Linux x86_64"

If you are running Firefox on Linux, then this is by design. resistFingerprinting spoofs a Windows 10 User-Agent HTTP header for all desktop platforms:

https://searchfox.org/mozilla-central/rev/74f3c420ee54001059e1850bef3be876749ff873/browser/components/resistfingerprinting/test/browser/browser_navigator.js#113-118

But was changed in bug 1404608 to report the actual OS in APIs like navigator.oscpu and navigator.userAgent:

https://searchfox.org/mozilla-central/rev/74f3c420ee54001059e1850bef3be876749ff873/browser/components/resistfingerprinting/test/browser/browser_navigator.js#95

This change was made to fix webcompat issues where some websites broke because they were listening for the wrong key codes (e.g. Google Docs bug 1405810). Once a website is able to run JavaScript, it can detect your actual OS pretty easily by analyzing installed fonts/etc, so there is little protection from spoofing the OS in navigator APIs.

You can override your navigator.userAgent value with the about:config pref general.useragent.override, though that will not override navigator.oscpu.

Status: UNCONFIRMED → RESOLVED
Closed: 3 years ago
Resolution: --- → INVALID
See Also: → 1404608
Flags: needinfo?(tom)
Flags: needinfo?(tom)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: