You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit ebca214
Browse filesBrowse the repository at this point in the historyBrowse files
feat(browser): standalone extension relay daemon with native-host wake-up (#128379)
* feat(browser): standalone extension relay daemon with native-host wake-up
Host the extension relay outside the Gateway: a new relay-daemon-entry
serves the existing relay server on the configured port, the native
messaging host learns an origin-validated ensure_relay op that spawns it
detached when nothing serves the port, and the extension asks for it
(rate-limited) when a direct loopback /extension pairing cannot connect.
Chrome becomes the supervisor: the daemon defers to a hosting Gateway on
EADDRINUSE and idle-exits once both the extension and all CDP clients
are gone, so browser control no longer depends on Gateway boot.
* fix(browser): make standalone relay daemon v2-only by default
The daemon previously called startExtensionRelayServer without
allowLegacyAuth, inheriting the permissive ?? true default and silently
re-enabling legacy one-directional auth (Bearer/Basic/token-subprotocol)
even where an operator set extensionRelay.allowLegacyAuth=false. Because
legacy auth sends the secret to whoever holds the port, a process that
squats the relay port could harvest the credential from a legacy client.
Default the standalone daemon to v2-only (mutual HMAC, which the
extension and mcporter both speak), honoring an explicit
allowLegacyAuth=true opt-in read from the raw config. Adversarial review
via subagents surfaced this as the one operator-config regression the PR
introduced.
* fix(browser): enforce owner + 0600 on relay secret reads
The relay secret is the entire auth model and loopback is not a trust
boundary on a multi-user host, but the fs-safe reader only rejected
symlinks/hardlinks — a secret whose mode drifted group/other-readable
(loosened umask, restore, shared home) was still trusted. Re-check owner
and mode on every read at the relay boundary: self-heal a too-broad mode
on our own file back to 0600, refuse a foreign-owned or non-regular
file, and route the concurrent-creation reread through the same hardened
path so a foreign secret is never adopted. Verified live: a 0644 secret
is tightened to 0600 on read while v2 control keeps working.
* fix(browser): wake the paired extension relay
* fix(browser): share standalone relay ownership with Gateway
Let Gateway authenticate and borrow an existing standalone relay without
rebinding its port. Fence operations to the exact owner, profile, and tab
generation, and acknowledge shutdown only after owned cleanup completes.
Discover native extension IDs from Chromium Preferences and Secure
Preferences, including non-first profiles, while retaining explicit repair.
Refs: #128379
* fix(browser): preserve relay ingress through setup and teardown
Keep raw socket error ownership until close so late write errors remain
handled after wrapper destruction. Retain WebSocket error handling through
authentication and the full ingress lifetime.
Pause legacy ingress during asynchronous preparation to preserve immediate
and coalesced hello frames, then resume after admission or rejection.
Refs: #128379
* test(browser): bound relay teardown fixture payloads
Use the existing relay payload cap for the teardown fixture WebSocketServer.
Refs: #128379
* fix(browser): separate retirement delivery from cleanup
Await authoritative cleanup and retirement-notice write settlement without
letting delivery failure retroactively fail completed cleanup. Actual
cleanup failures remain fatal, and missing borrower receipts remain fenced.
Refs: #128379
* fix(browser): order relay runtime bootstrap after frame replies
Keep Gateway browser evaluation from timing out when Chrome sends its
default Runtime context before the frame-tree reply. Wait for earlier
frame replies in the same logical CDP session before Runtime.enable,
retaining disable and lifetime checks while unrelated commands stay concurrent.
Refs: #128379
* ci: refresh relay checks against repaired main
0 commit comments