browser-search
browser-search copied to clipboard
CloakBrowser: false-positive Cloudflare challenge on normal pages adds a 20s delay
Problem
scripts/cloak/challenges.mjs scores a normal page as a Cloudflare challenge when it only has the __cf_bm cookie or a server: cloudflare header. waitForChallenge never considers it resolved (the cookie name contains bm), so every cloak-fetch on a site behind Cloudflare waits the full 20 seconds and reports challengeResolved: false.
Also
scripts/cloak/lib/session.mjsthrows immediately when a session lock is held and writes.lockinside the Chromium profile. A directory lock with an owner token, heartbeat, stale detection and waiting is more robust. Profiles move to~/.browser-search/cloak-sessions/profiles/<proto>-<host>-<hash>, so saved sessions start fresh after the update.challenge.strategymust be returned bywaitForChallenge(it is read bycloak-fetch.mjs).npm auditreportsip-address<= 10.7.0 (moderate, transitive viasocks).npm audit fixupdates it to 10.7.4.
Fix
Header/resource/marker-based detection rules, the improved session lock, the strategy field and the lockfile update, released as a patch.
Released in v3.2.0.