Skip to content

feat: add persistent fingerprint seeds#606

Open
PopcornDev1 wants to merge 10 commits into
daijro:mainfrom
VulpineOS:feat/persistent-fingerprint-seed
Open

feat: add persistent fingerprint seeds#606
PopcornDev1 wants to merge 10 commits into
daijro:mainfrom
VulpineOS:feat/persistent-fingerprint-seed

Conversation

@PopcornDev1

Copy link
Copy Markdown
Contributor

Summary

Adds an optional fingerprint_seed parameter for Camoufox-generated
fingerprints so callers can reproduce stable generated identity values across
launches and browser contexts.

Related issues/discussions:

This is intentionally Python/API-level only. It does not include browser engine,
C++, TLS, networking, or renderer-level fingerprinting changes.

Motivation

Camoufox is good at generating fresh fingerprints, but persistent profiles need
a way to keep generated fingerprint values stable across restarts. Several users
have reported that cookies/storage can persist while generated fingerprint
surfaces still rotate, causing CreepJS/fingerprint IDs or browser identity
signals to change between runs.

fingerprint_seed gives callers a stable generation input while preserving the
current random-by-default behavior when no seed is supplied.

What Changed

  • Added deterministic seed derivation helpers in pythonlib/camoufox/ & fingerprint_seed.py.
  • Added optional fingerprint_seed support to:
    • launch_options()
    • sync NewContext()
    • async AsyncNewContext()
    • generate_context_fingerprint()
    • BrowserForge generation/conversion
    • WebGL sampling
  • Supports str, int, and bytes seeds.
  • Rejects unsupported seed types such as bool.
  • Uses versioned, length-prefixed SHA-256 material to derive independent
    namespace-specific sub-seeds.
  • Keeps unseeded behavior random.
  • Ensures fingerprint_seed is consumed by Camoufox and not forwarded to
    Playwright.
  • Avoids unsupported context-level canvas setter calls in generated init
    scripts.
  • Adds a macOS .app bundle fallback for locating properties.json.

Seeded Surfaces

Seeded generation now covers Camoufox-owned generated values including:

  • BrowserForge sampling
  • preset selection
  • OS choice where applicable
  • WebGL sampling
  • font and voice subsets
  • screen offset sampling
  • window.history.length
  • audio/canvas/font spacing config seeds

Compatibility / Caveats

  • Existing callers are unaffected unless they pass fingerprint_seed.
  • fingerprint_seed controls generated fingerprint values only.
  • It does not persist cookies, local storage, cache, or browser profile state.
  • Persistent state should still use a stable user_data_dir / persistent
    context.
  • Context-level seeds apply only to surfaces exposed by the current per-context
    init-script path.
  • This PR does not change TLS, proxy, network, or renderer-level behavior.

Testing

Regression tests added for:

  • deterministic seed derivation
  • namespace/type separation
  • invalid seed input handling
  • sync and async context API forwarding
  • deterministic launch config generation
  • deterministic context fingerprint generation
  • different seeds producing different noise values
  • unseeded launch/context paths remaining randomized
  • BrowserForge stability with concurrent seeded and unseeded calls
  • macOS app bundle properties.json fallback

Local checks run:

PYTHONDONTWRITEBYTECODE=1 PYTHONPATH=pythonlib python3 -m pytest
--confcutdir=tests/patches tests/patches/fingerprint-seed.py tests/patches/
context-api-seed.py tests/patches/context-fingerprint-seed.py tests/patches/
launch-options-seed.py tests/patches/live-fingerprint-seed.py

Result:

18 passed, 2 skipped

Dogfooding

This branch is being dogfooded in VulpineOS for long-lived agent identities:

  • stable profile/account identifier -> fingerprint_seed
  • stable browser profile directory -> user_data_dir
  • generated Camoufox fingerprint values stay reproducible across restarts
  • cookies/storage/profile state remain handled separately by the persistent
    profile layer

@PopcornDev1

Copy link
Copy Markdown
Contributor Author

@icepaq

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.

1 participant