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
MCP broker: provider tokens are left unencrypted in Redis after the login that stored them ends #2870
Depends on: "User-keyed upstream storage behind the embedder option" (stacklok/toolhive#7263), and the "to file" disconnect row in "Phase 3, Track: ToolHive — The remaining ToolHive changes for audit, sign-out, and schedules" (#2570)
Problem
When mecak8s's MCP broker logs a user in to a protected (OAuth) MCP server, ToolHive's embedded authorization server stores the provider's access and refresh tokens (for example GitHub's) in its storage, which is Redis when --redis-url is set. The rows are stored unencrypted and keyed by the embedded authorization server's session, which only the tokens the MCP broker holds in memory can name.
After a mecak8s restart, or when the broker drops a session's login, nothing can reach those rows any more, but they stay in Redis: until the provider access token's expiry plus 30 days, and with no expiry at all when the provider's token has none. Live provider credentials sit unused and unencrypted in Redis, readable by anyone with access to it, for up to a month or indefinitely.
The MCP broker has code for sealing these records with an operator key ring, but it is not wired in.
Requirements
Provider tokens stored by the embedded authorization server are encrypted at rest with an operator-supplied key ring that supports rotation.
With user-keyed storage, a row is the user's connection, shared by every later call; it no longer belongs to one login. A row is deleted only on disconnect or revocation.
Every token has an expiry, enforced by Mecatl's own storage wrapper (ToolHive keeps a token that never expires without a storage TTL).
With no Redis configured, behaviour is unchanged.
Done when
Provider tokens in Redis are not readable without the operator's key.
A provider connection belongs to the user, not to the login that stored it: it is deleted when the user disconnects the provider or their access is revoked, and not when a session or its login ends.
A provider token with no expiry is stored with a bounded lifetime, enforced by Mecatl's own storage wrapper.
Activity