Stealing the Keys to the Agentic Cloud: Critical Authorization Fl
The MCP Python SDK's experimental tasks API lacked object-level authorization, so any authenticated client on a shared server could list, read, and cancel other clients' tasks. An attacker could steal queued one-time OAuth callback URLs and other sensitive messages, leading to account takeover of downstream services.
Published on medium.com
Artificial intelligence agents are rapidly evolving from simple chat interfaces into autonomous systems that take real-world actions. To execute these complex tasks, agents rely heavily on the Model Context Protocol (MCP), an open standard released by Anthropic in November 2024 to serve as the universal connector…
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
The task handlers operated only on a raw task ID and never checked which client session owned the task, so the global task store had no per-client ownership record.
Impact
An attacker could steal live one-time OAuth callback tokens and other queued messages, potentially taking over the victim's authenticated sessions on downstream platforms such as AWS, GitHub, or Salesforce, and could also cancel other clients' tasks.
What the attacker needed
Access to a shared multi-tenant MCP server; experimental tasks API enabled; victim has an active task with queued messages
The fix
The SDK was fixed in version 1.27.2 by binding task identifiers to session markers, restricting tasks/list to the calling client, and returning a not-found error for unowned tasks; the maintainers also decided to remove the experimental tasks API entirely in v2.0.0.
How it was found
- Enable the experimental tasks API on a shared MCP server.
- A victim tool creates a task and queues a sensitive OAuth callback URL as an elicitation message.
- The attacker calls tasks/list and discovers the victim's task ID.
- The attacker calls tasks/result against the victim's task ID, which dequeues and delivers the queued message to the attacker.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
When several AI agents share one server, each agent's background job should be private. Here, the server let any connected client ask for a list of all jobs and then fetch the results of someone else's job. That let an attacker grab a secret login link meant for another user and use it to access that user's cloud account.
What is Access control?
A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.