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

Consider improving canvas fingerprinting detection heuristic #822

Closed
tildelowengrimm opened this issue Aug 24, 2018 · 2 comments
Closed
Labels
feature/shields/fingerprint The fingerprinting (aka: "device recognition") protection provided in Shields feature/shields The overall Shields feature in Brave. priority/P5 Not scheduled. Don't anticipate work on this any time soon. privacy

Comments

@tildelowengrimm
Copy link
Contributor

http://randomwalker.info/publications/OpenWPM_1_million_site_tracking_measurement.pdf gives a canvas fingerprinting heuristic that has a much lower false positive rate than our current one:

We filter scripts according to the following criteria:

  1. The canvas element’s height and width properties must not be set below 16 px.10
  2. Text must be written to canvas with least two colors or at least 10 distinct characters.
  3. The script should not call the save, restore, or addEventListener methods of the rendering context.
  4. The script extracts an image with toDataURL or with a single call to getImageData that specifies an area with a minimum size of 16px × 16px.

And for canvas font detection:

the script sets the font property to at least 50 distinct, valid values and also calls the measureText method at least 50 times on the same text string.

However, perhaps it makes sense for us to use a more strict detection method with a higher false positive rate, since we are trying to defend against fingerprinting attacks on real people (not merely detect it for the purpose of a study). If it turns out that our false positive rate is too high and causing sites to be unusable, we could fall back to the heuristics above.

@tildelowengrimm tildelowengrimm added privacy feature/shields/fingerprint The fingerprinting (aka: "device recognition") protection provided in Shields labels Aug 24, 2018
@tildelowengrimm tildelowengrimm added this to the Backlog milestone Aug 24, 2018
@thenatsky
Copy link

An example of a false positive:

Using cropper.js to manipulate a smallish user-uploaded image gets hijacked.

var croppedImg = cropper.getCroppedCanvas({width: 200, height: 200, fillColor: alpha}).toDataURL(pic_type);

the bit "cropper.getCroppedCanvas({width: 200, height: 200, fillColor: alpha})." gets replaced by a null function.

Hope the example helps when testing this fix.

@bbondy bbondy added the feature/shields The overall Shields feature in Brave. label Oct 31, 2018
@tildelowengrimm tildelowengrimm added the priority/P5 Not scheduled. Don't anticipate work on this any time soon. label Oct 31, 2018
@tildelowengrimm tildelowengrimm added feature/shields/fingerprint The fingerprinting (aka: "device recognition") protection provided in Shields and removed feature/shields/fingerprint The fingerprinting (aka: "device recognition") protection provided in Shields labels Nov 2, 2018
@rebron rebron modified the milestone: 1.x Backlog Feb 7, 2019
@pes10k
Copy link
Contributor

pes10k commented Jul 23, 2020

closing and addressed by #9186

@pes10k pes10k closed this as completed Jul 23, 2020
@pes10k pes10k added this to the 1.10.x - Release Placeholder milestone Jul 24, 2020
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 feature/shields The overall Shields feature in Brave. priority/P5 Not scheduled. Don't anticipate work on this any time soon. privacy
Projects
None yet
Development

No branches or pull requests

5 participants