Live on Product Hunt Intraface launched today. Less steering, more vacations. See the launch
Start for free

What is the confused deputy problem?

The confused deputy problem is when a program that holds authority is tricked into using it for someone who should not have it. The deputy is honest but confused: it cannot tell whose request it is serving. In MCP, the classic case is a proxy server that signs in to a third-party API with one shared client ID.

Part of Glossary: the terms behind MCP, coding agents and shared pages, defined plainly.

How it works

An attacker registers their own client with an MCP proxy, then reuses your earlier consent to make the proxy hand them a code that acts as you.attackeryouMCP proxy serverone shared client IDthird-party sign-inremembers your consent1. registers a client2. sends you a link3. cookie skips consent4. code, as you5. code to attacker
  1. A proxy MCP server fronts a third-party API and signs in to it as one OAuth client, using a single static client ID for every user.

  2. You approve that proxy once. The third-party sign-in page sets a cookie so it will not ask you again for the same client ID.

  3. An attacker registers their own MCP client with the proxy, pointing its redirect address at a site they control, and sends you a link.

  4. Your browser still has the cookie, so the consent screen is skipped and the proxy receives an authorization code on your behalf.

  5. The proxy forwards the result to the attacker's redirect address. The attacker trades it for a token and now acts as you.

  6. The fix the MCP spec requires: the proxy shows its own consent screen per client, before it ever forwards you to the third party.

Source: MCP specification: security best practices

Where the name comes from

Norm Hardy described the problem in 1988. A compiler on a shared system was allowed to write to a billing file so it could record usage. A user asked it to write debug output to a path that happened to be that billing file. The compiler was permitted, the user was not, and the compiler could not tell the difference because it ran with its own authority rather than the user's. Hardy's point was that any program acting for others with its own permissions is a deputy, and a deputy that cannot track whose authority it is spending will eventually be confused.

Example: an MCP proxy with one client ID

The MCP security best practices document works through the modern version. A proxy MCP server sits between agents and a third-party API. Because that API's authorization server may not let clients register themselves, the proxy uses one static client ID for everybody. Meanwhile the proxy itself does let MCP clients register dynamically, each with its own redirect address.

You sign in once. The third-party page sets a consent cookie for the proxy's client ID. Later an attacker registers a client with the proxy whose redirect address is a site they own, then sends you a crafted link. Your browser carries the cookie, the consent screen is skipped, and the proxy, believing it is finishing a flow you started, redirects an authorization code to the attacker. They exchange it for a token, and the proxy now serves them as you. Every component worked as designed. None of them knew who was really asking.

The required fix is per-client consent at the proxy. Before forwarding you to the third party, it shows its own screen naming the client, the scopes requested and the exact redirect address, and it remembers your answer per client ID, not per person. Redirect addresses must match the registered value exactly, with no wildcards.

Why it matters for agents

An AI agent is a deputy by construction. It holds your tokens and acts on text from many sources. When prompt injection succeeds, the agent is a confused deputy: an attacker's instructions carried out with your authority. So the defenses are the ones capability-security researchers reached decades ago. Give the deputy only the authority the task needs. Bind authority to the requester, not to the program. Make the deputy check who it is serving before it spends anything.

A server can help from its side. Intraface, for example, gives each agent its own token with its own scopes and, optionally, a list of boards it may touch. A confused agent cannot reach a board its token never covered.

Common mistakes

  • Token passthrough. An MCP server that accepts a token issued for some other service and forwards it downstream has made itself a deputy with no idea who the principal is. The MCP authorization spec forbids it.
  • Consent per user instead of per client. A cookie that says this person agreed is what the attack exploits. The question is whether this person agreed to this client.
  • Pattern-matching redirect addresses. Wildcards and prefix matches reopen the hole. Exact string comparison only.
  • Assuming trust flows through. A downstream API that trusts a proxy trusts everything the proxy can be talked into.

FAQ

Is the confused deputy problem the same as prompt injection?
They meet in the middle. Prompt injection is how an attacker gets instructions into an agent. Confused deputy describes the result: a program using the user's authority to serve someone else. One is the attack, the other is the structure that makes it pay.
Why does the confused deputy attack on MCP proxies need a consent cookie?
The cookie is what lets the attacker skip the screen you would otherwise see. The third-party sign-in page remembers that the proxy's client ID was approved, and because every user shares that ID, the attacker's crafted request looks like a repeat visit.
How does token passthrough lead to a confused deputy problem?
If an MCP server accepts a token issued for another service and forwards it downstream, the downstream API trusts it as if the server had checked it. The server is spending authority it never verified, which is the definition of a confused deputy.

Stop sending HTMLover Slack.

Create an account in a minute, connect your coding agent, and make your first board.