Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

fingerprinting protection should be done in C++ instead of js content script #12045

Closed
diracdeltas opened this issue Nov 20, 2017 · 12 comments
Closed
Assignees
Labels
feature/shields fixed-with-brave-core This issue will automatically resolved with the replacement of Muon with Brave Core. misc/fingerprinting priority/P3 Major loss of function. security

Comments

@diracdeltas
Copy link
Member

diracdeltas commented Nov 20, 2017

follow-up to #11784

as @snyderp showed above, blocking DOM methods in a JS content script is a flawed approach because there are sneaky ways to get references to the methods. it would be better to disable the DOM methods in chromium/muon.

the basic functionality in app/extensions/brave/content/scripts/blockCanvasFingerprinting.js should be migrated into Muon. basically if fingerprinting protection is enabled, then:

  1. detect when a blacklisted DOM method/object is invoked
  2. send a message to the browser reporting what was blocked (and preferably the origin of the script that invoked it)
  3. replace the blacklisted DOM method/object with a proxy that yields itself or simply block it

cc @bridiver

@SergeyZhukovsky
Copy link
Member

That how it is done on Android browser in C++. I think we can use most on it https://github.com/brave/browser-android-tabs/commit/c6fdea38de6f818346109e82c23308acb93cee01

@pes10k
Copy link
Contributor

pes10k commented Nov 21, 2017

Its also how the Tor folks do their Canvas fingerprint blocking (which, last I checked, is "prompt user with permission dialog whenever toDataUrl is called").

I have more experience with the Tor/Mozilla codebase at the moment, but I think it should not be too difficult to get something similar pushed into chromium/muon. I don't know where this is on the timeline for you all, but happy to help if outside help would be welcome

@ghostwords
Copy link

ghostwords commented Dec 7, 2017

If there are gaps in WebExtensions APIs, situations where extensions are unable to guarantee before-anything-else execution (such as parent frames being able to access child frames before child frame content scripts had a chance to do their thing), I think these are browser bugs to be fixed. If this is what it is, we should file crbug and/or Bugzilla@Mozilla issues.

@pes10k
Copy link
Contributor

pes10k commented Dec 7, 2017

I agree completely. I'll open issues with both teams in the next 24 hours and post links here to follow up.

@pes10k
Copy link
Contributor

pes10k commented Dec 8, 2017

Bugs below:

Firefox: https://bugzilla.mozilla.org/show_bug.cgi?id=1424176
Chrome: https://bugs.chromium.org/p/chromium/issues/detail?id=793217

@diracdeltas
Copy link
Member Author

assigning to @jumde for now

@diracdeltas
Copy link
Member Author

the fix for this issue would also fix #12110 and #11683

@bsclifton bsclifton modified the milestones: 0.20.x (Beta Channel), 0.21.x (Developer Channel) Dec 29, 2017
@bsclifton
Copy link
Member

Moving to 0.21.x

@alexwykoff
Copy link
Contributor

@diracdeltas is this release blocking?

@diracdeltas
Copy link
Member Author

non-blocking, it can be moved to one release later

@bsclifton bsclifton modified the milestones: 0.21.x (Beta Channel), 0.22.x (Developer Channel) Feb 20, 2018
@bbondy bbondy modified the milestones: 0.22.x (Developer Channel), 0.23.x (Nightly Channel) Feb 25, 2018
@alexwykoff alexwykoff modified the milestones: 0.23.x (Nightly Channel), Backlog (Prioritized) Mar 13, 2018
@alexwykoff alexwykoff added the priority/P3 Major loss of function. label Mar 13, 2018
@tildelowengrimm tildelowengrimm added the fixed-with-brave-core This issue will automatically resolved with the replacement of Muon with Brave Core. label Apr 17, 2018
@bsclifton
Copy link
Member

Closing in favor of brave/brave-browser#1017

@bsclifton
Copy link
Member

Confirmed fixed with brave-core 😄

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature/shields fixed-with-brave-core This issue will automatically resolved with the replacement of Muon with Brave Core. misc/fingerprinting priority/P3 Major loss of function. security
Projects
None yet
Development

No branches or pull requests

10 participants