Repository navigation
fix(browser): enforce RPC target/generation auth, track OOPIFs & contextId, fix wait spin, and bound payloads/cancel - #298
Merged
Conversation
…hed servers and block check_cdp contextId/userGesture
…& pinned contextId, fix wait deadline spin, and bound payloads/cancel
…te-dual-route-cdp # Conflicts: # apps/desktop/src/surfaces/browser/mod.rs # crates/browser-pane/src/protocol.rs
…ools/fix-rpc-auth-bounds
…wser agent RPC inventory and tab resolution
…ow sticky suppression, and harden CdpCall/check_cdp
…ools/fix-rpc-auth-bounds # Conflicts: # crates/opencode-kit/src/client/browser_rpc/machine.rs
…pinned context/256-frame overflow, recheck post-capture auth, and fix OOPIF/cancel/bounds
…te-dual-route-cdp # Conflicts: # apps/browser-engine/src/engine.rs
… 800-line ceiling
…ools/fix-rpc-auth-bounds # Conflicts: # apps/browser-engine/src/engine.rs # apps/browser-engine/src/handlers.rs # apps/browser-engine/src/wire.rs # crates/browser-pane/src/client.rs # crates/browser-pane/src/machine.rs # crates/browser-pane/src/protocol.rs
…ledger.rs to stay under 1500-line ceiling
…Blocked::Replaced suppressed
…te-dual-route-cdp # Conflicts: # apps/desktop/src/surfaces/browser/mod.rs # crates/browser-pane/src/client.rs # crates/browser-pane/src/protocol.rs
…te-dual-route-cdp
…egacy MCP until Unsupported/Unavailable, and fix #292 merge regressions
…ools/fix-rpc-auth-bounds # Conflicts: # apps/browser-engine/src/downloads.rs # apps/browser-engine/src/engine.rs # apps/browser-engine/src/main.rs # crates/browser-pane/src/find.rs
Hona
added a commit
that referenced
this pull request
Nov 20, 2026
- Fold security-confirmed merged PRs #292 (6d7a6ed, WS-1 mandatory RemoteServer proxy), #294 (ae3e910, BROWSER-UI file-link/click-to-run fix with known symlink/junction root limitation), and #274 (5da6474, WS-9 engine MV3 extension host, inert without --extension flags) - Update browser Reviewed column: #301 in rework (#287 eager-attach time_updated regression still live on dev), #296/#298/#302/#303/#305/#306 in rework, #307 open for pre-merge security review - Audit upstream anomalyco/opencode fe8def6854..4122af0206 (+2 commits: 1 skipped #65255 core/codemode, 1 added UP-135 #65215 -> WS-8)
…te-dual-route-cdp # Conflicts: # apps/browser-engine/src/engine.rs # crates/browser-policy/src/lib.rs
…te-dual-route-cdp
…ools/fix-rpc-auth-bounds # Conflicts: # apps/browser-engine/src/engine.rs # apps/browser-engine/src/handlers.rs # apps/browser-engine/src/wire.rs # apps/desktop/src/surfaces/browser/rpc/mod.rs
…te-dual-route-cdp # Conflicts: # apps/desktop/src/plugin_host/native/browser/scope.rs # crates/browser-pane/src/client.rs
… subframe enumeration, WHATWG target URL, required contextId, bounded CdpResponse IPC)
…ools/fix-rpc-auth-bounds # Conflicts: # apps/desktop/src/surfaces/browser/rpc/exec/nav.rs # apps/desktop/src/surfaces/browser/rpc/mod.rs
…e.getFrameTree stubs and fix BrowserRpcState field visibility
Base automatically changed from
browser-tools/fix-remote-dual-route-cdp
to
dev
November 20, 2026 21:15
…auth-bounds # Conflicts: # apps/desktop/src/surfaces/browser/rpc/mod.rs # crates/opencode-kit/src/client/browser_rpc/machine.rs
…meTree, remove dup flush, depth-1 CDP scan
…auth-bounds # Conflicts: # apps/desktop/src/surfaces/browser/rpc/exec/nav.rs
|
PR test build retired — merged into |
…ds and drop >16 MiB CDP events pre-parse
…to cdp_ledger.rs
…ter verbatim move
Hona
added a commit
that referenced
this pull request
Nov 21, 2026
…ion (#302) * fix(browser): refuse local rune_mcp browser tools on remote/RPC-attached servers and block check_cdp contextId/userGesture * fix(browser): enforce RPC target/generation auth, track OOPIF frames & pinned contextId, fix wait deadline spin, and bound payloads/cancel * fix(web): gate browser rpc suppression check on wasm32 * fix(browser): exclude ContextKind::Private tabs from experimental.browser agent RPC inventory and tab resolution * fix(browser): harden TunnelProxy HTTP/1.1 framing, wire remote tunnel proxy to SetPartitionProxy, and add BuiltinPromptGate * fix(browser): gate native scope.rs on MCP suppression, track per-window sticky suppression, and harden CdpCall/check_cdp * fix(browser): verify TypedCdpCall ledger in engine, fail closed on unpinned context/256-frame overflow, recheck post-capture auth, and fix OOPIF/cancel/bounds * fix(browser): expand loopback_host IPv4/IPv6/alternate-encoding detection * refactor(browser-policy): move loopback_host helpers into agent.rs to stay under 800-line ceiling * fix(browser): clean FIN shutdown after 503 Service Unavailable on TunnelProxy concurrency cap * fix(browser): fail closed in engine ContextPool for RemoteServer, atomic tunnel rotation/suspend, host proxy validation, and Luau loopback_host * refactor(browser-policy): extract check_cdp into cdp.rs to stay under 800-line ceiling * refactor(browser-engine): extract CdpCall validation helper into cdp_ledger.rs to stay under 1500-line ceiling * fix(browser): retry tab CDP bootstrap after isolated context finishes initializing * fix(browser): check suspended state in ConnGuard::track_abort and bidirectional EOF path * fix(browser): close scope.rs task.spawn/NormalizeUrl escape and keep Blocked::Replaced suppressed * refactor(browser-pane): move send_cdp into find.rs to stay under 1500-line ceiling * fix(browser): gate all non-builtin plugins in scope.rs, fail closed legacy MCP until Unsupported/Unavailable, and fix #292 merge regressions * fix(browser): verify Tier::Bundled on Half and add sticky legacy MCP capability probe * fix(browser): close #298 Round-2 findings (fail-closed frameID, OOPIF subframe enumeration, WHATWG target URL, required contextId, bounded CdpResponse IPC) * fix(browser): preserve committed OOPIF child URLs across ancestor Page.getFrameTree stubs and fix BrowserRpcState field visibility * fix(browser): close #302 tunnel smuggling/DoS/SSE-suspend findings and port complete BuiltinPromptGate * fix(browser): use url crate for WHATWG URLs, rebuild frames on getFrameTree, remove dup flush, depth-1 CDP scan * fix(browser): refresh OOPIF frame trees in browser.frames * fix(browser): split prompt gate out of #302 and add tunnel watchdog + unauth pool isolation * fix(browser): verify live Page.getFrameTree before/after frame commands and drop >16 MiB CDP events pre-parse * fix(browser): remove authenticated tunnel idle kills, match 64-slot unauth pool with 3s head deadline + 1s watchdog margin * chore(browser-engine): remove unused Value import from handlers.rs after verbatim move
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
Closes
notes/review-rd-tools.mdFindings 3, 4, all 3 Round-2 findings, all 4 Round-3 findings, and both Round-4 findings onorigin/dev(00d73a6d, incl.#305,#316,#303,#296,#301,#306,#307,#274,#292,#294):1. Round-4 Fixes (
notes/review-rd-tools.md:734-764)Page.getFrameTreeverification at execution time (exec/{mod,read,snapshot,capture}.rs):queue_live_frame_refresh/step_live_frame_refresh(refreshes top-level + every active OOPIF session).ExecPhase::VerifyFrames(exec/mod.rs) running livePage.getFrameTreeBEFOREverify_authorized_statewhenevercmd.target.is_some()on frame-touching commands (evaluate,wait,snapshot,find,screenshot,frames,dialog, etc.), matching officialchromium.ts:1518. Commands that touch no frame (tabs.*,navigate,navigate.path,back,forward,reload,stop,preview,network.get,files.get) incur 0 extra CDP calls.SnapshotStage::CheckFrameto refresh both top-level and active OOPIFs, and added post-capture live verification (SnapshotStage::VerifyPostandScreenshotStage::VerifyPost) before returning output/pixels.2,020 µs(2.02 ms, median of 10 livePage.getFrameTreeround trips; 0 µs on frame-less commands).> 16 MiBraw byte cap on CDP events (apps/browser-engine/src/cdp_ledger.rs):scan_top_level_cdpearly-exits atdepth == 1on"method"(0 bytes allocated) and drops> 16 MiBevents UNPARSED beforeserde_json::from_slice; movesparamsout ofval(val.as_object_mut().and_then(|o| o.remove("params"))) instead of cloning for<= 16 MiBevents. Replies continue using the depth-1 scanner (top-levelreturn 0->on_dev_tools_method_result; flattened OOPIF rejected pre-parse overmax_bytes).0 Babove16 MiB; at<= 16 MiB,~16 MiBfor a single 16 MiB string (1×move, noparams.clone()) and bounded at~320 MiBfor a maximally dense 8.3M-token JSON array (vs unbounded OOM on 100 MiB+ before).2. Confirmed Prior Round Fixes Preserved
urlcrate (url 2.5.8,idna 1.1.0,idna_adapter 1.2.2,form_urlencoded 1.2.2— allMIT OR Apache-2.0, matchingapps/browser-engine/Cargo.lock):parse_agent_urlparses once and passes exactUrl::as_str()to both serverWildcard.matchpolicy and Chromium.#274:ingest_frame_treereplaces frames per session, clears per-targetoverflow_targetson navigation away from >256 frames, and bumpsgenerationonRuntime.executionContextsCleared+ top-levelloaderIdchange.flush_pending_opens()removed (crates/browser-pane/src/client.rs): Single flush remains strictly afterSetColorScheme,Emulate,SetAgentDriven, andSetPartitionProxy.rpc/mod.rs:199):was_connected = ...is_some()invalidates staleLegacyAllowedonStreamDown -> Reconnected.3. Merge of
origin/dev(00d73a6d,#316+#305) & Verbatim Moveapps/browser-engine/src/engine.rs:1414-1425: kept#305'simpl Drop for EngineManager { self.permissions.shutdown(); }alongside#298'spub(crate) use extensions::{browser_has_extension_surface, tab_is_extension_surface};.apps/browser-engine/src/handlers.rs:14-34: keptorigin/dev's wrappedcef::{ ... }import formatting (both sides addedImplBrowser, ImplBrowserHost).handlers.rsunder 1,500: Merging#305broughthandlers.rsto1,501lines; movedCdpPending,PendingClear, andwrap_dev_tools_message_observer! { pub struct TabCdpObserver ... }verbatim (zero edits inside moved code) fromhandlers.rsintoapps/browser-engine/src/cdp_ledger.rswithpub use crate::cdp_ledger::{CdpPending, PendingClear, TabCdpObserver};inhandlers.rs.handlers.rs1,501 -> 1,181,engine.rs1,423 -> 1,423,cdp_ledger.rs407 -> 736,client.rs1,430 -> 1,430.#305behavioral audit:#305's per-contextPermissionTracker+DEVICE_GUARD_PREFSlockdown and!self.context_ready.load(Ordering::Acquire)readiness gating inTabPermissionHandler/on_before_browse/on_address_changeare 100% compatible with#298and#302(RemoteServeragent tabs inherit device-guard blocking and per-context permission isolation cleanly;Ready.permission_sync+sync_site_permissions()run ahead ofSetPartitionProxy/flush_pending_opens()).4. Security Scope
experimental.browserv4 executors and engine CDP boundary; zerocontract.jsongrowth, zeroENGINE_REVISIONbump, zerostruct Appfield growth).BrowserRpcFeatureonly, scoped strictly to session-owned non-extension tabs and verified main-worldcontextIds.Wildcard.matchauthorization viainspect: true+ livePage.getFrameTreetarget/generation re-verification at execution and post-capture.5. Driven Verification (
proof/browser-tools/fix-b/summary.json: 35/35 Live PASS on Merged Head)#274extensions_active == true):ext_active_toctou_subframe_nav_to_denied_refused: true(child iframe navigated/allowed-frame -> /denied-frameafter authorization;evaluate({frameID}),screenshot, andsnapshotall refused withdocument_changed). LivePage.getFrameTreeround trip:~2.0 ms.engine_100mb_console_event_dropped_pre_parse_no_oom: true(console.log("A".repeat(100_000_000)):0IPC events> 16 MiB, steady WorkingSet+0.2 MiB/ Private+0.1 MiB, extra peak overRuntime.enable-OFF baseline only CEF's single callback slice,0 BRust AST, engine alive).#274extension-active pruning/overflow recovery/reload generation bump, OOPIF frames/snapshot/eval/wait,TypedCdpCallledger, pre-parse 1 MiB eval cap, and 1.15 MiB nested-idevent delivery: ALL PASS.5/5,web.ps1 -Check, Apple & Linuxbrowser-policyviatools/cargo.ps1,--workspace --all-targets, desktop + engine builds: ALL PASS (0 warnings).Held unmerged for READER-10 fourth read.