Seatext library / BotRefund evidence

WebGL Texture Constraint Detection vs Canvas Fingerprinting: What Is the Difference?

Canvas fingerprinting reads pixel data from 2D drawing operations to identify a browser, while WebGL texture constraint detection examines 3D rendering capabilities and texture limits to spot mismatches between claimed and actual hardware. They...

Built for advertisers who need clear, refund-ready traffic evidence.

Canvas fingerprinting and WebGL texture constraint detection are two distinct browser fingerprinting techniques used to tell humans from automated traffic. Canvas fingerprinting draws shapes, text, or gradients on a 2D canvas and hashes the resulting pixel buffer. Tiny differences in GPU drivers, font rasterization, and operating-system compositing produce a stable, high-entropy identifier. WebGL texture constraint detection, by contrast, queries the 3D context for hard limits such as maximum texture size, number of texture units, and supported compression formats, then checks whether those limits line up with the device the browser claims to be. A headless Chrome instance pretending to be an iPhone 15 Pro will often report desktop-class WebGL limits, revealing the spoof.

Criterion Canvas Fingerprinting WebGL Texture Constraint Detection
Graphics layer examined 2D rendering context (CPU/GPU compositing, font rasterization) 3D rendering context (GPU driver, hardware caps)
Primary signal Pixel-perfect hash of drawn output Numeric limits: max texture size, texture units, compressed formats
Spoof resistance Moderate — noise injection or canvas blockers can break stability Higher — limits are read-only WebGL constants that are harder to fake consistently
Entropy contribution High (often 10–18 bits alone) Moderate (5–12 bits), but orthogonal to canvas
False-positive triggers Privacy extensions, OS updates, font changes Driver updates, virtual GPU passthrough, legitimate rare hardware
Typical deployment Single hash sent to backend for lookup Constraint set compared against device-profile database

Takeaway: Canvas fingerprinting gives a high-entropy identifier but can be disrupted by privacy tools. WebGL texture constraints provide a lower-entropy but harder-to-spoof hardware sanity check. Used together, they catch different evasion tactics.

How Canvas Fingerprinting Works

Canvas fingerprinting instructs the browser to draw a specific set of shapes, text strings, and gradients on an HTML <canvas> element using the 2D context. The resulting pixel buffer is read back with toDataURL() or getImageData() and hashed (commonly SHA-256 or a perceptual hash). Because each GPU driver, OS font stack, and compositing engine rasterizes slightly differently, the hash becomes a stable fingerprint for that device-browser combination.

Attackers try to defeat it by injecting random noise into the canvas, blocking the readback APIs, or returning a fixed generic image. Defenders respond by drawing multiple challenge frames, measuring timing side-channels, or combining canvas with other signals so that a single blocked vector does not sink the detection.

How WebGL Texture Constraint Detection Works

WebGL texture constraint detection creates a WebGL context (WebGL 1 or 2) and queries a fixed set of getParameter() constants: MAX_TEXTURE_SIZE, MAX_CUBE_MAP_TEXTURE_SIZE, MAX_TEXTURE_IMAGE_UNITS, MAX_VERTEX_TEXTURE_IMAGE_UNITS, MAX_COMBINED_TEXTURE_IMAGE_UNITS, and supported compressed texture formats (COMPRESSED_TEXTURE_FORMATS). These values are dictated by the physical GPU and its driver; they do not change per session.

The detector compares the reported constraints against a curated database of known device profiles. If a browser claims to be a Samsung Galaxy S23 (Adreno 740) but reports a maximum texture size of 16384 — typical of desktop NVIDIA RTX cards — the mismatch flags the session as suspicious. BotRefund treats this as one of 106 independent checks, keeping it as evidence rather than a verdict and cross-checking it against network, behavioral, and other browser signals before its AI model weighs the complete pattern.

Why the Difference Matters for Bot Detection

Canvas fingerprinting answers "is this the same browser I saw before?" WebGL texture constraints answer "does this browser's hardware story make sense?" A sophisticated botnet running headless Chrome in a cloud VM can spoof a canvas hash by replaying a recorded one, but it must also virtualize a consistent WebGL cap set that matches the claimed device. Most open-source spoofing tools (Puppeteer extra stealth, Selenium stealth) focus on navigator properties and canvas noise; they rarely emulate a full mobile GPU constraint profile.

Ignoring either signal leaves a gap. Relying only on canvas lets a well-tuned spoofer pass. Relying only on WebGL constraints misses bots that run on real devices with unmodified browsers (click farms, human fraud rings). The combination raises the cost of evasion: the attacker must now maintain a fleet of real devices or build a perfect virtual GPU for every target profile.

Key Facts from BotRefund's Implementation

Fact Detail
Signal count One of 106 independent checks
Evidence model Signal kept as evidence, not a verdict
Cross-checking Tested against browser, network, device, and behavior data
Final classification AI prediction model weighs complete pattern
Reported accuracy 99% accuracy claimed for the full system
Privacy consideration Single anomaly not treated as bot verdict; corporate networks, travel, privacy tools acknowledged

Common Evasion Tactics and How Each Signal Responds

  • Canvas noise injection: Breaks canvas hash stability; WebGL constraints unaffected.
  • Canvas API blocking (e.g., CanvasBlocker extension): Returns generic image or throws; WebGL constraints still readable unless WebGL is also disabled.
  • User-agent spoofing alone: Does not change canvas hash or WebGL caps; both signals detect the mismatch.
  • Headless Chrome with --disable-gpu: Often falls back to SwiftShader, reporting software-renderer limits (e.g., MAX_TEXTURE_SIZE 4096) that betray the environment.
  • Real device farms: Both signals look legitimate; behavioral signals (mouse tremor, click timing, scroll patterns) become the primary discriminator.

