How Tor Browser Blocks Canvas Fingerprinting
Canvas fingerprinting is a tracking technique that exploits the HTML5 canvas element to generate a unique digital identifier based on how a device renders graphics. Tor Browser employs a strict, permission-based defense mechanism that neutralizes this tracking method, ensuring users maintain anonymity across the web without completely breaking site functionality.
The Mechanics of Canvas Fingerprinting
When a website utilizes canvas fingerprinting, it directs the browser
to draw a hidden 2D or 3D graphic, text, or shape using JavaScript.
Because rendering depends on variations in the user’s operating system,
graphics processing unit (GPU), graphics drivers, and installed fonts,
the resulting image contains tiny, device-specific variations. The
script then extracts this image data using methods like
toDataURL() or getImageData() and converts it
into a hash value to uniquely identify and track the device.
Tor’s Defense: Explicit User Prompts
Tor Browser, built on the Firefox Extended Support Release (ESR), treats canvas data extraction as a high-risk action. Instead of allowing scripts to read canvas data silently in the background, Tor intercepts the read-back API calls and halts the extraction.
When a site attempts to read the canvas, Tor Browser displays a notification in the URL bar asking the user: “This website attempted to extract HTML5 canvas image data, which may be used to uniquely identify your computer.”
The user is given the choice to allow or deny canvas extraction for that specific session or domain.
Blank Data Spoofing
If the user declines permission or ignores the prompt (which is the default state), Tor Browser does not simply crash the script, as doing so might alert the tracking server. Instead, it returns an empty, blank (all-white) image to the requesting script.
Because the returned data is completely uniform for all Tor users who deny permission, the tracker receives identical hash values across different sessions and devices. This strips the fingerprint of its uniqueness and prevents the website from distinguishing one Tor user from another.
System-Wide Uniformity
Tor’s canvas protection operates alongside broader
anti-fingerprinting defenses (integrated upstream into Firefox as
privacy.resistFingerprinting). By standardizing system
fonts, screen resolutions via letterboxing, and API responses, Tor
ensures that even if canvas extraction is required for legitimate site
features—such as online image editors or browser games—the rest of the
browser profile remains generic and indistinguishable from other Tor
users.