security: add rotation/expiry for the remote-access gRPC token #412
Labels
No labels
backend
bug
chore
duplication
effort:complex
effort:medium
effort:trivial
enhancement
frontend
fullstack
priority:high
ready-for-agent
refactor
security
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
dries/ocman#412
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Finding #6 (Low) from a security review.
Problem
The multi-remote gRPC bearer token is generated once and persisted forever — no rotation, no expiry (
internal/state/identity.go). In-remote-trusted-overlay(plaintextgrpc://) mode the token crosses the network in cleartext on every RPC. A single on-path capture yields a permanent credential equivalent to RCE on the remote (it can launch opencode in tmux). There is no way to invalidate it short of manual DB surgery.Refs
internal/state/identity.go(token generation/persistence)internal/remote/auth.go(bearer check)Suggested fix
Add a "rotate remote token" action (endpoint + Settings > Remotes button) that regenerates the token via
crypto/rand, invalidating the previous one. Optionally support an expiry/TTL.Acceptance