Summary
MCP Python SDK installs default task handlers that do not associate tasks with the client session that created them, leaving task operations effectively unauthenticated between clients.
In multi-client scenarios, any connected client may be able to list, inspect results for, consume messages from, or cancel tasks belonging to other clients, exposing data and disrupting execution.
Affected context
This vulnerability affects deployments using the MCP Python SDK where server.experimental.enable_tasks() is called to enable default task handling.
In environments where multiple independent clients connect to the same MCP server instance, task operations are not scoped to the originating session.
As a result, handlers for tasks/list, tasks/get, tasks/result, and tasks/cancel treat task identifiers as globally accessible without binding them to a particular client session or tenant.
Exploit preconditions
- Attack surface: MCP server endpoints providing task management via the experimental tasks API.
- Required access: Ability to connect as a client to an affected MCP server (legitimate or otherwise) that shares the task space with other clients.
- Trigger point: Issuing task-related requests (
tasks/list,tasks/get,tasks/result,tasks/cancel) that reference task identifiers created by other sessions. - Why exploitation is possible: The default task handlers track tasks only by ID and do not record or enforce the originating session, user, or tenant, so authorization is not evaluated per caller.
Why this happens
The core issue is a missing authorization check on task operations, aligned with CWE-862: Missing Authorization.
The experimental task handlers manage tasks in a shared namespace keyed solely by identifier without persisting the relationship between a task and the session, client, or principal that created it.
Because access decisions are based only on the existence of a task ID and not on who is performing the operation, any connected client can perform management actions on any task, violating isolation between sessions.
Potential impact
- An unauthorized client may list other clients' tasks, exposing task metadata and existence.
- Attackers could read or consume task results belonging to other sessions, leading to sensitive data exposure.
- Malicious clients can cancel in-progress tasks created by others, disrupting workflows or automated processes.
- Attackers may interfere with message streams or task lifecycles, causing confusing or corrupted task states for legitimate users.
General mitigation guidance
Mitigation centers on enforcing strong per-session and per-principal authorization around task management.
Recommended patterns include:
- Associating each task with a stable session or identity attribute at creation time and enforcing that subsequent operations on that task are allowed only from the same session or authorized principals.
- Designing task storage with explicit tenant or client scoping, ensuring that identifiers are not globally valid across unrelated clients.
- Applying least-privilege principles so that default task handlers permit access only to resources owned by the caller unless an explicit shared-access model is implemented.
- Avoiding reliance on opaque identifiers alone for authorization decisions; combine identifiers with contextual checks such as session, user, or capability tokens.
- Documenting and limiting use of experimental or shared APIs to trusted environments until robust authorization is implemented.
How teams detect issues like this
Detection efforts can focus on both code-level and runtime indicators:
- Static analysis and review:
- Flag handler implementations that access or mutate tasks based solely on task IDs without referencing session or identity metadata.
- Look for shared in-memory or global registries used for multi-client state without tenant or session keys.
- Enforce review checklists requiring explicit authorization calls on all operations that cross client boundaries (list, get, cancel, update).
- Runtime monitoring:
- Log task creation and subsequent access, including client/session identifiers, and alert on cross-session access to the same task ID.
- Monitor for abnormal patterns such as frequent task cancellations or result retrievals from a single client targeting tasks it did not create.
- Automated tooling:
- Integrate policy checks into CI/CD to detect handlers or routes lacking authorization guards.
- Use security scanning tools that highlight endpoints with read or write capabilities missing access control logic.

