Repository navigation
feat(runtime): session-only browser keys and opt-in for pairing from plain-http pages (host) - #27540
Merged
Merged
Conversation
OrcaWin
force-pushed
the
np/d2b-connection-handle
branch
from
October 11, 2026 19:15
6c02776 to
69eb366
Compare
OrcaWin
force-pushed
the
np/d2b-web-session-host
branch
from
October 11, 2026 19:18
2c11280 to
8ef0f37
Compare
2 tasks done
OrcaWin
force-pushed
the
np/d2b-connection-handle
branch
from
October 11, 2026 19:42
69eb366 to
bb54fd8
Compare
OrcaWin
force-pushed
the
np/d2b-web-session-host
branch
from
October 11, 2026 19:58
8ef0f37 to
b2dff1a
Compare
OrcaWin
force-pushed
the
np/d2b-connection-handle
branch
from
October 11, 2026 20:20
bb54fd8 to
1e289ba
Compare
added 2 commits
October 11, 2026 14:02
…om plain-http pages (host) - pairing.registerDeviceKey accepts ephemeral: true (advertised as pairing.device-key-ephemeral.v1). Such keyed rows are dropped when the host restarts and after 12 hours with no live socket; a sweep removes them and cuts any socket still bound to them, so later key auth gets device_revoked. - The WebSocket upgrade Origin is recorded per socket. A first pairing (a never-used pairing code) from an http:// page on another machine is refused with a sealed insecure_origin error unless the operator sets ORCA_ALLOW_INSECURE_WEB_PAIRING=1. Already-paired browsers, https and loopback pages, and native clients are unchanged. - Registry file reading moved to device-registry-file-read.ts to keep the registry under the size cap.
…er phones React Native sends an http Origin on every LAN WebSocket, so the Origin alone refused first-time QR pairing from released phones. The web bundle now marks its upgrade with ?orca-client=web; only a marked socket from an http page on another machine is gated. Released hosts ignore the query string.
OrcaWin
force-pushed
the
np/d2b-web-session-host
branch
from
October 11, 2026 21:03
b2dff1a to
e3e9fb9
Compare
OrcaWin
marked this pull request as ready for review
October 11, 2026 21:40
7 tasks done
Merged
9 tasks done
9 tasks done
nwparker
added a commit
that referenced
this pull request
Oct 17, 2026
…s again (#29984) Partially reverts #27540 and the plain-http part of #27552, which broke web pairing on upgrade for 1.4.227 users who open Orca at a LAN or Tailscale address: - The host no longer refuses a first pairing from a plain-http page on another machine (insecure_origin, ORCA_ALLOW_INSECURE_WEB_PAIRING). - Such a page keeps its pairing code in local storage and signs in with it, as in 1.4.227, so reloads, new tabs and bookmarks stay paired; no notice. - Session-only browser keys (pairing.device-key-ephemeral.v1, the idle sweep) stay for browsers without Ed25519. - A web client whose credentials are refused shows the host's reason instead of an empty workspace and "Session restore failed".
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.
ELI5
A browser can pair with an Orca server from a plain
http://page on another machine, for examplehttp://192.168.1.20:6768. Anyone on that network path can swap that page for a fake one and steal the pairing code typed into it. This PR makes the server:Browsers that are already paired keep working exactly as before.
What Changed
This is the host (server) half. The browser half is the next PR in the stack.
ephemeral: trueonpairing.registerDeviceKey. It is advertised as the new capabilitypairing.device-key-ephemeral.v1.ephemeral.device_revokedverdict, so the browser drops its key.http://<host>:<port>Originon every LAN WebSocket, so the Origin alone cannot identify a browser. The updated web client marks every WebSocket it opens with?orca-client=web. The host records the marker and that socket'sOrigin.http://page on a non-loopback host, claiming a pairing code for the first time (a never-used pending code), is refused. The refusal is a sealede2ee_error {code:'insecure_origin'}plus a close with 4001 "Insecure web origin", which does not trigger the "unpaired device" prompt.orca servewithORCA_ALLOW_INSECURE_WEB_PAIRING=1.https://pages;localhost,*.localhostand127.xpages.device-registry-file-read.ts, with no behaviour change, to keepdevice-registry.tsunder the size cap.Why
Origin: React Native also sends an httpOrigin, so theOriginalone would refuse first-time QR pairing from released phones. Only the web bundle adds the marker. The host needs both the marker and an insecureOrigin. Sec-Fetch headers can't be used instead, because browsers don't send them to plain-http LAN origins.orca serve, and managed servers over SSH alike. A settings toggle and a serve flag can follow without changing the host check.registerDeviceKeyparams are strict on older hosts, so a browser sendsephemeralonly to a host that advertises it.Linked Issue
Part of #17399.
Visual Proof
N/A: host only; the browser warning and messages are in the stacked web PR.
Testing
src/main/runtime/ephemeral-device-rows.test.ts:src/main/runtime/rpc/web-session-pairing.test.ts, through the real socket wiring and v2 crypto:insecure_origin, with no auth and the row still pending;Originand no marker pairs, for both mobile and runtime scope;device_revoked;src/shared/web-origin-security.test.ts: http, https, loopback and odd origins.Cross-version (
tests/e2e/cross-version-wire/cross-version-web-upgrade-marker.unit.test.ts), over real sockets:Origin.Cross-version (
tests/e2e/cross-version-wire/cross-version-web-session-pairing.unit.test.ts):ephemeral;Existing device-key, registry and runtime RPC suites pass.
pnpm tc, oxlint andcheck:code-quality:changedpass.Automated tests added/updated
Agent skill upstream boundary
Notes