News for hackers. Stuff that matters.
Re:It's always been you, Canvas2D by amelius on Friday March 04, 2022 @08:01AM (#30554076)
> 30-40% of web pages have a <canvas> element

Yes, for fingerprinting /s

Re:It's always been you, Canvas2D by mysteryDate on Friday March 04, 2022 @09:15AM (#30555023)
A legitimate point! Unfortunately from our end it's also impossible to tell what canvases are being used for. Somewhat reassuringly, the vast majority canvases that are being created are much larger than would be necessary for fingerprinting, so we have some reason to believe that most uses are legitimate. There's also the fact that the vast majority of canvases never perform `getImageData`, which is an essential part of every fingerprinting technique I've ever seen.

At this point it's possible to fingerprint with CSS alone, no javascript: https://css-tricks.com/css-based-fingerprinting/

So to say that canvas is an element "for fingerprinting" I think is an outdated notion that's the result of some bad PR the element got like 10 years ago.

So, yes, fingerprinting is an issue and we all wish it would go away. Unfortunately there is a ton of work to do. A lot of very smart people are working on this and I wish them the best of luck.

Re:It's always been you, Canvas2D by gruez on Friday March 04, 2022 @10:05AM (#30555816)
>At this point it's possible to fingerprint with CSS alone, no javascript: https://css-tricks.com/css-based-fing

Fingerprinting isn't a boolean state. The more fingerprinting vectors you have the more reliably you can identify users. Therefore having CSS fingerprinting (or any other fingerprinting vector) doesn't really make canvas fingerprinting less bad.

Re:It's always been you, Canvas2D by mysteryDate on Friday March 04, 2022 @10:15AM (#30555956)
True. Any data the user leaks is data the user leaks and we should work to prevent this. However I don't think people realize just how easy it is to reliably fingerprint users who are blocking javascript and canvas and other web features.
Re:It's always been you, Canvas2D by gruez on Friday March 04, 2022 @11:43AM (#30557075)
>how easy it is to reliably fingerprint users who are blocking javascript and canvas and other web features.

The key difference is that most of the fingerprinting attributes listed in the article, most are very innocuous and/or easy to change (ie. unreliable for fingerprinting). That includes:

1. pointer type

2. prefers-color-scheme

3. window size

4. @supports

The only other one (local fonts) is interesting, but is still easily changeable and conceivably be mitigated by removing all non-default fonts. This is in contrast to canvas/webgl fingerprinting which fingerprints both the software and hardware parts of your rendering stack, and is nearly impossible to change.

Re:It's always been you, Canvas2D by MomoXenosaga on Friday March 04, 2022 @10:30AM (#30556125)
Oh I realize. I also realize literally nobody is going to bite the hand that feeds and that this industry is never going to regulate itself.
Re:It's always been you, Canvas2D by VikingCoder on Friday March 04, 2022 @10:45AM (#30556319)
In the future, everyone is using a 640x480 window into a browser that's completely software stack in a VM that runs at a regulated frequency with a specifically allocated amount of RAM and hard drive space, doesn't accept cookies, and clears cache after every page load.
Re:It's always been you, Canvas2D by rasz on Friday March 04, 2022 @11:11AM (#30556681)
> Unfortunately from our end it's also impossible to tell what canvases are being used for.

you mean trivial, right? calling getImageData toBlob toDataURL means fingerprinting.

Re:It's always been you, Canvas2D by willbudd on Friday March 04, 2022 @11:56AM (#30557237)
I guess it didn't occur to you that retrieving and setting image data with getImageData()/putImageData() actually turn out to be indispensable features when generating complex multi-layer canvases. Your trivial heuristic would flag a lot of false positives.
Re:It's always been you, Canvas2D by chrismorgan on Friday March 04, 2022 @08:38AM (#30554523)
I flat-out don’t believe feature usage statistics on the web for this kind of reason, because too many numbers are patently absurdly wrong as far as any kind of legitimate use is concerned, and so any time I see an element or attribute occurring more often than I’d expect, I just assume some widely-deployed script like Google Analytics that I almost certainly don’t want is using it, probably for fingerprinting.
Re:It's always been you, Canvas2D by donatj on Friday March 04, 2022 @10:44AM (#30556309)
I came here precisely to say 30-40% of websites seems remarkably high.

