Skip to content

feat: enhance fingerprinting system with audio_v2, canvas_v2, WebGL2, and spoofing detection#91

Open
Copilot wants to merge 6 commits into
mainfrom
copilot/enhance-fingerprinting-system
Open

feat: enhance fingerprinting system with audio_v2, canvas_v2, WebGL2, and spoofing detection#91
Copilot wants to merge 6 commits into
mainfrom
copilot/enhance-fingerprinting-system

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 21, 2026

  • Analyze Fingerprint-OSS codebase and reference repos (creepjs, thumbmarkjs)
  • Create src/enhanced.ts with new fingerprinting functions
  • Update src/types.ts with new enhanced interfaces
  • Update src/systemInfo.ts to collect enhanced data
  • Export new functions from src/index.ts
  • Apply PR review feedback (audio, canvas fast paths, camelCase, non-enumerable, parallel, viewport)
  • Simplify 2-frame canvas stabilisation: always uses stable.set(frames[0].data) — the ternary was redundant since both branches returned data0[i]

Note

Add enhanced fingerprinting signals (audio_v2, canvas_v2, WebGL2, spoofing detection) to fingerprint collection

  • Adds getEnhancedAudioFingerprint using OfflineAudioContext with noise-injection detection via getChannelData/copyFromChannel comparison.
  • Adds getEnhancedCanvasFingerprint that renders multiple frames and applies per-byte majority voting to stabilise pixel noise before hashing.
  • Adds getEnhancedWebGL2Info collecting implementation limits, shader precision, and a hashed extension list from a WebGL2 context.
  • Adds detectSpoofing that aggregates headless/anti-fingerprinting indicators (e.g. missing window.chrome, navigator.webdriver, software renderer, screen heuristics) into a weighted score.
  • All signals are exposed via collectEnhancedFingerprint and attached as a non-enumerable enhanced property on SystemInfo, so JSON serialization and Object.keys() are unaffected.

Macroscope summarized 29726a1.

Copilot AI and others added 4 commits April 21, 2026 19:01
Agent-Logs-Url: https://github.com/IntegerAlex/fingerprint-oss/sessions/468aec40-8202-4659-95bf-c8644f4f9774

Co-authored-by: IntegerAlex <84370725+IntegerAlex@users.noreply.github.com>
…bGL2, spoofing detection

Agent-Logs-Url: https://github.com/IntegerAlex/fingerprint-oss/sessions/468aec40-8202-4659-95bf-c8644f4f9774

Co-authored-by: IntegerAlex <84370725+IntegerAlex@users.noreply.github.com>
…t Uint8Array hashing

Agent-Logs-Url: https://github.com/IntegerAlex/fingerprint-oss/sessions/468aec40-8202-4659-95bf-c8644f4f9774

Co-authored-by: IntegerAlex <84370725+IntegerAlex@users.noreply.github.com>
@netlify
Copy link
Copy Markdown

netlify Bot commented Apr 21, 2026

Deploy Preview for clever-starlight-3034ea failed. Why did it fail? →

Name Link
🔨 Latest commit 29726a1
🔍 Latest deploy log https://app.netlify.com/projects/clever-starlight-3034ea/deploys/69e7d15e9d2cb300082f9da6

@netlify
Copy link
Copy Markdown

netlify Bot commented Apr 21, 2026

Deploy Preview for fingerprint-oss failed. Why did it fail? →

Name Link
🔨 Latest commit 29726a1
🔍 Latest deploy log https://app.netlify.com/projects/fingerprint-oss/deploys/69e7d15e02025d00081a3489

@CLAassistant
Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

Comment thread src/enhanced.ts
Comment thread src/enhanced.ts Outdated
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR extends the fingerprinting pipeline by adding an optional enhanced namespace to SystemInfo, collecting additional (noise-stabilized / higher-entropy) signals and a spoofing/headless score while keeping existing outputs and hashing behavior backward-compatible.

Changes:

  • Adds src/enhanced.ts with audio_v2, canvas_v2, webgl2, spoofing detection, and entropy scoring, plus an aggregate collectEnhancedFingerprint().
  • Extends SystemInfo typing to include enhanced?: EnhancedFingerprintInfo.
  • Wires enhanced collection into getSystemInfo() and re-exports the new APIs/types via src/index.ts.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 6 comments.

File Description
src/enhanced.ts Implements enhanced signal collection (audio/canvas/WebGL2) + spoofing scoring + entropy estimates.
src/types.ts Adds new enhanced interfaces and attaches enhanced? to SystemInfo.
src/systemInfo.ts Calls collectEnhancedFingerprint() and stores result under systemInfo.enhanced.
src/index.ts Exposes enhanced functions/constants/types as named exports and on the default export object.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/enhanced.ts Outdated
Comment thread src/enhanced.ts Outdated
Comment thread src/types.ts Outdated
Comment thread src/systemInfo.ts Outdated
Comment thread src/systemInfo.ts Outdated
Comment thread src/enhanced.ts Outdated
@IntegerAlex
Copy link
Copy Markdown
Owner

