跳至主要内容
AntidetectLab
← 返回博客列表
浏览器指纹与反自动化

Reading a canvas fingerprint report

What pixel readback, PNG decoding and text metrics measure in the current browser.

作者:AntidetectLab Research Team (协议栈、芯片特征与链路取证工程团队) · 2026-11-06 · 阅读约 5 分钟
KERNEL ENGINE // CHROMIUM BLINK + GECKO NSS TELEMETRY SAMPLE VIEW Engine[0]: CloakBrowser Skia C++ 4x TextMetrics Linearity (<= 0.015) WebGPU Adapter == WebGL2 Angle D3D11 IDAT Zlib Stream: DETERMINISTIC Runtime.enable Leaks: 0 / 5 Realms Camoufox Gecko NSS + Isolated Profiles P-01 sample P-02 sample P-03 sample ZERO PROTOTYPE WRAPPERS · C++ NATIVE
核心摘要与关键结论 打开实时诊断工具 →

解读 Canvas 指纹报告:PNG IDAT 与 TextMetrics

深入说明 PNG IDAT Zlib 解压字节与 getImageData() 的逐像素比对、纯色金丝雀区域方差检测、Blink 4x TextMetrics 线性度及浏览器原生隐私保护豁免。

关键技术排查要点
  • 通过 DecompressionStream("deflate") 解压 PNG IDAT 扫描线,可识别仅篡改 toDataURL() 却未同步 getImageData() 的插件。
  • 纯色金丝雀测试检测单色填充内的异常像素抖动,同时豁免 Brave、Safari 和 Firefox 的原生确定性保护。
  • Blink 文本测试验证 4x TextMetrics 线性度(|ratio4x - 4| <= 0.015)以及 DOM 与 OffscreenCanvas 的重复一致性。

Why canvas outputs may change

Technical Summary: Canvas 2D pixel hashes reflect drawing primitives, font rasterizers, GPU/Skia rendering paths, display color profiles, and intentional browser privacy farbling. A hash comparison detects when output changed between two draws or readback paths, without automatically attributing the cause to spoofing.

Browser fingerprinting scripts traditionally draw a fixed combination of Bezier curves, gradients, shadow blurs, emoji glyphs, and text onto an HTML5 <canvas> element and hash the result. When two identical devices produce the same hash, they cluster together; when an extension injects random per-pixel offsets to break tracking, it alters the hash—often breaking internal consistency invariants at the same time.

However, legitimate browser updates, hardware acceleration toggles, GPU driver upgrades, and built-in privacy protections (Brave Shields session farbling, Safari/WebKit canvas randomization, and Firefox privacy.resistFingerprinting) also alter canvas output. Separating malicious or broken extension hooks from legitimate rendering requires deterministic multi-path verification.

Comparing PNG IDAT decompression with getImageData() readback

Technical Summary: Comparing ctx.getImageData() directly against pixels decompressed from canvas.toDataURL("image/png") IDAT chunks detects extensions that hook only one Canvas export API. Native browser privacy modes with bounded deltas and valid determinism are explicitly distinguished from broken single-API hooks.

The canvas API exposes direct pixel readback and encoded PNG export. These paths can be compared for a supported image format.

Our forensic collector draws a deterministic multi-primitive scene once, reads raw RGBA bytes via getImageData(), and simultaneously extracts the base64 PNG binary from toDataURL(), parses the PNG IHDR and IDAT chunks directly in memory, inflates the raw Zlib deflate stream via DecompressionStream('deflate'), reverses PNG scanline filter bytes (Sub, Up, Average, Paeth), and compares every reconstructed pixel byte-for-byte against getImageData(). A discrepancy records a difference between the two readbacks. Check image format, transparency handling and browser support before interpreting its cause. The PNG specification describes the filters and pixel formats.

