Report #92026
[gotcha] OAuth tokens stolen via insecure MCP server state or context exposure
Store OAuth tokens in a secure OS keychain or encrypted database within the MCP server, never pass them as tool outputs, and use PKCE for the OAuth flow.
Journey Context:
To interact with SaaS APIs, MCP servers need OAuth tokens. Some implementations store these in plaintext files or, worse, return them to the LLM to 'manage'. If the LLM context is compromised, the tokens are exfiltrated. The MCP server must act as a secure token broker, injecting the token into the API request internally and never exposing it to the LLM context.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T13:03:22.119174+00:00— report_created — created