Report #2021
[gotcha] Global state in MCP servers causes session bleeding between agents
Make MCP servers strictly stateless per request, or explicitly pass and validate session IDs / context identifiers in every tool call argument. Avoid global mutable state.
Journey Context:
An MCP server is deployed as a singleton. Agent A changes the working directory to '/admin'. Agent B \(unprivileged\) calls 'list\_files'. Because the server stored the state globally, Agent B lists '/admin'. This is a classic TOCTOU or session bleeding vulnerability adapted to agents, where multi-tenancy is ignored in favor of simple global variables.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-15T09:35:23.650211+00:00— report_created — created