// Reproducible PNG chunk & scanline inspection outline (browser Web Streams)
async function readPngChunkTypes(dataUrl) {
  const b64 = dataUrl.split(',')[1] || '';
  const bin = Uint8Array.from(atob(b64), (c) => c.charCodeAt(0));
  const view = new DataView(bin.buffer);
  const chunks = [];
  for (let pos = 8; pos + 12 <= bin.length; ) {
    const len = view.getUint32(pos);
    const type = String.fromCharCode(...bin.subarray(pos + 4, pos + 8));
    chunks.push({ type, len });
    pos += 12 + len;
    if (type === 'IEND') break;
  }
  return chunks;
}

In addition to Main-Window PNG IDAT comparison, AntidetectLab compares a 64x64 DOM 2D canvas hash against an identical OffscreenCanvas 2D render and also checks OffscreenCanvas inside a DedicatedWorker. When an extension hooks HTMLCanvasElement.prototype.toDataURL without hooking getImageData() or OffscreenCanvas, CANVAS_IDAT_IMAGEDATA_DESYNC fires immediately.

Sampling a filled rectangle

Technical Summary: Drawing a crisp solid-color rectangle and inspecting interior and border gutter pixels exposes naive pixel-noise injectors that perturb every non-transparent pixel indiscriminately. Native privacy farbling with stable back-to-back draws is exempted so Brave, Safari, and Firefox users are not falsely flagged.

Anti-fingerprinting extensions frequently apply pseudo-random +/-1 RGBA jitter to every drawn pixel on readback. While visually imperceptible on gradients or text, that jitter corrupts solid axis-aligned fills that have zero anti-aliasing mathematically. The canary check renders an integer-aligned solid rectangle and checks whether interior pixels remain uniform and transparent gutters remain zeroed.

When unexpected variance occurs outside documented native privacy farbling (braveSessionFarbling, webkitSessionFarbling, geckoSessionFarbling), AntidetectLab records CANVAS_CANARY_SOLID_NOISE_DETECTED; when two back-to-back draws of the exact same canvas produce different hashes, it records CANVAS_NON_DETERMINISTIC_NOISE.

Technical Summary: Canvas measureText() reports floating-point glyph advance widths and bounding boxes influenced by font shaping, DPI scaling, and Skia subpixel grids. On Blink engines, AntidetectLab checks 4x string-width linearity (w("mmmm") / w("m") near 4.0) and repeat determinism rather than assuming a single subpixel grid constant across all engines.

When a privacy script adds random noise to TextMetrics.width to disrupt font-enumeration fingerprinting, it often breaks basic additive linearity: measuring "mmmm" no longer equals approximately four times the width of "m" under an unkerned monospace or standard glyph setup, or repeating the exact same measureText() call returns fluctuating widths.

Canvas / Text ProbeInvariant CheckedSignal Code on Violation
Back-to-Back Canvas DrawIdentical hash across two consecutive identical rendersCANVAS_NON_DETERMINISTIC_NOISE
PNG IDAT vs getImageData()Byte parity (and DOM vs OffscreenCanvas parity)CANVAS_IDAT_IMAGEDATA_DESYNC
Solid-Copy CanaryZero variance inside solid fill & empty gutterCANVAS_CANARY_SOLID_NOISE_DETECTED
TextMetrics 4x LinearityBlink |ratio4x - 4| <= 0.015 & repeat stabilityTEXTMETRICS_BLINK_LINEARITY_VIOLATION

Reading a canvas result

Technical Summary: The canvas report separates repeat determinism, PNG IDAT parity, canary uniformity, TextMetrics linearity, and local cluster frequency into independent fields. Each field answers a distinct diagnostic question and none of them predicts external platform account outcomes.

In the canvas report, always verify canvas.doubleCallStable and canvas.pngIdatMatchesImageData before worrying about whether a hash has appeared in the local crowd cluster. A brand-new GPU driver on a clean workstation will have a valid, deterministic IDAT-coherent canvas even if clusterAudit.status shows cold_start_exempt or not_previously_observed.

Rechecking a rendering change

