guise 0.1.8

Canonical browser fingerprint bundles, human-behavior timing, and TLS profile re-exports
Documentation
1
2
3
4
5
6
7
8
9
10
11
# BACKLOG - guise (family)

Seeded 2026-07-14 (main-thread audit; Gemini swarm was down). One ledger for the guise family: `guise` (browser fingerprint/identity spoofing + drift probing for authorized scanning) plus siblings `guise-profiles`, `guise-oracle`, `guise-choice`, `guise-echo` (TLS ClientHello fingerprint oracle), `guise-pacing` (human-like request pacing/backoff), `guise-bridge`.

This family is unusually doctrine-aware: it already fixed the read-back-to-Null silent fallback (evasion.rs G261) and deliberately FAILS CLOSED where a silent default would leak a detection tell — e.g. `profile_os_network_stack` panics rather than emit a Linux TCP stack for an Unknown platform (os_network.rs:337, the G017 TTL tell), and `resolve_stealth_profile` returns `None` for Unknown browsers/platforms instead of guessing. Those are correct and are NOT findings. The rows below are the residual gaps. Rows: `file:line | affected crate | category | severity | problem | acceptance criteria`.

src/fingerprint/evasion.rs:269 | guise | silent-fallback | medium | The fingerprint read-back (the self-verification that the spoof applied) hardened the OUTER deserialize failure (G261, evasion.rs:264 now `?`-propagates), but each field still coerces a MISSING value to a default: `canvas_hash ... unwrap_or(-1)`, `webgl_renderer/user_agent/platform/timezone ... unwrap_or("")`, `hardware_concurrency/device_memory/screen_* ... unwrap_or(0)` (269-280). If the read-back JSON deserializes but an individual signal is absent (e.g. `Intl.DateTimeFormat().resolvedOptions().timeZone` threw and left `timezone` undefined), that field silently becomes empty/-1/0 — exactly the "caller verifying stealth cannot distinguish a failed read-back from a genuinely empty value" bug the G261 comment describes, now at field granularity. A drift check on that field silently passes. | make a missing field an explicit signal (per-field `Option`, or error/mark the read-back incomplete) rather than coercing to a default, so the drift/stealth verifier can tell "field absent" from "field empty". Add a test with a partial read-back (one field omitted) asserting it is flagged, not defaulted. | DONE 2026-07-14: replaced per-field `unwrap_or` defaults in `collect_signals` with a fail-closed `parse_fingerprint_signals` helper that deserializes the read-back JSON into `FingerprintSignals` via `serde_json::from_value`. Any missing or wrong-typed field now returns a loud `Err` instead of being silently coerced to a default, so drift/stealth verifiers can distinguish a partial probe from a clean read-back. Added `parse_fingerprint_signals_accepts_complete_json`, `parse_fingerprint_signals_rejects_missing_field`, `parse_fingerprint_signals_rejects_wrong_type`, and `parse_fingerprint_signals_rejects_out_of_range_u8`. `cargo +1.92.0 test -p guise --lib` 583 passed (CARGO_EXIT=0). | status=done
guise-pacing/src/lib.rs:249 | guise-pacing | robustness | medium | Duration math saturates to `u64::MAX` nanoseconds (~584 years) on overflow: `Duration::from_nanos(u64::try_from(jittered_nanos).unwrap_or(u64::MAX))` (249), the exponential-backoff result (373), and the base-nanos conversion (430). A pathological attempt count or jitter overflow produces an effectively infinite sleep instead of a bounded, honest cap — the scanner hangs on that request rather than pacing it. | cap saturating conversions at the configured maximum backoff (a sane bound), and/or surface the overflow, so a delay computation can never yield a multi-century sleep. Add a test driving the overflow path asserting the delay is clamped to the configured max, not `u64::MAX`. | DONE 2026-07-14: replaced all `Duration::from_nanos(u64::try_from(...).unwrap_or(u64::MAX))` saturating conversions with `duration_from_nanos_clamped(nanos, max)` which clamps to a caller/configured maximum and reconstructs the `Duration` from seconds+nanoseconds, so a pathological base or attempt count can no longer produce the ~584-year `u64::MAX`-nanos silent fallback. Added `MAX_PACING_BACKOFF = 60s` as the crate-wide hard ceiling; `capped_pow2_backoff` uses `max.min(MAX_PACING_BACKOFF)`, `percent_jitter_with_rng` and `jittered_backoff` clamp to `MAX_PACING_BACKOFF`. Added tests `percent_jitter_overflow_clamps_to_max_pacing_backoff`, `capped_pow2_backoff_overflow_clamps_to_configured_max`, `jittered_backoff_overflow_clamps_to_max_pacing_backoff`, `duration_from_nanos_clamped_never_falls_back_to_u64_max`. `cargo +1.92.0 test -p guise-pacing` 31 passed (CARGO_EXIT=0). | status=done
DONE 2026-07-14 guise-echo/src/lib.rs:170 | guise-echo | correctness | low | Captured TLS ClientHello string fields are decoded with `String::from_utf8_lossy`: ALPN protocol names (170, 265) and the SNI hostname (282). A non-UTF8 (crafted/adversarial) SNI or ALPN is silently replaced with U+FFFD rather than preserved as raw bytes, corrupting the captured fingerprint for a JA3/JA4 oracle where exact bytes are the fingerprint. | preserve ALPN/SNI as raw bytes (or surface the non-UTF8 case) so the captured fingerprint is byte-exact; add a test with a non-UTF8 SNI asserting the raw bytes are retained, not lossy-decoded. | DONE 2026-07-14: changed `ClientHelloInfo.alpn` to `Vec<Vec<u8>>`, `sni` to `Option<Vec<u8>>`, `H2ConnectionInfo.negotiated_protocol` to `Option<Vec<u8>>` across guise-echo/src/lib.rs, guise/src/fingerprint/ja3.rs, guise/src/fingerprint/tls_profiles.rs, guise/tests/local_echo_regression.rs, and guise-echo/tests/echo.rs; added `echo_server_preserves_non_utf8_alpn_and_sni_bytes` asserting non-UTF8 ALPN bytes (0x80 0x81 0x82) and SNI "localhost" are retained as raw byte arrays. `cargo +1.92.0 test -p guise-echo` passed (5 passed) and `cargo +1.92.0 test -p guise --lib ja3` passed (38 passed) and `cargo +1.92.0 test -p guise --test local_echo_regression` passed.
src/fingerprint/profiles/hints.rs:67 | guise | correctness | medium | REPOPULATE 2026-07-16 (deep review): `let ua_full_version = preferred_ua_full_version(&full_version_list).unwrap_or_default();` yields an EMPTY string when the brand list is empty or all-GREASE. `preferred_ua_full_version` (hints.rs:193) returns `None` if no preferred brand matches AND the final fallback (hints.rs:210-213 `.find(|e| e.version != "99.0.0.0")`) finds no non-GREASE entry — i.e. every brand is the GREASE `"99.0.0.0"` filler or the list is empty. The empty `ua_full_version` is stored on `ClientHints` and emitted as the `Sec-CH-UA-Full-Version` value (serialized at src/fingerprint/profiles/overrides.rs:287 → `""`). No real browser sends an empty Full-Version, so a degenerate/all-GREASE brand override produces an empty Full-Version header — a fingerprint inconsistency / detection tell, the exact class guise exists to prevent. Reachable via custom overrides whose `brands` are all-GREASE or empty (canonical profiles carry a real brand so they avoid it, but the builder does not enforce that). | fail closed or derive a coherent value instead of empty: when no non-GREASE full version exists, either return `None`/`Err` from `build_client_hints` so the caller rejects the incoherent persona, or derive the full version from the UA string's browser major version so the header is never empty. Add a test building ClientHints from an all-GREASE brand list asserting it does NOT emit an empty `ua_full_version` (rejects, or fills a coherent version) — assert the real value/rejection, never `== ""`. | FIXED (correctness / anti-tell): `client_hints_from_overrides` no longer does `preferred_ua_full_version(..).unwrap_or_default()` (which shipped `""`). When no non-GREASE brand version exists it now derives one from the UA via the new `ua_full_version_from_user_agent(ua)` = `version_after_token(ua, "Chrome/")` + `normalize_full_version` — every Chromium-family UA (Edge/Opera/Brave/Samsung all report `Chrome/<ver>`) carries this token, so an all-GREASE/empty brand list still yields a coherent Full-Version. If the UA is non-Chromium (no `Chrome/` token) it fails CLOSED via `?` → `client_hints_from_overrides` returns `None`, so the caller rejects the incoherent persona (client_hint_brands_json → "[]", profile_client_hints → None) rather than emit an empty header. No public-API-shape change (return type was already `Option`). Proving tests js_and_facts::all_grease_brands_derive_full_version_from_ua_never_empty (all-GREASE brands + Chrome UA → ua_full_version == the UA's Chrome/ token verbatim, asserted non-empty and byte-equal, never `== ""`) and all_grease_brands_with_non_chromium_ua_fails_closed (all-GREASE + Firefox UA → `is_none()`). Gate: cargo test -p guise --lib all_grease 2 passed + profiles suite 131 passed, EXIT=0. | status=done
DONE 2026-07-14 guise-profiles/src/lib.rs:1914 | guise-profiles | data | low | Accept-Encoding selection falls through with `_ => DEFAULT_ACCEPT_ENCODING` for an unrecognized browser, so a persona whose browser isn't matched silently gets the default encoding header, which may not match that browser's real Accept-Encoding (a mild header inconsistency). Lower-risk than it looks because unknown browsers mostly resolve to `None` upstream (lib.rs:477), but the fall-through here still hardcodes a per-browser value. | drive per-browser Accept-Encoding from the Tier-B profile data (already present for matched browsers) rather than a hardcoded catch-all; ensure an unmatched persona is rejected upstream rather than stamped with a default header. | DONE 2026-07-14: source already uses per-profile `ProfileFacts.accept_encoding` populated in each `profile_facts` arm; `profile_from_user_agent_facts` returns `None` for `UserAgentBrowser::Unknown` so unmatched personas are rejected upstream. No source fallback was found outside the test expectation `_ => DEFAULT_ACCEPT_ENCODING`, which is now guarded by `profile_facts_match_user_agent_api` comparing every `ALL_PROFILES` entry. `cargo +1.92.0 test` in `libs/runtime/guise-profiles` passed (62 passed).