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

Firefox fingerprint protection causes pixelated label backgrounds #12480

Open
jjspace opened this issue Feb 17, 2025 · 4 comments
Open

Firefox fingerprint protection causes pixelated label backgrounds #12480

jjspace opened this issue Feb 17, 2025 · 4 comments

Comments

@jjspace
Copy link
Contributor

jjspace commented Feb 17, 2025

Apparently some fingerprint detection methods use the canvas and how it draws things. I didn't dig too deep into the methods there.
In the interest of privacy and security Firefox does something in the canvas drawing functions to obfuscate/mangle output to prevent these fingerprinters from working. As a side-effect this causes extra random single pixel spots to show up in labels, see below. (The cause being Firefox's privacy settings was identified on the forums)

Image

Check out the sandcastle that produced that image here. Note that it renders normally in chromium based browsers and Firefox with the "Suspected fingerprinters" protection off.

The Firefox setting that matters is in about:preferences#privacy under “Privacy & Security” > “Enhanced Tracking Protection” > “Suspected fingerprinters” (Note I had to switch to "Custom" to force this on.
I do not know if this only impacts Firefox on Linux or Firefox on all systems with this setting enabled.

According to the page on Firefox's protection against fingerprinting under the suspected fingerprinters it says:

Random data is introduced to background images when the image is read back by the website. If a website merely renders data to the background, it will render without alteration. Although typically this does not happen, if the website reads the image data in the background (and potentially displays it to you again), it will have subtle noise that may affect how the image is displayed.

This sounds exactly like the cause. I believe we render labels to a canvas then copy that as an image to render into the web gl context which would probably trigger this issue. We may need to look into different methods to achieve this if we deem it a big enough problem to tackle fixing.

I'm mostly just opening this issue to keep a record of this issue and provide a single point to link back to if we see this on the forums or reported in other issues.

@anne-gropler
Copy link
Contributor

I do not know if this only impacts Firefox on Linux or Firefox on all systems with this setting enabled.

It also impacts Firefox on Windows: #12443 (comment)

@javagl
Copy link
Contributor

javagl commented Feb 18, 2025

The level of obscurity here is ... nearly fascinating. There is a lot of context, but from the description and images, I'd go out on a limb and make a wild guess that the screenshots by @anne-gropler are related to the custom measureText, which is checking for some exact pixel values to determine the label size.

(Note: I once started a PR which replaces this, at #11747 - replacing the actual function was relatively easy, but there are always caveats and corner cases. Maybe that PR can be revived, even though this will not avoid the "noise" to begin with, but only the odd label sizes)

@ggetz
Copy link
Contributor

ggetz commented Feb 18, 2025

Just to cross-link: #9767 is the underlying issue mentioned by @javagl

@ggetz
Copy link
Contributor

ggetz commented Feb 18, 2025

As noted in #12443 (comment), disabling "Enhanced Tracking Protection" fixes the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants