Fingerprint protection causes pixelated label backgrounds
- Dominant language
- JavaScript
- Stars
- 15.7k
- Forks
- 3.9k
- Avg merge
- 4d 6h
- Merged PRs (30d)
- 34
Description
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](https://community.cesium.com/t/weird-graphical-artifacts-black-dots-when-using-labeled-entities-in-combination-with-webpack/12974/4))

Check out the sandcastle that produced that image [here](https://sandcastle.cesium.com/#c=bVJNb9swDP0rhHdJgExOtp5cN1iRrkCBID0k2y4GWtlmEqGyaEi0k2zofx+trFvR9WBDfHx8/Oy1h97gAT1cgcMDLDCYrlHfIzYqkiraC3KsjUNfJOPLwhUuTWFDEBChNUe0mg05MA5ujcctHWFHwASPuqSOs1Yw9OhE60PrTa+r0yNoV0M4GK72YFjIUXPRBaYGBN7DugstVoy1iLodeol0jD5AtcfqSeAtebi2VtiupkMYyuqlHXRs+CTtnPtS0TYYlK7r0a/CATjdYAZFssHAVpdoi2Qy4C0FMzSSvUxhoT3LS7vPauupucGdRwyjj7PpdAIX8sljOh3H4CiUQUwAwHjklxTLVylAqnbRM7toGbQ3+p9LBrAiljXIoIL2p2GEb0Zcdgw1YYBGP+EwuIY8ApW9oS6cVQKfLP5tISZfD5C6vVsuH65XNw/33zbLu9XXP1llQ1ZW+8PUvM/gU0Sf5f88vkwmSR7l5mcqwBfTtOQZOm9HSqWMTSuVYUjLTnbCqgphOJCBmqevQ/Pa9GDqq3cuCiqrQxDPtrN2bX5ikczzVPj/hVrStdzCfY/e6tNA28/myzOolMpTMd+PZCJbav9G+Tc). 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](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](https://support.mozilla.org/en-US/kb/firefox-protection-against-fingerprinting) under the [suspected fingerprinters](https://support.mozilla.org/en-US/kb/firefox-protection-against-fingerprinting#w_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.
Contributor guide
Research direction
Start with the linked Sandcastle reproduction in Firefox with suspected-fingerprinter protection enabled, then compare it with Chromium and Firefox protection disabled. Trace the label rendering path described in the issue, particularly where canvas output is read back and copied into WebGL. Done means identifying a viable mitigation and verifying that label backgrounds no longer show random pixel artifacts.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- computer-graphics, web-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100