Repository navigation
fix(browser): improve Cloudflare Turnstile compatibility - #885
Merged
Merged
Conversation
…browser
Cloudflare Turnstile challenges fail with error 600010 ("bot behavior
detected") in Orca's embedded browser. Multiple detection vectors
contribute to this:
1. Navigation guard blocks blob: URLs that Turnstile uses to load
challenge resources inside iframes.
2. Anti-detection script injection via executeJavaScript on
did-start-navigation runs on the OLD page context — overrides are
never present when the new page loads.
3. CDP proxy endpoints leak "Orca/CdpWsProxy" and "Orca/Electron"
identifiers.
4. User-Agent contains "Electron/X.X.X" and the app name even without
an imported browser session.
5. Permission check handler returns false for all non-clipboard
permissions, making the fingerprint look bot-like.
Fixes:
- Allow blob: URLs through the navigation guard
- Switch to CDP Page.addScriptToEvaluateOnNewDocument for reliable
pre-page-JS injection (re-attaches after debugger detach)
- Extract shared anti-detection script with expanded signals:
navigator.webdriver, plugins, chrome.csi/loadTimes, Notification
permission, navigator.languages
- Mask CDP proxy identifiers as Chrome/Headless
- Strip Electron/app tokens from default UA and non-default partitions
- Widen passive permission checks to reduce bot-detection signal
- Extract UA/Client-Hints helpers to browser-session-ua.ts
- Add disposed flag and cleanup function to injectAntiDetection to prevent re-attach after guest teardown; wire cleanup into policyCleanupByGuestId - Increase re-attach delay from 100ms to 500ms to avoid racing with CDP proxy/bridge mid-restart - Tighten blob: URL passthrough to require http(s) origin, blocking blob:null and other opaque-origin blobs - Replace "Chrome/Headless" with real Chromium version from process.versions.chrome in CDP proxy endpoints - Revert widened setPermissionCheckHandler (returns 'granted' not 'prompt'); move permission masking to anti-detection script where Permissions.prototype.query can return the correct 'prompt' state - Switch from dynamic require to top-level import for anti-detection module in browser-manager
Contributor
|
looking into it |
4 tasks done
6 tasks done
Jinwoo-H
added a commit
that referenced
this pull request
Sep 5, 2026
…le clears (#18749) Orca rewrote every browser session's UA to look like plain Chrome by stripping the Electron and app tokens. That rewrite is what Cloudflare rejects: a Chrome UA that ships no client hints reads as a spoof and Turnstile returns 600010, while the same binary on the same IP clears every challenge with its stock UA. PR #885 added the rewrite to fix 600010 and was treating a symptom it created; issue #11518 later found the same rewrite is what broke Google sign-in. - Keep the stock Electron UA on every partition. The webRequest handler now only owns the host-scoped Google auth Firefox switch, which stays unchanged. - Delete the anti-detection script. Measured on Electron 43: plugins are already a real PluginArray, window.chrome exists, and navigator.webdriver is false even with the debugger attached, so three of its four premises were wrong, and the overrides it installed (instance-level webdriver, non-native Permissions.query, stubbed chrome.csi/loadTimes) are themselves published bot signatures. - Stop attaching a CDP debugger to every browsing guest. Only the auth-UA detach listener remains, because a detach clears Chromium's standing UA override. - Stop sending Runtime.enable into cross-origin iframes when the agent bridge auto-attaches. The challenge widget is one, nothing reads iframe Runtime events, and the Runtime domain's serialization side effect is the documented Cloudflare CDP tell. - Add a real-Electron test proving the wire identity: stock UA to ordinary hosts, Firefox with no client hints to accounts.google.com. Verified in the dev build: dash.cloudflare.com/login no longer shows "There was a problem with verification" and scrapingcourse.com's managed challenge clears, both failing deterministically before. Fixes #13822
enrick-dev
pushed a commit
to enrick-dev/orca
that referenced
this pull request
Oct 15, 2026
enrick-dev
pushed a commit
to enrick-dev/orca
that referenced
this pull request
Oct 15, 2026
…le clears (stablyai#18749) Orca rewrote every browser session's UA to look like plain Chrome by stripping the Electron and app tokens. That rewrite is what Cloudflare rejects: a Chrome UA that ships no client hints reads as a spoof and Turnstile returns 600010, while the same binary on the same IP clears every challenge with its stock UA. PR stablyai#885 added the rewrite to fix 600010 and was treating a symptom it created; issue stablyai#11518 later found the same rewrite is what broke Google sign-in. - Keep the stock Electron UA on every partition. The webRequest handler now only owns the host-scoped Google auth Firefox switch, which stays unchanged. - Delete the anti-detection script. Measured on Electron 43: plugins are already a real PluginArray, window.chrome exists, and navigator.webdriver is false even with the debugger attached, so three of its four premises were wrong, and the overrides it installed (instance-level webdriver, non-native Permissions.query, stubbed chrome.csi/loadTimes) are themselves published bot signatures. - Stop attaching a CDP debugger to every browsing guest. Only the auth-UA detach listener remains, because a detach clears Chromium's standing UA override. - Stop sending Runtime.enable into cross-origin iframes when the agent bridge auto-attaches. The challenge widget is one, nothing reads iframe Runtime events, and the Runtime domain's serialization side effect is the documented Cloudflare CDP tell. - Add a real-Electron test proving the wire identity: stock UA to ordinary hosts, Firefox with no client hints to accounts.google.com. Verified in the dev build: dash.cloudflare.com/login no longer shows "There was a problem with verification" and scrapingcourse.com's managed challenge clears, both failing deterministically before. Fixes stablyai#13822
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
executeJavaScriptondid-start-navigation(runs on old page) to CDPPage.addScriptToEvaluateOnNewDocument(persists across navigations, runs before page JS)chrome.csi(),chrome.loadTimes(),Notification.permission,navigator.languagesOrca/CdpWsProxy→Chrome/Headless)browser-session-ua.tsContext
Cloudflare Turnstile challenges fail with error 600010 ("bot behavior detected") in Orca's embedded browser (issue #107). This was caused by multiple detection vectors: blocked blob: URLs, missing anti-detection overrides due to injection timing, leaked Electron identifiers, and suspicious permission fingerprints.
Note: Turnstile uses deep runtime fingerprinting that no public Electron app has reliably bypassed. These fixes address the most impactful detection vectors but may not fully resolve all Turnstile challenges — the error may also be influenced by site-side Turnstile configuration (e.g., PropelAuth's security level).
Test plan
pnpm run typecheckpassespnpm run testpasses (209/210, 1 pre-existing flaky test in codex-accounts)https://auth.propelauth.com/challengein embedded browser and attempt Turnstile verificationChrome/Headlessinstead ofOrca/CdpWsProxy