part 5Security: the attack behind each rule·lesson 5.3 of 5·2 min read
Token passthrough and the confused deputy
Token passthrough and the confused deputy are two typical problems of an MCP server that acts as an intermediary in front of another API. This lesson explains why an MCP server must never forward the token it received, and how a proxy with a static client_id can be tricked into handing an authorization code to an attacker.
In this lesson
Explain why an MCP server must not forward the token it received.
Describe the confused deputy problem in an MCP proxy and its mitigation.
Token passthrough
An MCP server that wraps an API (a CRM's, for example) might be tempted to accept a token for that API from the client and forward it as is. The problems:
The MCP server does not validate that the token was issued for it: it breaks the audience rule (see lesson 5.2).
The MCP server's own controls (limits, auditing, its own scopes) are bypassed.
The API's logs show the client's identity, not the MCP server's: traceability is lost.
If the token is stolen, it works both on the MCP server and on the API behind it.
✘ Client ──token(aud=MCP)──▶ MCP server ──the same token──▶ CRM API
✔ Client ──token(aud=MCP)──▶ MCP server ──its OWN token(aud=CRM)──▶ CRM API
MCP 2025-06-18 forbids it: the MCP server must obtain its own token for that API (see lesson 4.6).
Confused deputy
A "confused deputy" is a privileged intermediary that is tricked into using those privileges on behalf of someone it should not serve.
The typical MCP scenario: an MCP server acting as a proxy to a third-party API uses a single static client_id with that third party's AS, and at the same time lets MCP clients register dynamically with it.
You already used the proxy legitimately: the third party's AS remembers (via a cookie) that you consented to the proxy's static client_id.
An attacker registers a client at the proxy with their own redirect_uri and sends you a link.
You click: the proxy sends you to the third party's AS with its static client_id; since you already consented, the AS does not ask again.
The proxy receives the code and, confused, delivers it to the attacker's redirect_uri.
Summary
Never forward the token you received: obtain your own token for each API behind you.
A proxy with a static client_id must ask for consent per client.
quiz · 2 questions
1. What is the essential flaw of token passthrough?
It is the rule of rejecting tokens issued for someone else, seen from the intermediary's side.
2. In the confused deputy scenario, why does the user not see any consent screen?
Consent was given to the proxy, not to each client behind it. That is why the proxy must ask for consent per client.