You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Safari has recently introduced canvas fingerprinting protections, starting with Safari 17. Initially limited to private browsing, these protections were expanded to standard mode and later patched in 17.5 after vulnerabilities were found (see CVE-2024-27830).
To stay current and account for environments with rendering bias, I propose adding a new signal to ThumbmarkJS that detects canvas randomization using a simple pixel uniformity check:
function canvasHasRenderingBias() {
const canvas = document.createElement('canvas');
const ctx = canvas.getContext('2d');
canvas.width = 8;
canvas.height = 8;
ctx.fillStyle = 'rgba(127,127,127,1)';
ctx.fillRect(0, 0, canvas.width, canvas.height);
const { data } = ctx.getImageData(0, 0, canvas.width, canvas.height);
const r0 = data[0];
const g0 = data[1];
const b0 = data[2];
const a0 = data[3];
for (let i = 4; i < data.length; i += 4) {
const r = data[i];
const g = data[i + 1];
const b = data[i + 2];
const a = data[i + 3];
if (r !== r0 || g !== g0 || b !== b0 || a !== a0) {
return true; // Biased
}
}
return false; // Not biased
}
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Safari has recently introduced canvas fingerprinting protections, starting with Safari 17. Initially limited to private browsing, these protections were expanded to standard mode and later patched in 17.5 after vulnerabilities were found (see CVE-2024-27830).
To stay current and account for environments with rendering bias, I propose adding a new signal to ThumbmarkJS that detects canvas randomization using a simple pixel uniformity check:
Beta Was this translation helpful? Give feedback.
All reactions