Repository navigation
fix(security): harden zero-click fetches, SVG/image actions, and remove auth_token from media URLs (A2b) - #383
Merged
Merged
Conversation
…ve auth_token query param from remote video URLs (A2b)
|
PR test build retired — merged into |
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
Security hardening A2b: zero-click fetches, image context-menu / SVG handling, and removing the
auth_tokenquery parameter from/api/fs/readmedia URLs (parity with officialb9a60d9dpackages/app/src/runtime/server/api.ts:45-56fileStreamUrlandworkspaces/files/model.tsx:228-241).crates/browser-policy/src/network.rs:is_public_ipv4/is_public_ipv6/is_public_ip/is_public_http_urlrefusing loopback, RFC 1918 LAN, CGNAT, link-local/IMDS, ULA,.localhost/.local/.internal/.arpa, alternate IPv4 encodings (incl. empty0x), credentials, and port 0.crates/opencode-platform/src/web_fetch.rs: resolves DNS, validates every returned IP viais_public_ip, refuses redirects onto non-public targets, and bounds response size.crates/session-view/src/images/markdown.rs: gates zero-click web image & favicon fetches onis_public_http_urland refuses raw UNC/device paths before enqueuing.apps/desktop/src/workspace/lifecycle/launch/boot.rs: verifies local markdown image paths throughpinned_local_root+verify_local_pathbefore fetching.features/files/src/code_paths.rs: blocks raw UNC and verifies fixed-drive/non-reparse local paths before zero-click existence checks.crates/session-view/src/images/{drag,menu}.rs,crates/opencode-i18n/locales/rune/en.json):wasm32blob open uses an explicit raster-only MIME allow-list (never opening scriptableimage/svg+xmlin a same-originblob:tab); Save As preserves.svgfor user-confirmed saves while drag-out stays strictly sniffed raster extensions.auth_tokenquery parameter in media URLs (crates/opencode-kit/src/client/{mod,http,media}.rs,features/files/src/{lib,ops,video}.rs,apps/desktop/src/surfaces/files/reply.rs):Server::stream_urlreturnsNonewheneverself.auth.is_some()(credentials never appear in URLs, matching officialfileStreamUrl).AuthorizationHTTP headers (zero redirects, 64 MiB cap) into an owner-onlyTempMediaFile(0o700dir, handle closed before returning for Windows Media FoundationFILE_SHARE_READ, auto-deleted on drop; off the UI thread in Files panel viaAuthVideoDownloads).Verification
scripts/guardrails.ps1: 5/5 passed.cargo check --locked --workspaceandscripts/web.ps1 -Check(wasm32-unknown-unknown): both clean (0 warnings).