Repository navigation
Conversation
…d serialized read/node extension masking
Test build ready — Download
|
…sking # Conflicts: # crates/browser-policy/src/lib.rs
Member
Author
|
Closing (not merged) per official-parity ruling ( |
Hona
added a commit
that referenced
this pull request
Nov 20, 2026
…P-143 (#318) - Fold confirmed merged PRs #307 (a1e7d0d, click-to-load reply videos), #306 (b5167f7, atomic agent_driven), #301 (6522f11, routed-session attach + recency closing #287 regression), #296 (95cb36a, legacy rune_mcp suppression + Half::is_builtin + check_cdp), #303 (6fb05ce, oc-preview:// app routing + raw file:// ban completing UP-095-PREVIEWS), and #316 (6e98fc2, Rune 7a707454 / #1307 strict local video opening) - Add missing browser follow-up rows UP-095-3P-CONTRACT (#296 narrow third-party plugin browser contract gap) and UP-095-PROMPT-GATE (new-session-start-only prompt gate split from #302) - Record #302 split (tunnel vs gate), #314 masking stream paused pending owner decision on agent-tab contexts, and updated browser Reviewed entries - Audit upstream anomalyco/opencode 4122af0206..b9a60d9d07 (+11 commits: 3 skipped, 8 added UP-136..UP-143)
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 Part 2 of 4 of the extension sub-frame masking split (
review-rd274.md#311 & #314 reads). - Refusespierce: trueonDOM.getDocumentandDOM.describeNodeincrates/browser-policy/src/{cdp,agent}.rs(app + sidecar). - Unified true CDP frame graph & C++ read/node masking (apps/browser-engine/src/extensions/{frame_guard,mask_queue,mask_ops}.rs): mergesPage.getFrameTreewithTarget.getTargets()(type == "iframe", filtered to ancestors of THIS tab'smain_frame_idbefore counting againstMAX_FRAME_TREE_NODES = 512), strips closedShadowRoots,pseudoElements, AX descendants, and extension frames without leakingbackendNodeIds, fails closed while any pre-commit extension sub-frame is pending (ctx.has_pending()), and keepsInput.*andPage.captureScreenshotrefused onSubframes(Input.*under Option A; screenshots move to PR 1b-4). - Round-2 fixes (closing READER-7 #314 Findings 1–4 + mergingdev95cb36a8): 1. Finding 1 (Accessibility.*+ AX cascade +pseudoElements+ fail-closed depth): AddedReadFilterKind::AxTree(Accessibility.getFullAXTree,getPartialAXTree, etc.) tois_clean_ext_guarded_methodandCleandispatch;strip_ax_treenow builds achildIds/parentIdadjacency map (zero allocations when clean) and BFS-cascades dropped nodes to all descendants (InlineTextBox, pseudo-element AX nodes) plus prunesrelatedNodes;walk_dom_for_protectedandstrip_dom_nodewalk/strippseudoElements, andstrip_dom_nodefails closed (Err) ondepth > MAX_DOM_WALK_DEPTH. 2. Finding 2 (Single-target & integer ID validation):parse_single_dom_target/parse_required_node_id/parse_get_document_depthinspect all three ofnodeId,backendNodeId, andobjectId, reject multi-identifier combos (closing BlinkAssertNodenodeId-over-backendNodeIdprecedence) and JSON floats (12.0), and strip explicitnulltarget keys before forwarding. 3. Finding 3 (Filter & suppress events BEFORE redacting):TabCdpObserver::on_dev_tools_eventbumpsdom_epochonDOM.*/Page.*, dropsPage.*/DOM.*/Overlay.*/Target.*/Accessibility.*before IPC, drops extension-attributedRuntime.*/Log.*/Network.*events (by origin, stack,frameId, tracked extensionrequestIds, and tracked extensionexecutionContextIds) before runningredact_ext_strings. 4. Finding 4 (DOM.getFrameOwner,awaitPromisetimeout, encoded redaction):DOM.getFrameOwnernow runsInternalDocand rejects any ownerbackendNodeId/nodeIdinside a closed ShadowRoot;TabMaskQueueenforces a 10 s engine-side active-op timeout (expire_timed_out+next_mask_deadlinewake) so awaited promises never wedge the queue;redact_ext_stringscovers bareextension://,blob:extension://,filesystem:*extension://, and percent/double-percent/HTML-entity/unicode-escaped forms. 5. Epoch-scoped protected-set cache (Rc<CachedMaskState>): Keyed onTabPrompts::dom_epoch(bumped by BlinkDOM.*/Page.*events and CEF frame/nav lifecycle), computes the pierced DOM/frame sets once per DOM epoch and reuses them acrossbrowser.snapshotandquerySelectorAll+getBoxModelloops with Mojo-FIFO post-reply epoch verification and 1-shot fresh retry (answeringDOM.getDocumentviaclone_dom_to_depth+DOM.describeNodeFIFO fence so Blink'snodeIdtable stays valid end-to-end). 6. Mergeddev95cb36a8(#307,#306,#301,#296): Sole conflict incrates/browser-policy/src/lib.rsresolved by keeping#296'smod cdp; pub use cdp::check_cdp;and wiringcrate::agent::check_dom_pierce_params(method, params)intocrates/browser-policy/src/cdp.rsfor"DOM.getDocument" | "DOM.describeNode". ## Known Limit - Non-iframe closed-ShadowRoot extension UI onCleantabs: On aCleantab (0extension iframes), extension content-script widgets rendered purely inside a closedShadowRootwithout an<iframe>remain unreachable by all DOM/AX/node reads (DOM.*,Accessibility.*), while remaining reachable byPage.captureScreenshot(closed in follow-up PR1b-4) andInput.*(it lives in the page's own DOM; any click on it that opens an extension frame transitions the tab toSubframes, whereInput.*is refused). ## Benchmark (2,296 elements / 3,450 DOM nodes, live CEF 156 release,proof/ws9/pr1b2-cache-bench.json) All timings in µs (median (min–max)): | Workload | Extensions inactive (floor) | Extensions active — before caching | Extensions active — after caching | |---|---:|---:|---:| |browser.snapshot(boxes: true, 25 fields + 40 quads, warm,n=15) | 111,891 (95,151–144,641) | 1,364,281 (1,229,625–1,562,354) | 97,055 (84,827–143,761) | |browser.snapshot(boxes: true, cold epoch after DOM edit,n=7) | 133,780 (102,498–148,535) | 1,730,563 (1,437,332–1,895,791) | 126,470 (114,832–193,252) | |browser.snapshot(boxes: false, 25 fields, warm,n=15) | 99,064 (80,633–114,197) | 667,280 (596,869–811,268) | 95,340 (83,253–108,416) | |querySelectorAll(25) + 25×getBoxModel(backendNodeId,n=15) | 4,597 (3,982–6,478) | 611,354 (540,782–809,087) | 6,052 (5,056–16,200) | |querySelectorAll(25) + 25×getBoxModel(nodeId,n=15) | 4,541 (4,222–5,586) | failed at item #2 (Blink nodeId reset) | 6,306 (4,850–8,081) | ## Verification -scripts/guardrails.ps15/5 (engine.rs1,428/1,500;mask_ops.rs830;mask_queue.rs807; 0 errors) -cargo check --workspace,browser-policy(aarch64-apple-darwin&x86_64-unknown-linux-gnu),scripts/web.ps1 -Check,apps/browser-enginecheck & release build (0 warnings, 0 new crates, 0 test files) - Live CEF 156 proofs:proof/ws9/pr1b2-read-node-proof.json(29/29 passed) +proof/ws9/pr1b2-r2-proof.json(29/29 passed: Findings 1–4, multi-target/float rejection,DOM.*event suppression, closed-ShadowRoot iframegetFrameOwnerrefusal, encoded URL redaction, all 4 cache-invalidation attacks incl. same-origin iframe mutation, and 10 sawaitPromisetimeout recovery).