Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/relay-keyring-session.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"grok-bot-cli": patch
---

Isolate relay workers by their desktop keyring environment so headless MCP callers cannot replace the authenticated worker used by desktop CLI callers.
3 changes: 3 additions & 0 deletions src/core/relay/profile.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ export function relayProfile(env = process.env) {
"GROK_BOT_ALLOW_ANY_GATEWAY",
"GROK_BOT_TEST",
"NODE_ENV",
// Secret Service credentials depend on the caller's desktop session.
"DBUS_SESSION_BUS_ADDRESS",
"DISPLAY",
Comment on lines +34 to +35

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Migrate persisted relays before changing the profile digest

Adding these entries changes the serialized profile input even when both variables are unset, so every existing 0.6.0 relay receives a new profile after upgrading. With the default location, commands start against an empty directory while the old detached worker and its routes, checkpoints, and pending records remain active but inaccessible; with GROK_BOT_RELAY_DIR, startup instead permanently rejects the existing ledger with Relay profile mismatch. Preserve or migrate the previous profile/state so upgrades continue existing durable routes rather than stranding them.

Useful? React with 👍 / 👎.

Comment on lines +34 to +35

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Restrict Secret Service profile fields to Linux

These variables are hashed on macOS too, although readKeychainPassword() uses /usr/bin/security there rather than Secret Service. Consequently, otherwise compatible macOS callers that differ only because one runs under XQuartz, SSH forwarding, or a Homebrew D-Bus session get separate state directories and workers, making existing routes disappear from status and permitting duplicate bindings. Include these fields only for the Linux keyring path.

Useful? React with 👍 / 👎.

];
return digest(
JSON.stringify([
Expand Down
2 changes: 2 additions & 0 deletions test/relay-worker.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ test("profile shares hosts but isolates endpoint, auth overrides and caller rest
{ GROK_BOT_GATEWAY_HEADERS: '{"x-route":"secret"}' },
{ CODEX_APP_SERVER_SOCK: "/other.sock" },
{ GROK_BOT_TEST: "0" },
{ DBUS_SESSION_BUS_ADDRESS: "unix:path=/run/user/1000/bus" },
{ DISPLAY: ":0" },
])
assert.notEqual(base, relayProfile({ ...env, ...extra }));
assert.ok(
Expand Down
Loading