Repository navigation
fix(files): require click-to-load for all inline reply videos - #307
Merged
Merged
Conversation
…or inline reply videos
- `crates/browser-policy/src/remote_url.rs` & `lib.rs`: add `is_public_http_url` (refusing
credentials, percent/non-ASCII host obfuscation, single-label hosts, local/internal/metadata
DNS suffixes, alternate IPv4 notations, and all non-globally-routable IPv4/IPv6 ranges
including loopback, RFC 1918, CGNAT, link-local/IMDS `169.254.0.0/16`, and ULA `fc00::/7` /
`fd00:ec2::254`) and `sanitized_http_host`.
- `crates/session-view/src/video.rs`, `video/transport.rs`, `lib.rs`: add `ReplyVideo::{Auto,
OnClick}` and explicit `Slot::{Starting, Active}` state machine in `Clips`; verified
in-workspace clips keep auto-loading while outside-workspace local clips and `http(s)` URLs
render a click-to-load Play control under the link and construct `Player` (with `#297`'s
unchanged player stage and controls) only after user click and host verification.
- `apps/desktop/src/surfaces/files/reply.rs` & `shell/view/session/host.rs`: perform zero
outside-disk or network I/O on display; verify outside local paths via `verify_local_path`
and remote-server `http(s)` URLs via `is_public_http_url` on click (reporting refusals via
toast).
- `crates/opencode-i18n/locales/rune/en.json`: add `rune.video.localFile`,
`rune.video.playInline`, and `rune.video.remoteBlocked`.
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)
…l path on Play control, and keep reference-link controls inline Per READER-12's review of #307: - Remove `crates/browser-policy/src/remote_url.rs` (and its exports), `web_video_url` / `Link::Web` inline video handling in `apps/desktop/src/surfaces/files/reply.rs`, and `rune.video.remoteBlocked` / `rune.video.localFile` strings. `http(s)` video links stay ordinary links and open in the embedded browser pane (enforcing `browser_policy`, remote `TunnelProxy`, isolated storage, and sandboxed decoders). - Disclose the real sanitized local path on `ReplyVideo::OnClick { path }` before click: middle- truncated on the Play button (preserving both root and filename), full path in `.help(...)` tooltip and accessibility `.label(...)` (never using model-controlled link text). - Gate `Link::Outside` click-to-load strictly on `app.can_open_in() && !is_remote_session(app)` so remote-server sessions never offer a local player for server paths. - Keep reference-style Markdown links' Play controls inline beside their links by appending document reference definitions invisibly to each Markdown slice instead of detaching controls to the bottom of the message; also drop mismatched `Slot::Starting` entries cleanly.
…ideo::Auto) Per READER-12's in-workspace video ruling on dev (Rune eff95e80 with live Windows Media Foundation and macOS AVFoundation backends): - Remove `ReplyVideo::Auto` completely; NO video in an assistant reply ever opens or decodes without an explicit user click (neither inside-workspace nor outside-workspace). - On display, `reply::video` performs zero disk or network I/O and returns only the real sanitized path shown on the Play control (middle-truncated on the button, full path in tooltip and accessibility label; consistent native separators on Windows). - On click, `reply::load_video` verifies inside-workspace files via `verify_within_root` (or remote `/api/fs/read/...`) and outside-workspace local files (local sessions only) via `verify_local_path`, then mounts `#297`'s unchanged player and controls. - `http(s)` web video links stay ordinary links that open in the embedded browser pane.
|
PR test build retired — merged into |
Hona
added a commit
that referenced
this pull request
Nov 20, 2026
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
Makes all inline reply videos click-to-load — no video in an assistant reply ever opens or decodes without an explicit user click (neither inside-workspace nor outside-workspace), keeping cloned-repo bytes out of in-process OS demuxers/decoders (
AVURLAsseton macOS, Media Foundation on Windows) until clicked while preserving#297's player UI and controls.http(s)web video links stay ordinary links and open in the embedded browser pane.What changed vs
dev(ae3e9105)apps/desktop/src/surfaces/files/reply.rs,host.rs,crates/session-view/src/{lib.rs, video.rs, video/transport.rs, timeline/parts.rs},en.json):ReplyVideo::Autoremoved;reply_video_sourcereturnsOption<String>— the real sanitized display path only, with zero disk, network, orPlayer::newactivity on display).app.can_open_in() && !is_remote_session(app)): Display runs only pure lexicalsafe_local_reveal_path(0 disk/SMB/autofs I/O; consistent native separators on Windows) and renders a compact Play control disclosing the real path before click — middle-truncated on the button (preserving both root/drive prefix and file name), full path in.help(...)hover tooltip, and full path in accessibility.label(...)(never using model-controlled link text).reply::load_video(verify_within_rootfor local inside-workspace files,/api/fs/read/...for remote inside-workspace files, andverify_local_path+verified.is_filefor local outside-workspace files, showing a toast on refusal) and transitionsSlot::Starting -> Slot::Active(Player::new+play()), mounting#297's unchangedtransport::stageplayer.Clips::polldrops pendingStartingslots on session switch andClips::viewdrops mismatchedStartingslots.video.rs,timeline/parts.rs): Document reference definitions are appended invisibly to each Markdown slice instead of detaching Play controls to the bottom of the message.http(s)web video links stay ordinary links:Link::WebreturnsNonefromreply::videoand opens in the embedded browser pane on click (both local and remote-server sessions), gainingbrowser_policy, remoteTunnelProxy, isolated storage, and sandboxed decoders.Follow-up tracked in Rune's
rune-mediacrate & accepted local-click boundaryrune-media(being taken in Rune separately):crates/rune-media/src/video/macos/asset.rs): setAVURLAssetReferenceRestrictionsKey: AVAssetReferenceRestrictionForbidAllwhen opening local assets so a clicked local.movcannot dereference unverified local/autofs files via QuickTimedref/alisreferences.crates/rune-media/src/video/windows/mf.rs): dropMF_RESOLUTION_CONTENT_DOES_NOT_HAVE_TO_MATCH_EXTENSION_OR_MIME_TYPE(and setMF_RESOLUTION_DISABLE_LOCAL_PLUGINS) so a crafted.mp4cannot fall through to the registered.nscnetwork stream handler or third-party byte-stream handlers.verify_local_path/verify_within_rootdrops its handle before Rune's worker thread opens the path (and re-opens by path after 3 s idle park), leaving a check-to-open race only for an attacker who already has write access to the target file's parent directory — accepted on an explicit user click once the real path is clearly shown before the click.Driven Proof (Windows Live + Target Checks)
good.mp4autoLoadedCount: 0), 0 opens ofworkspace\good.mp4in I/O trace; Play button disclosesC:\tmp\...\workspace\good.mp4good.mp4Play buttonworkspace\good.mp4only after click (inWorkspaceGoodMp4OpensAfterClick: 2) and mountsclip-*clip.mp4([Spoofed Demo Label]) & long path (> 60chars)"Spoofed Demo Label"); long path middle-truncates to· C:\tmp\opencode\browse…26\outside-long-filename-demo.mp4with full path in tooltip & accessibility label; 0 disk/SMB opens on displayclip.mp4vs junction /subst-to-UNCclip.mp4verifies & transitions toclip-*; junction &subst-to-UNC refuse with toast (Couldn't open), 0 target/SMB openshttp://127.0.0.1:<port>/web-clip.mp4,https://cdn.example.com/demo.mp4)[Ref Clip][v]aboveTRAILING_PROSE_BELOW_CONTROL)y=204) and trailing prose (y=274.41) aty=234.41127.0.0.2non-local): outside local pathproof/browser-ui/sec-a1b/a1b-click-to-load-{dark,light}-1x.png&proof/browser-ui/sec-a1b/results.json(headfc3df8c5).scripts/guardrails.ps1(5/5),browser-policyaarch64-apple-darwin&x86_64-unknown-linux-gnu, Windowscheck --workspace,scripts/web.ps1 -Check(1041 files / 48 crates),apps/browser-enginecheck,build -p opencode-desktop— all 0 errors, 0 warnings.