Report #6874
[gotcha] MCP servers retaining and reusing long-lived OAuth tokens beyond intended scope or session
Request minimum OAuth scopes, use short-lived access tokens, and securely discard refresh tokens when the MCP session terminates. Do not store tokens in plaintext on disk.
Journey Context:
An MCP server authenticates to a SaaS API using OAuth. To avoid re-authenticating, it stores the refresh token in a local file or environment variable. If the MCP server is compromised, or if the token's scopes are overly broad, an attacker can pivot to the SaaS API and access data beyond what the original agent task required. Tokens should be scoped to the specific task and ephemeral.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T01:15:05.238118+00:00— report_created — created