Skip to content

Confused deputy ​

A program that holds more authority than its caller and is tricked into using that authority on the caller's behalf, doing something the caller could not do directly.

The deputy is not malicious, only confused: it checks that a request is well formed, not whether this caller may make it, and then acts with its own rights. MCP setups have two common cases.

  • OAuth proxy servers. An MCP server in front of a third-party API may have to share one static OAuth client id across users when that API cannot register clients dynamically. The MCP security best practices show how an attacker registers a client, sends the user a crafted link, rides the consent cookie from the user's earlier login past the consent screen, and receives an authorization code meant for the user. The spec's fixes: per-client consent before forwarding (a MUST), exact redirect URI matching, and single-use state values set only after consent.
  • Agents with shared credentials. OWASP's MCP cheat sheet describes the general case: "The MCP server executes actions with its own (often broad) privileges, not the requesting user's permissions." An agent is a deputy too, and prompt injectionPrompt injection: Input that makes a language model ignore or change the instructions its application gave it, so it does something the application did not intend. is a way to confuse it.

Example ​

A help-desk agent reads customer records through an MCP server that holds an admin database token. Alice, a support agent for Europe, asks: "Summarise account 4471." Account 4471 is in the US region, which Alice may not see. The server checks the query, not Alice, and answers. Alice has borrowed the agent's authority.

The fix is to carry the caller into the call: run the tool with Alice's own credential, or check her rights before it runs.

Common confusion ​

A confused deputy is not the same as token passthroughToken passthrough: An anti-pattern in which an MCP server accepts an access token that was not issued for it and forwards that token to a downstream API; the MCP specification forbids it.. Passthrough is one way to create the problem: the downstream API trusts a token as if the MCP server had vouched for it. A deputy can be confused with no token forwarding at all, simply by using its own broad credential.

In L2M ​

For HTTP servers that use OAuth, an admin can optionally switch a registered server to delegated credentials: each call then uses the signed-in user's own connection (or the gateway client owner's), never a shared fallback. Tool policy can limit tools and arguments by role. L2M's own OAuth flow uses PKCE, single-use state and an issuer check (OAuth for remote servers).

Further reading ​

This website (not the L2M product) uses Google Analytics, only after you accept cookies. Cookie settings