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

Leaking Chromium/Brave full version through navigator.userAgentData.getHighEntropyValues() #23491

Closed
ShivanKaul opened this issue Jun 15, 2022 · 4 comments · Fixed by brave/brave-core#16177
Assignees
Labels
OS/Android Fixes related to Android browser functionality OS/Desktop priority/P3 The next thing for us to work on. It'll ride the trains. privacy/chromium-redqueen Work to remove or improve privacy-harming "features" added in Chromium. privacy/tracking Preventing sites from tracking users across the web QA Pass - Android ARM QA Pass - Android Tab QA Pass-Linux QA Pass-macOS QA Pass-Win64 QA/Test-All-Platforms QA/Test-Plan-Specified QA/Yes regression release-notes/exclude

Comments

@ShivanKaul
Copy link
Collaborator

ShivanKaul commented Jun 15, 2022

Description

This is what I get in dev console or by going to https://browserleaks.com/client-hints (scroll down for the JS API):

> await navigator.userAgentData.getHighEntropyValues(["fullVersionList", "uaFullVersion"]);

image

We should not leak the full version in fullVersionList and uaFullVersion and instead clamp it to the major version, same as in brands (108 in this case).

There's a separate webcompat question of what to do about high entropy values for "platformVersion, "architecture", "platform", "bitness" but for UA versions it's clear that we should just match what we have in the UA.

@ShivanKaul ShivanKaul added OS/Android Fixes related to Android browser functionality OS/Desktop privacy/tracking Preventing sites from tracking users across the web privacy/chromium-redqueen Work to remove or improve privacy-harming "features" added in Chromium. priority/P4 Planned work. We expect to get to it "soon". labels Jun 15, 2022
@ShivanKaul ShivanKaul added priority/P3 The next thing for us to work on. It'll ride the trains. and removed priority/P4 Planned work. We expect to get to it "soon". labels Nov 29, 2022
@ShivanKaul ShivanKaul changed the title Leaking platformVersion through navigator.userAgentData.getHighEntropyValues() Leaking Chromium/Brave full version through navigator.userAgentData.getHighEntropyValues() Nov 30, 2022
@mkarolin mkarolin self-assigned this Nov 30, 2022
mkarolin added a commit to brave/brave-core that referenced this issue Nov 30, 2022
…opyValues

Fixes brave/brave-browser#23491

It seems uaFullVersion was always leaking but the fullVersionList
started leaking because of the change in
#14155 where brand was added
to GetUserAgentBrandList function in
components/embedder_support/user_agent_utils.cc which broke the
BraveContentBrowserClient::GetUserAgentMetadata expectation that the
brand list would only contain 2 items (instead of now 3).

This fix adjusts the BraveContentBrowserClient::GetUserAgentMetadata
expectations and removes adding the Brave brand to the lists because
it's already there. Now we just need to zero out 3 last components of
the full versions list and uaFullVersion string.

Also, adds a browser test to check the sizes of the lists and versions
values.
@mkarolin mkarolin added this to the 1.48.x - Nightly milestone Dec 1, 2022
@kjozwiak
Copy link
Member

kjozwiak commented Dec 7, 2022

The above requires 1.46.139 or higher for 1.46.x verification 👍

@stephendonner
Copy link

stephendonner commented Dec 9, 2022

Verified PASSED using

Brave 1.46.141 Chromium: 108.0.5359.99 (Official Build) (x86_64)
Revision 410951fc34bb4b2cbf182231f9f779efaafaf682-refs/branch-heads/5359_71@{#9}
OS macOS Version 13.1 (Build 22C65)

Steps:

  1. installed 1.46.141
  2. launched Brave
  3. opened Developer Tools
  4. clicked on the Console tab
  5. entered await navigator.userAgentData.getHighEntropyValues(["fullVersionList", "uaFullVersion"]);
  6. expanded the fullVersionList

Confirmed we only show the first digit of the version

Screenshot 2022-12-09 at 12 57 36 PM


Verification PASSED on

Brave | 1.46.141 Chromium: 108.0.5359.99 (Official Build) (64-bit)
-- | --
Revision | 410951fc34bb4b2cbf182231f9f779efaafaf682-refs/branch-heads/5359_71@{#9}
OS | Windows 10 Version 21H2 (Build 19044.2251)

Steps:

  1. installed 1.46.141
  2. launched Brave and open https://browserleaks.com/client-hints
  3. opened Developer Tools
  4. clicked on the Console tab
  5. entered await navigator.userAgentData.getHighEntropyValues(["fullVersionList", "uaFullVersion"]);
  6. expanded the fullVersionList
    image

@btlechowski
Copy link

Verification PASSED on

Brave 1.46.141 Chromium: 108.0.5359.99 (Official Build) (64-bit)
Revision 410951fc34bb4b2cbf182231f9f779efaafaf682-refs/branch-heads/5359_71@{#9}
OS Ubuntu 18.04 LTS

Steps:

  1. installed 1.46.141
  2. launched Brave
  3. opened Developer Tools
  4. clicked on the Console tab
  5. entered await navigator.userAgentData.getHighEntropyValues(["fullVersionList", "uaFullVersion"]);
  6. expanded the fullVersionList

Confirmed we only show the first digit of the version

image

@Uni-verse
Copy link
Contributor

Uni-verse commented Dec 12, 2022

Verified on Samsung Galaxy S21 & Samsung Galaxy Tab S7 using the following build version(s):

Brave	1.46.141 Chromium: 108.0.5359.99 (Official Build) (64-bit) 
Revision	410951fc34bb4b2cbf182231f9f779efaafaf682-refs/branch-heads/5359_71@{#9}
OS	Android 12; Build/SP1A.210812.016

Acceptance Criteria:

  • We should not leak the full version in fullVersionList and uaFullVersion and instead clamp it to the major version, same as in brands (108 in this case).

Test Steps:

  1. installed 1.46.141
  2. launched Brave and open https://browserleaks.com/client-hints
  3. opened Developer Tools
  4. clicked on the Console tab
  5. entered await navigator.userAgentData.getHighEntropyValues(["fullVersionList", "uaFullVersion"]); in the console
  6. expanded the fullVersionList
  • Verified we are only showing the major version in FullVersion object and brands list.

Screen Shot 2022-12-12 at 3 14 33 PM

Screen Shot 2022-12-12 at 3 15 18 PM

Screen Shot 2022-12-12 at 3 25 38 PM

@Uni-verse Uni-verse added QA/In-Progress Indicates that QA is currently in progress for that particular issue QA Pass - Android ARM QA Pass - Android Tab and removed QA/In-Progress Indicates that QA is currently in progress for that particular issue labels Dec 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OS/Android Fixes related to Android browser functionality OS/Desktop priority/P3 The next thing for us to work on. It'll ride the trains. privacy/chromium-redqueen Work to remove or improve privacy-harming "features" added in Chromium. privacy/tracking Preventing sites from tracking users across the web QA Pass - Android ARM QA Pass - Android Tab QA Pass-Linux QA Pass-macOS QA Pass-Win64 QA/Test-All-Platforms QA/Test-Plan-Specified QA/Yes regression release-notes/exclude
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants