Repository navigation
feat(browser): native 500 ms guarded app-link review bar and confirmed OS scheme handoff (PR B) - #315
Conversation
…-path links, open_file, save_download, and macOS volume case checks (A2a) Splits Security PR A2 by surface (A2a: links, OS schemes, Open-in, plugin/app path guards; A2b: images, zero-click fetches, remote media auth; A2c: terminal OSC 8 dialog): - `crates/browser-policy/src/app_links.rs` & `plugins/browser/refusal.luau`: percent-decode query keys (and split on `&`/`;`, failing closed on malformed `%`/controls) in `mailto_has_attachment` for `attach|attachment|attachments|file|filename|filepath|body-file` (for both conversation and page sources); reject BOM/zero-width chars; add explicit `is_safe_os_external_url` allow-list. - `crates/browser-policy/src/lib.rs`: reject `\` before `/` in `destination_origin` / `is_http_with_credentials` (closing `http://public.example.com\@127.0.0.1/`). - `crates/browser-policy/src/local_fs/unix.rs`: honor macOS per-volume case sensitivity via `fpathconf(fd, _PC_CASE_SENSITIVE) == 0` in `verify_within_root` (from #294 Mac run). - `features/open-in/src/{lib,windows}.rs`, `apps/desktop/src/workspace/system/open_in.rs`, `features/office/src/sheet/input.rs`, `status_toast.rs`, `requests.rs`: enforce `is_safe_os_external_url` at every OS handoff (`open_external`, spreadsheet links, toast `openUrl`, `System:OpenExternal`); drop `.cmd`/`.bat` shim fallback in `windows.rs::resolve`; launch Windows Terminal via `wt -w new -d .` with `.current_dir(&dir)`; gate `HARNESS_OPEN_EXTERNAL_LOG` behind `debug_assertions`. - `apps/desktop/src/surfaces/browser/links.rs`: stop cross-session `focused_tab_id` fallback in `queue_browser_app_link_review`. - `crates/session-view/src/style.rs`: ignore attacker-authored `opencode-code-path:` Markdown links (and never suppress their hover tooltip) unless verified in `code_links`. - `plugins/file/init.luau` & `tool_open.rs`: block backslash `..` traversal and UNC/device paths in `open_file` MCP tool / `Workspace:Relative`. - `plugin_host/services/{ui,diag}.rs` & `opencode-kit/src/client/downloads.rs`: guard `Links:Exists` and heap-snapshot metadata via `verify_local_path`; confine `save_download` strictly to a single safe basename inside Downloads.
|
PR test build retired — merged into |
…n_file, 23 confirmed app schemes, settings/updater routes, mailto allow-list)
|
Round-2 fixes pushed at
Live proof ( |
|
Round-3 fixes + merge of Official parity (
|
…ks-schemes # Conflicts: # apps/desktop/src/plugin_host/native/browser.rs # crates/browser-policy/src/app_links.rs # features/open-in/src/lib.rs
…ms guard, live window viewport fits(), 60 s TTL wake, and host document_input
…ks-schemes # Conflicts: # apps/desktop/src/plugin_host/native/browser.rs # crates/browser-pane/src/prompts/mod.rs
…ks-schemes # Conflicts: # apps/desktop/src/plugin_host/native/browser.rs # apps/desktop/src/plugin_host/native/browser/chrome.rs # apps/desktop/src/surfaces/browser/mod.rs
Summary
PR B of the #315 split (confinement + raw-route hardening already merged as PR A in #338): native 500 ms guarded app-link review bar (
surfaces/browser/prompts/app_link.rs,surfaces/browser/links.rs), page-originEngineMsg::AppLinkBlockedforwarding (apps/browser-engine), and confirmed OS app-scheme launch (features/open-in), closing all 3 READER-12 round-3 blockers.Fixes for READER-12 round-3 blockers
links.rs:sync_app_link_reviews): trackssaw_settled(initialized from!tab.loading). Conversation reviews no longer vanish on initialabout:blankor in-flight tab loading (matching officialb9a60d9dpane.ts:470-481+chromium.ts:886-890, which clear only on committed navigation); settled navigations still clear the bar.pointerdown, not release (prompts/app_link.rs,links.rs:note_app_link_pointer): recordsaction_pressed_at/dismiss_pressed_atatPhase::Downonly whenvisible_sincehas already elapsed 500 ms (matching officialactivation-delay.ts:13-53). A press begun before 500 ms and released after 500 ms never activates; keyboard activation checksvisible_sincewith non-repeat enforced by Runefocus.rs:817,827.fits()(links.rs:observe_app_link_window_rect,shell/view/mod.rs,panels.rs): checks both text-in-box fit and full visibility inside the root window rect (re-evaluated live on resize), plus.clip_soft(0.0)on panel body.links.rs:observe_app_link_review_layout): armstx.wake_afterforexpires_atso an idle bar flips fromOpentoCopy linkat 60 s.document_inputfor page-only editor schemes (crates/browser-pane/src/{prompts/mod.rs,surface.rs},browser-policy::is_page_only_app_scheme): records real user pointer/key input to the current document (cleared on nav/reload/document change/context switch, matching officialchromium.ts:377-425, 871-969&refusal-notice.ts:52-54) and downgrades unattended page-originvscode:/cursor:/zed:/jetbrains:links to Copy; page-originmailto:enforces the 200-char cap.Win32_System_Registrykept with comment infeatures/open-in/Cargo.tomlbecausewindows-sysgatesSHELLEXECUTEINFOW(hkeyClass: HKEY) behind it.ENGINE_REVISIONnot bumped:devis already revision 3 while publishedstable.jsonis156.0.26-2.Verification
scripts/guardrails.ps1: 5/5 passed (all touched files within hard ceilings).cargo check --locked --workspace,cargo build --manifest-path apps/browser-engine/Cargo.toml --bins, andscripts/web.ps1 -Check: all clean.run-proof-prb.ts): verified Blocker 1a (0 browser tabs open, review bar survivesabout:blankload), Blocker 1b (mid-load/slowtab, review bar survives), and Blocker 2 (earlypointerdownat +150 ms held 650 ms blocked with 0 opens; post-500 ms press opened once).