Limitations and When the Advice Does Not Apply

Canvas fingerprinting degrades when users run aggressive privacy extensions (Tor Browser, Brave Shields, CanvasBlocker) or when OS/driver updates change rasterization. WebGL constraint detection degrades when a legitimate user runs an unusual GPU passthrough configuration, a new driver with revised caps, or a rare device not yet in the profile database. Neither signal works if the browser disables WebGL or canvas entirely (some enterprise policies, high-security modes). In those cases, detection must fall back to network reputation, behavioral biometrics, and challenge-response tests.

BotRefund explicitly states that a single anomaly is not a bot verdict. Privacy tools, travel, corporate networks, and unusual devices can produce unexpected behavior for genuine people. The system keeps each signal as evidence and cross-checks it against independent browser, network, device, and behavior data before the AI prediction model weighs the complete pattern.

Terminology Quick Reference

  • Canvas fingerprinting: Hashing pixel output from 2D canvas drawing operations to create a device identifier.
  • WebGL texture constraint detection: Querying read-only WebGL constants (max texture size, texture units, compressed formats) to verify hardware consistency.
  • Entropy: Measure of identifying power in bits; higher entropy means fewer collisions.
  • Spoofing: Faking browser or device properties to evade detection.
  • SwiftShader: Google's software WebGL rasterizer used when GPU acceleration is unavailable; reports distinct constraint values.
  • Evidence vs. verdict: A signal contributes evidence; the final bot/human decision comes from a model that weighs all evidence together.

Decision Framework: Which Signal to Prioritize

  1. If you need a persistent visitor ID for analytics or fraud linking across sessions → canvas fingerprinting (with fallback for blockers).
  2. If you need to catch sophisticated spoofing of device type (mobile vs desktop, GPU model) → WebGL texture constraints.
  3. If you operate under strict privacy regulations (GDPR, ePrivacy) → evaluate whether canvas hashing counts as personal data; WebGL constraints are lower entropy and may be easier to justify as security telemetry.
  4. If you already have a device-profile database (e.g., from a fraud vendor) → add WebGL constraints as a verification layer.
  5. If you have no profile database → canvas fingerprinting is self-contained; WebGL constraints require a reference dataset.

Practical Scenarios

Scenario A: E-commerce checkout protection

Attackers use headless Chrome to automate card-testing. Canvas fingerprinting links repeat attempts across sessions. WebGL constraints catch the headless instances that spoof mobile user-agents but expose desktop GPU caps. Deploy both; use canvas for linking, WebGL for environment validation.

Scenario B: Ad-click fraud detection

Click farms use real phones. Canvas and WebGL both look legitimate. Behavioral signals (superhuman click speed, absence of mouse tremor, grid-aligned movement) become primary. BotRefund's suite includes ghost click detection, honeypot traps, robotic linear mouse movements, and superhuman input speed (<1ms) as complementary behavioral checks.

Scenario C: Account takeover prevention

Credential stuffing bots rotate residential proxies. Canvas fingerprinting identifies the same browser instance across IPs. WebGL constraints verify the device class hasn't changed impossibly (e.g., iPhone to Windows in seconds). Combine with impossible tab speed and window.open tamper checks for session-level anomalies.

Frequently Asked Questions

Can a bot spoof both canvas and WebGL simultaneously?

Yes, but it requires maintaining a consistent virtual GPU that matches the target device's rasterization quirks and constraint set. Most open-source stealth plugins do not achieve this; they focus on navigator properties and canvas noise. A determined attacker with a custom WebGL implementation (e.g., modified SwiftShader) could, but the maintenance cost is high.

Does WebGL texture constraint detection work on iOS Safari?

Yes. iOS exposes WebGL 1 and (since iOS 15) WebGL 2. The constraint values (e.g., MAX_TEXTURE_SIZE 4096 on A14–A17 GPUs) are stable and well-documented, making iOS spoofing detectable when a desktop browser claims those limits.

Is canvas fingerprinting considered personal data under GDPR?

Regulators have not issued a definitive ruling. A canvas hash that uniquely identifies a device over time may be considered personal data if it can be linked to an individual. Treat it as such: obtain consent or rely on legitimate interest for fraud prevention, document the balancing test, and provide an opt-out.

What happens if the user disables WebGL?

The constraint check returns no data. Treat the absence as a missing signal, not a negative signal. Fall back to canvas, behavioral, and network signals. BotRefund's architecture handles missing signals gracefully by cross-checking whatever evidence is available.

How often do WebGL constraints change for a real user?

Rarely. Driver updates can change supported compressed formats or maximum texture units. OS upgrades (e.g., macOS major version) may switch the GPU process model. A well-maintained profile database should refresh quarterly.

Can I implement WebGL texture constraint detection myself?

Yes. The API is standard: create a WebGL context, call getParameter() for the constants listed earlier, and compare against a device database. The hard part is building and maintaining that database across thousands of device-driver-OS combinations. Vendors like BotRefund invest in continuous profile collection.

Does BotRefund use canvas fingerprinting as well?

The source pack describes WebGL texture constraint as one of 106 independent checks. It does not enumerate the other 105. Industry practice suggests most multi-signal bot detectors include canvas fingerprinting alongside WebGL, audio context, font enumeration, and behavioral biometrics.

Further reading and comparison sources

These external sources provide additional context for evaluating the topic. Their inclusion is not an endorsement.

Learn more

Visit the website for more information.

Learn more