The number of actual canvas elements used as canvases I've noted in the wild is pretty small. I've been playing with the canvas element since it was a Safari exclusive they added to make building dashboard widgets more powerful, and I can probably say the number of times I've found them actually useful in building a site is on one hand.

I think you're right that most of them are probably for fingerprinting.

Re:It's always been you, Canvas2D by square_usual on Friday March 04, 2022 @08:17AM (#30554258)
Why /s? You're right!
Re:It's always been you, Canvas2D by marcosdumay on Friday March 04, 2022 @08:36AM (#30554506)
He's not completely right. Some of those sites have real reasons to use a canvas.

He's only ~99.9% right.

Re:It's always been you, Canvas2D by egberts1 on Friday March 04, 2022 @09:01AM (#30554810)
of which, /s serves us well.
Re:It's always been you, Canvas2D by neverartful on Friday March 04, 2022 @10:39AM (#30556233)
Can you name a website that uses canvas for fingerprinting? I'm not doubting it's use for that, but would like to see a real example.
Re:It's always been you, Canvas2D by GlitchMr on Friday March 04, 2022 @12:01PM (#30557304)
Google, Facebook, Reddit, Amazon, TikTok. I entered main pages of those websites, and they tried reading pixels of an invisible canvas for whatever reason.
Re:It's always been you, Canvas2D by azangru on Friday March 04, 2022 @08:17AM (#30554257)
Pardon my ignorance, but how do you do this with canvas? I heard of using a 1x1px image for tracking purposes, but not of canvas.
Re:It's always been you, Canvas2D by Etheryte on Friday March 04, 2022 @08:22AM (#30554328)
The canvas element is great for basic fingerprinting because it's practically impossible to stop it without breaking legitimate use cases. Shortly explained, there's differences between text rendering in different operating systems, browsers, and between browser versions as well. A simple fingerprint would be then to render some text, convert the canvas to an image and then hash it. Modern fingerprinting approaches combine this with a number of other sources of data (such as WebGL, available fonts, etc) to uniquely identify users.
Re:It's always been you, Canvas2D by seanw444 on Friday March 04, 2022 @09:30AM (#30555261)
So stupid. You know what would be nice? If my processor didn't attempt to do a bunch of rendering and extra computation, costing more energy and wear, to spy on me. Without eliminating legitimate use cases.

For now, eliminating legitimate use cases will have to do.

Re:It's always been you, Canvas2D by shadowgovt on Friday March 04, 2022 @09:41AM (#30555435)
This problem could also be solved by making the specs so rigid and implementations so constrained that none of these techniques could be used to differentiate one user agent from another.

For many reasons, the lesser of two evils is probably to make user agent differentiation possible. The number of apis one has to cut out to make it impossible basically rolls HTML back to the 1.0 with no JavaScript era.

Implementation details of the machine rendering a document leak through all over the place. The fact that they are allowed to vary while confirming to spec has historically been considered a feature of HTML rendering, not a bug.

Re:It's always been you, Canvas2D by neverartful on Friday March 04, 2022 @12:53PM (#30557982)
How would you prevent use of canvas? Browser plugin? Proxy filter?
Re:It's always been you, Canvas2D by brightball on Friday March 04, 2022 @08:30AM (#30554414)
Reminds me of evercookie.
Re:It's always been you, Canvas2D by square_usual on Friday March 04, 2022 @08:17AM (#30554268)
Re:It's always been you, Canvas2D by azangru on Friday March 04, 2022 @08:19AM (#30554287)
Thanks
Re:It's always been you, Canvas2D by XCSme on Friday March 04, 2022 @09:36AM (#30555352)
1x1px is for sending data to a server (by passing info in the image request URL)

Canvas fingerprinting is done by generating unique(ish) strings based on slight variations in how Browsers/CPUs/GPUs render stuff.

Re:It's always been you, Canvas2D by croes on Friday March 04, 2022 @09:21AM (#30555114)
Fingerprinting not tracking pixel