News for hackers. Stuff that matters.
Re:Are top websites using WebGL for fingerprinting? by gruez on Saturday April 17, 2021 @02:31PM (#26846361)
Don't bother. It's hard to do it correctly. If you look through the snippets (or the MDN docs[1]), the value is retrieved using the getParameter() function. You might be tempted to override the function by doing something like

    gl.getParameter = () => "test"
but that's easily detectable. If you run

    gl.getParameter.toString()
You get back

    "() => "test""
whereas the original function you get back

    "function getParameter() { [native code] }"
In general, don't try to fix fingerprinting via content scripts[2]. It's very much detectable. Your best bet is a browser that handles it natively.

[1] https://developer.mozilla.org/en-US/docs/Web/API/WEBGL_debug...

[2] https://palant.info/2020/12/10/how-anti-fingerprinting-exten...

Re:Are top websites using WebGL for fingerprinting? by Matheus28 on Saturday April 17, 2021 @07:38PM (#26848415)
You can easily hide it by hijacking Function.prototype.toString to see if `this == fake gl.getParemeter or this == fake toString`. Then the js code needs to find a real Function.prototype.toString by creating an iframe, but then you can detect that. Then I'm out of ideas on how to rescue the original toString
Re:Are top websites using WebGL for fingerprinting? by HWR_14 on Saturday April 17, 2021 @06:54PM (#26848167)
So the issue is that the fingerprinting code can detect the anti-fingerprinting code? Doesn't that mean the best solution is for everyone to override the same functions with the same dummy information?
Re:Are top websites using WebGL for fingerprinting? by cookiengineer on Saturday April 17, 2021 @11:57PM (#26849693)
This can be fixed by overriding valueOf() and toString() on the prototype. Just return another native function, like JSON.stringify ;)
Re:Are top websites using WebGL for fingerprinting? by rasz on Sunday April 18, 2021 @04:24AM (#26850767)
Sadly there are still things you cant programmatically override/proxy, like storagemanager

    await navigator.storage.estimate()
Re:Are top websites using WebGL for fingerprinting? by rasz on Saturday April 17, 2021 @02:45PM (#26846450)
gl.getParameter.toString() = () => 'function getParameter() { [native code] }'
Re:Are top websites using WebGL for fingerprinting? by gruez on Saturday April 17, 2021 @02:54PM (#26846515)

    -> gl.getParameter.toString.toString()
    <- "() => 'function getParameter() { [native code] }'"
Not to mention the iframe trick mentioned in palant's article.
Re:Are top websites using WebGL for fingerprinting? by rasz on Saturday April 17, 2021 @03:00PM (#26846558)
is that Firefox? in Chrome I get

    gl.getParameter.toString() = () => 'function getParameter() { [native code] }'
    gl.getParameter.toString()
    "function getParameter() { [native code] }"
    gl.getParameter.toString().toString()
    "function getParameter() { [native code] }"
    gl.getParameter.toString().toString().toString()
    "function getParameter() { [native code] }"
iframes, worker, sharedworker, serviceWorker are all covered. Good luck timing the difference.
Re:Are top websites using WebGL for fingerprinting? by deathanatos on Saturday April 17, 2021 @03:06PM (#26846613)
You're running

  gl.getParameter.toString().toString()
what the comment you're replying to is trying to tell you to run is:

  gl.getParameter.toString.toString()
Call toString on the toString fuction, not on its result.
Re:Are top websites using WebGL for fingerprinting? by rasz on Saturday April 17, 2021 @04:20PM (#26847120)