Repository navigation
fix(security): keep the dashboard token out of agents' reach - #191
Conversation
The dashboard token is the owner credential on the dashboard API (X-Hive-Internal, Bearer, and the hub proxy proof). Agents run in the same container under their own UIDs and could read it in three places: - Each agent's tmux server was started with the hive's whole environment. The server keeps it in its global environment and in its own /proc/<pid>/environ, both owned by the agent; the session-level removal only hid values from new panes. Every process the hive starts as an agent's user (tmux server and clients, su-exec helpers) now gets agentExecEnv: an allowlist of process basics, proxy settings, backend model keys and non-secret HIVE_* settings. The removal list stays as a second layer and now names the hive's own credentials. - ttyd's command line carried -c hive:<token>, readable by every user. ttyd now listens on a unix socket in a fresh 0700 directory owned by the hive user, without a credential; the Node proxy and the Go /terminal proxy connect to it. HIVE_TTYD_BIND keeps the old TCP mode. - The browser terminal's tmux client ran as the agent with ttyd's environment for as long as the terminal was open. It now starts from env -i, before su-exec. As a further layer the Go API and the Node proxy refuse the shared token from a loopback peer whose socket an agent's user owns (UID map). After deploying, restart every agent's tmux server and rotate the dashboard token. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: James Reilly <jreilly1821@gmail.com>
codex_home_nfs_safety_test pins that chownTreeAsRoot and removeTreeAsRoot shell out to su-exec chown/rm (not an in-process walk) by parsing for an exec.Command call. Keep that call in place and set agentExecEnv on it directly instead of going through suExec. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: James Reilly <jreilly1821@gmail.com>
Open PR overlap checkBase branch: Conflicts are checked with every PR merged onto the current tip of
|
c251445
ℹ️ Sentinel notice — informational; author is trusted (owner), merge is not blockedHive flagged this PR (author @hanthor, head
Hive did not add the |
|
Thank you for your contribution! Your PR has been merged. We'd love to hear how your experience was: share feedback |
Security fix: keep the dashboard token out of agents' reach. Details follow in the security advisory.
🤖 Generated with Claude Code