Technical Summary: Whenever a canvas measurement changes unexpectedly, document the installed fonts, browser build, graphics driver, page zoom, and browser privacy settings, then re-run on an unmodified reference browser on the same machine to isolate host changes from profile overrides.

Hardware acceleration flags, ANGLE backend changes (D3D11 vs Vulkan vs SwiftShader), OS ClearType/font-smoothing settings, and browser zoom levels all shift rasterized pixel hashes legitimately. Repeating the same draw on a stock control browser on the exact same GPU and display clarifies immediately whether a change originated in the OS graphics pipeline or inside an extension/profile hook.

When a discrepancy is confirmed in a single API (for instance, toDataURL() PNG output differing from getImageData() without Brave/Safari/Firefox native farbling metadata), inspect installed browser extensions and JavaScript preload scripts first. Under native browser privacy modes, AntidetectLab records canvasPrivacyFarbling: true alongside the raw pngIdatMatch: false observation so security engineers see both the exact byte comparison and the browser's policy context without misleading labels.

// Compare 2D canvas readback vs OffscreenCanvas determinism in browser DevTools
async function checkCanvasOffscreenParity() {
  const c = document.createElement('canvas'); c.width = 64; c.height = 64;
  const ctx = c.getContext('2d'); ctx.fillStyle = '#017a58'; ctx.fillRect(4, 4, 56, 56);
  const domBytes = ctx.getImageData(0, 0, 64, 64).data;
  const off = new OffscreenCanvas(64, 64);
  const octx = off.getContext('2d'); octx.fillStyle = '#017a58'; octx.fillRect(4, 4, 56, 56);
  const offBytes = octx.getImageData(0, 0, 64, 64).data;
  let diffs = 0;
  for (let i = 0; i < domBytes.length; i += 1) if (domBytes[i] !== offBytes[i]) diffs += 1;
  return { pixelByteDiffs: diffs };
}

相关取证研究

SILICON AUDIT // ARMv9-A + iOS 18 WDA WebAssembly sample TOUCH: 10pt TTL=64 · TPROXY ARM64 12-LAYER HAL ADRENO / APPLE TOUCH: 0pt NaN sample
移动端与云手机

Mobile Browsers, Cloud Phones & Real Devices

移动浏览器、云手机与真机架构对比

How to interpret touch, viewport, codec and sensor data in a mobile browser.

2026-11-24 阅读约 8 分钟
KERNEL ENGINE // CHROMIUM BLINK + GECKO NSS TELEMETRY SAMPLE VIEW Engine[0]: CloakBrowser Skia C++ 4x TextMetrics Linearity (<= 0.015) WebGPU Adapter == WebGL2 Angle D3D11 IDAT Zlib Stream: DETERMINISTIC Runtime.enable Leaks: 0 / 5 Realms Camoufox Gecko NSS + Isolated Profiles P-01 sample P-02 sample P-03 sample ZERO PROTOTYPE WRAPPERS · C++ NATIVE
指纹浏览器

TeraLogin, GoLogin, Multilogin & GeeLark Audit

TeraLogin、GoLogin、Multilogin 与 GeeLark 评测标准

Which records a reproducible comparison would need, and what the lab has published.

2026-11-26 阅读约 5 分钟
KERNEL ENGINE // CHROMIUM BLINK + GECKO NSS TELEMETRY SAMPLE VIEW Engine[0]: CloakBrowser Skia C++ 4x TextMetrics Linearity (<= 0.015) WebGPU Adapter == WebGL2 Angle D3D11 IDAT Zlib Stream: DETERMINISTIC Runtime.enable Leaks: 0 / 5 Realms Camoufox Gecko NSS + Isolated Profiles P-01 sample P-02 sample P-03 sample ZERO PROTOTYPE WRAPPERS · C++ NATIVE
指纹浏览器

Testing Browser Fingerprint Parity Across Tools

跨反检测浏览器的指纹一致性测试规范

A guide to repeatable browser tests, coverage and product-level scoring.

2026-11-21 阅读约 5 分钟