@copilot apply changes based on the comments in this thread

Copilot AI and others added 2 commits April 21, 2026 19:33
…aths, camelCase keys, non-enumerable enhanced, parallel collection, viewport guard

Agent-Logs-Url: https://github.com/IntegerAlex/fingerprint-oss/sessions/84a490dd-5714-45ad-a17a-6e48d30f8eea

Co-authored-by: IntegerAlex <84370725+IntegerAlex@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Apr 21, 2026

@copilot apply changes based on the comments in this thread

Applied all review comments in commit 8500629 (plus a minor follow-up in 29726a1):

  1. Audio pre-render checkgetFloatFrequencyData now runs before startRendering() so it correctly tests pre-render silence state.
  2. Canvas fast paths – replaced per-byte Map allocations with: direct set() for 1 frame; set() for 2 frames (always prefer first frame as tie-break); branchless majority-vote (a===b||a===c?a:b===c?b:a) for 3 frames; reusable Uint16Array(256) counts buffer for N-frame generic fallback.
  3. camelCase keys – renamed audio_v2/canvas_v2/fp_versionaudioV2/canvasV2/fpVersion.
  4. Non-enumerable enhanced – attached via Object.defineProperty({enumerable: false}) so generateId/JSON.stringify are unaffected.
  5. Parallel collectioncollectEnhancedFingerprint() Promise is started before the first await in getSystemInfo().
  6. visualViewport guard – changed ||&&, added typeof screen !== 'undefined' guard.

Comment thread src/systemInfo.ts
Comment on lines +174 to +176
// baseline async signals (incognito, adBlocker, audio, webGL, cores).
const enhancedPromise = collectEnhancedFingerprint();

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟠 High src/systemInfo.ts:174

If any intermediate await (e.g., detectIncognito() at line 178) throws before line 256, enhancedPromise is never awaited, causing an unhandled promise rejection when collectEnhancedFingerprint() eventually rejects. This can crash Node.js configured with --unhandled-rejections=throw. Consider chaining .catch(() => {}) to enhancedPromise immediately after creation to suppress unhandled rejection warnings.

        // Start enhanced collection early so it runs in parallel with the
         // baseline async signals (incognito, adBlocker, audio, webGL, cores).
-        const enhancedPromise = collectEnhancedFingerprint();
+        const enhancedPromise = collectEnhancedFingerprint().catch(() => undefined);
 
         // Check for incognito mode
         const incognitoMode = await detectIncognito();
🚀 Reply "fix it for me" or copy this AI Prompt for your agent:
In file src/systemInfo.ts around lines 174-176:

If any intermediate `await` (e.g., `detectIncognito()` at line 178) throws before line 256, `enhancedPromise` is never awaited, causing an unhandled promise rejection when `collectEnhancedFingerprint()` eventually rejects. This can crash Node.js configured with `--unhandled-rejections=throw`. Consider chaining `.catch(() => {})` to `enhancedPromise` immediately after creation to suppress unhandled rejection warnings.

Evidence trail:
src/systemInfo.ts lines 175-178 (enhancedPromise creation and first intermediate await), lines 185, 207, 210, 217 (additional intermediate awaits), line 255 (where enhancedPromise is finally awaited), src/incognito.ts line 372 (`main().catch(reject)` showing detectIncognito can reject)

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fix it for me

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm working on the fix now. Adding .catch(() => undefined) to enhancedPromise to suppress unhandled rejection warnings.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was unable to create the branch macroscope/copilot/enhance-fingerprinting-system. This may be due to your branch protection rules. For more information, see the documentation at https://docs.macroscope.com/fix-it-for-me.

@IntegerAlex
Copy link
Copy Markdown
Owner

@macroscopeapp review

@IntegerAlex
Copy link
Copy Markdown
Owner

@macroscope-app review

@macroscopeapp
Copy link
Copy Markdown

macroscopeapp Bot commented Apr 21, 2026

Review in progress. Results will be posted when complete.

@IntegerAlex IntegerAlex marked this pull request as ready for review April 21, 2026 19:42
@IntegerAlex
Copy link
Copy Markdown
Owner

@macroscope-app review

@macroscopeapp
Copy link
Copy Markdown

macroscopeapp Bot commented Apr 21, 2026

Review in progress. Results will be posted when complete.

@macroscopeapp
Copy link
Copy Markdown

macroscopeapp Bot commented Apr 21, 2026

Approvability

Verdict: Needs human review

1 blocking correctness issue found. This PR introduces a significant new fingerprinting feature with ~700 lines of new code including audio fingerprinting via OfflineAudioContext, noise-stabilized canvas fingerprinting, WebGL2 signal collection, and spoofing/headless detection. As a substantial new capability with new public API surface, it warrants human review. Additionally, there is an unresolved high-severity comment identifying a potential unhandled promise rejection bug.

You can customize Macroscope's approvability policy. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants