Seatext library / BotRefund evidence
How to Implement Canvas Fingerprinting to Filter Bot Traffic on Your Corporate Network
Canvas fingerprinting works by rendering a hidden HTML5 canvas element, extracting its pixel data hash, and sending that hash to your edge or backend where requests with empty or default hashes are flagged as...
✓ Built for advertisers who need clear, refund-ready traffic evidence.
Canvas fingerprinting is a browser-based technique that identifies subtle differences in how devices render graphics. When a user visits a page, a script draws a hidden canvas with text, shapes, and colors. The exact pixels produced depend on the GPU, drivers, fonts, and operating system. Even tiny variations create a unique hash. This hash can help you distinguish real browsers from automated bots that often lack a full rendering stack.
For a corporate network, canvas fingerprinting adds a strong signal to your bot detection toolkit. It works alongside IP reputation, behavioral analysis, and device checks. This article walks through the implementation steps, explains the mechanics, and shows how to avoid common pitfalls.
Direct implementation steps
To add canvas fingerprinting to your corporate network, embed a small script on every page you want to protect. The script creates an off-screen canvas, draws a known pattern (text, shapes, or emoji), reads the pixel buffer with toDataURL() or getImageData(), hashes the result (SHA-256 is common), and posts the hash to your detection endpoint. On the server side, compare the hash against a baseline of known-good device hashes; hashes that are empty, match a generic headless-browser fingerprint, or deviate from the device's historical profile get flagged for challenge or block.
The core idea is that a real browser renders the canvas with hardware acceleration and system fonts. A headless browser or a virtual machine often produces a blank or overly uniform canvas. Even when a bot tries to spoof the canvas, the hash will not match the expected profile for the claimed device. This mismatch is what you are looking for.
Prerequisites
- A web server or edge worker that can receive and store the hash per session.
- A baseline dataset of legitimate device hashes for your user population (collect during a clean period).
- Ability to inject the script before other third-party scripts load, so the canvas renders in a consistent environment.
- Logging infrastructure to correlate the canvas hash with IP, user-agent, and behavioral signals.
- A policy for handling privacy and consent, as canvas fingerprints may be considered personal data under GDPR and CCPA.
You also need a way to update the baseline as your users upgrade browsers or change hardware. A static baseline will quickly become stale and cause false positives.
Step-by-step integration
- Create the fingerprint script. Keep it under 1 KB gzipped. Draw a deterministic string (e.g., "BotRefund canvas check") with a fixed font stack, size, and color. Add a few geometric shapes to increase entropy. Use a consistent canvas size, like 200x50 pixels, and a known background color.
- Hash the output. Use
canvas.toDataURL('image/png')and run a fast hash (SHA-256 via Web Crypto API). AvoidtoBlobfor broader compatibility. The hash should be a hex string that you can store and compare. - Send the hash. POST JSON
{sessionId, canvasHash, timestamp}to your collector endpoint. Usenavigator.sendBeaconfor reliability on page unload. Include the user-agent and a session ID so you can correlate later. - Build the allowlist. During a two-week learning window, store every hash seen from authenticated employees. Cluster by device model and OS version. You can use a simple dictionary or a more advanced clustering algorithm. The goal is to know what a normal device looks like.
- Enforce. After the learning window, reject or challenge requests where the hash is missing, matches a known headless fingerprint (empty canvas, all-zero pixels), or falls outside the device's cluster. Start with a challenge (e.g., a CAPTCHA) before blocking outright.
- Cross-check. Treat the canvas signal as evidence, not a verdict. BotRefund's approach keeps the signal as one objective fact and cross-checks it against 105 other independent checks before scoring a visit. This reduces false positives from privacy tools or unusual devices.
Each step has its own pitfalls. For example, if you draw the canvas after the page loads, the browser may have already changed the rendering context. Always run the script early, ideally in the head with defer disabled. Also, ensure the canvas is truly hidden—use position: absolute; left: -9999px rather than display: none, because some browsers skip rendering for hidden elements.
How BotRefund uses the Empty Font Canvas check
BotRefund's Empty Font Canvas signal is one of 106 independent checks. It renders a hidden canvas and looks for a mismatch between the reported fonts, GPU, and OS details. A normal browser reports hardware, graphics, fonts, and OS details that naturally fit together for that device. Virtual machines and spoofed profiles often claim one device while their graphics, fonts, audio, or processor behavior tell another story. BotRefund keeps this signal as evidence—not a verdict—and cross-checks it against independent browser, network, device, and behavior data. Their prediction AI weighs the complete pattern instead of trusting a raw rule, achieving 99% accuracy through corroboration.
This approach matters because a single anomaly is not a bot verdict. Privacy tools, travel, corporate networks, and unusual devices can produce unexpected behavior for genuine people. For example, a user on a corporate VPN might have a different IP and a slightly different canvas hash due to remote desktop rendering. BotRefund's model sees that the other signals (mouse movement, session length, click patterns) are human, so it does not block the session.
In practice, BotRefund's Empty Font Canvas check is not a standalone script you can extract. It is part of a larger system that collects dozens of signals. The value comes from the corroboration. If you are building your own system, you should follow the same principle: never rely on canvas fingerprinting alone.
Key facts
| Fact | Detail |
|---|---|
| Signal name | Empty Font Canvas |
| Total independent checks | 106 |
| Detection principle | Mismatch between reported device profile and actual canvas rendering |
| Decision model | AI prediction weighing complete pattern across browser, network, device, behavior |
| Reported accuracy | 99% |
| Single-anomaly policy | Not a bot verdict; kept as evidence and cross-checked |
| Setup time for BotRefund script | About one minute |
| Example bot rate | 19% average in a case study (Digitopia) |
| Refund example | $18,200 recovered for Digitopia |
These facts come from BotRefund's public materials. They show that canvas fingerprinting is most effective when combined with other signals. The 99% accuracy figure is not a guarantee for your specific network; it depends on the diversity of your user base and the quality of your baseline.
Limitations and when this advice does not apply
- Canvas fingerprinting alone produces false positives on privacy-hardened browsers, corporate VDI, and legitimate headless testing tools.
- Sophisticated bots can replay captured valid hashes or use real browser engines with automation layers.
- Mobile app webviews may render canvas differently than desktop browsers, requiring separate baselines.
- Regulations such as GDPR and CCPA may classify canvas fingerprints as personal data; disclose and obtain consent where required.
- The source pack does not provide implementation code, hash algorithms, or baseline collection tooling—those are engineering tasks for your team.
- If your corporate network uses a proxy that modifies headers or injects scripts, the canvas rendering may change, causing false mismatches.
This advice is not a one-size-fits-all solution. For a small internal tool with a known device fleet, you might get away with a simple hash comparison. For a public-facing site with millions of visitors, you need a more robust system that adapts to new devices and browser updates.
Common mistakes
- Blocking on the first anomalous hash without a learning window.
- Using a single canvas draw call; simple draws are easier to spoof.
- Ignoring font-stack differences across OS versions, which shifts the hash for legitimate users.
- Failing to correlate the canvas hash with IP reputation, behavioral biometrics, and network signals.
- Storing hashes without a retention policy, creating privacy liability.
- Not updating the baseline after browser updates or new device rollouts.
- Using
display: nonefor the canvas, which may cause the browser to skip rendering.
Each mistake can lead to either false positives (blocking real users) or false negatives (letting bots through). The learning window is especially critical. Without it, you will block users who have a slightly different GPU driver or a new browser version.
Verification step
After deployment, run a controlled test: visit a protected page from a known-good corporate laptop, a headless Chrome instance, and a residential proxy. Confirm the corporate laptop hash falls inside its device cluster, the headless instance produces an empty or generic hash, and the proxy device shows a hash mismatch with its claimed user-agent. Log the results and tune the cluster thresholds before enabling enforcement.
You should also test with a privacy-focused browser like Firefox with resist fingerprinting enabled. That browser will produce a different hash each time, which is a sign that your system should not rely solely on canvas. Instead, it should treat the hash as one of many signals.
Finally, monitor your false positive rate after go-live. If you see a spike in challenges for legitimate users, adjust the thresholds or add more cross-checks.
FAQ
Why does BotRefund use 106 checks instead of just canvas fingerprinting?
A single anomaly is not a bot verdict. Privacy tools, travel, corporate networks, and unusual devices can produce unexpected behavior for genuine people. BotRefund keeps each signal as evidence and cross-checks it against independent browser, network, device, and behavior data.
What happens if a legitimate user gets an anomalous canvas hash?
The signal is weighed by the AI prediction model alongside all other signals. An isolated canvas mismatch rarely triggers a block; the complete pattern must indicate automation.
Can I use BotRefund's canvas check without their full suite?
The source pack describes the Empty Font Canvas check as part of BotRefund's integrated detection system. The standalone script is not distributed separately; the value comes from corroboration across all 106 checks.
How long does it take to add BotRefund to a site?
About one minute. No credit card is required for the free bot audit.
What ad platforms does BotRefund support for refund claims?
Google and Meta. BotRefund proves bot clicks, negotiates with the platforms, and gets money back for clients.
Does canvas fingerprinting work on mobile app webviews?
Mobile webviews can render canvas differently. Build separate baselines for each app-webview combination you support, or rely on cross-checked signals that are less sensitive to rendering variance.
What is the typical bot click rate BotRefund sees?
Case studies show an average 19% bot click rate across industries, with refunds ranging from $15,000 to over $1 million depending on ad spend.
How do I handle privacy regulations when storing canvas hashes?
Canvas hashes can be considered personal data. Disclose their use in your privacy policy, obtain consent where required, and set a retention period. Anonymize the hashes if possible, and never combine them with other identifiers without a legal basis.
Can canvas fingerprinting be bypassed by advanced bots?
Yes. Some bots use real browser engines and replay valid hashes. That is why you need multiple signals. Canvas fingerprinting is a strong signal, but it is not foolproof.
What is the best way to integrate canvas fingerprinting with my existing WAF?
Most WAFs allow custom rules. You can send the canvas hash as a header or cookie, then write a rule that blocks or challenges requests with missing or anomalous hashes. However, you must ensure the WAF does not strip the header. Test thoroughly.
Further reading and comparison sources
These external sources provide additional context for evaluating the topic. Their inclusion is not an endorsement.
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.