One click was enough at three major services, not because OAuth broke, but because a self-registered client was treated as a trusted one. Three checks in your own code close the gap.

Your MCP server lets any AI client connect in one step. That is the selling point. Paste a URL, the client registers itself, the user approves, tools start running.

Now count what that convenience costs you. On December 1, 2026, Salt Labs published research showing one-click account takeovers at three major online services: a social platform, a payments provider, and a cloud collaboration platform, together serving hundreds of millions of users. The services are not named, at their request, after coordinated disclosure. In every case the attacker started the same way. He registered his own OAuth client through open Dynamic Client Registration, received a valid client ID, and placed that client inside the real sign-in flow of the service.

Registration worked exactly as designed. That is the problem this piece fills in. Most explainers stop at "turn off open registration if you can." Salt Labs is clear that the three failures sat behind registration, and each one is a check you can write, test, and run today, whether or not you keep registration open.

Understand What Registration Actually Proves

Dynamic Client Registration, defined in RFC 7591, lets a client obtain a client ID through an API call instead of a developer filling in a form. The client supplies its own name, its own redirect URI, and the rest of its metadata. The server generates an ID and returns it.

Read that again, because the whole attack lives in it. In Dynamic Client Registration, the client decides what to send. A successful registration proves one thing only: the client can call an API. It says nothing about who runs the client, where its redirect URI points, or whether a user would recognize its name on a consent screen.

Salt Labs researcher Yaniv Balmas put it plainly in the December 1 announcement: "MCP did not create a new OAuth vulnerability. It changed who gets to take part in the OAuth flow." When any application can register itself, a valid client ID is an identity with no trust attached. Your server has to supply the trust, in code, at three specific points.

The newer MCP authorization specification, dated November 25, 2025, recommends Client ID Metadata Documents instead of Dynamic Client Registration, and keeps registration only as a fallback. Salt Labs notes the limit honestly: an attacker can host a metadata document on his own domain too. The specification gives you a better basis for a trust decision. It does not make the decision for you.

Name the Three Weak Links

Each service failed at a different point. The attack flow stayed the same, and only the weak link changed.

Case 1, the collaboration service: the redirect check trusted a string. The service did try to limit where codes could go. A redirect URI on a plain attacker domain was rejected. A URI shaped as https://attacker.com/.acme.com/ was accepted, even though its host is attacker.com and the trusted name sits in the path, where it means nothing. The check appears to have searched for the trusted name inside the URL instead of parsing the URL and checking its host. For a signed-in victim, the flow then completed with no consent screen at all, and the researchers exchanged the code for a token and called the API as the victim.

Case 2, the social platform: consent could be submitted cross-site. This service showed a consent page for new clients. A crafted page on the attacker's site submitted that authorization step directly, as a cross-site form post, using the victim's existing session. The server accepted a post from another origin as the user's approval. No CSRF token stood in the way. One visit to the attacker's page produced a code at the attacker's callback.

Case 3, the payments platform: consent was remembered for the wrong client. This service enforced consent, and the usual bypass attempts failed. The flaw was in the memory. The platform's official MCP client and the attacker's client shared an internal OAuth service, and a user's earlier approval of the official integration counted as approval for the new client. Anyone who had already connected the official integration, which is to say the exact users most likely to click, got no new prompt at all.

Notice what PKCE does not do here. The attacker starts the flow and holds his own verifier, so Proof Key for Code Exchange protects the code from a third party, not from the party who requested it. Do not list PKCE as your defense against this attack. It solves a different problem.

Put the Three Checks in One Gate

Here is the gate, in standard library Python. It sits at the authorization endpoint, outside the model and outside the client, and it makes the three decisions Salt Labs names: where the code may go, what this specific user approved, and whether the consent post really came from your consent page.

#!/usr/bin/env python3 """Gate an MCP OAuth authorization flow: registration is not trust.""" import secrets from urllib.parse import urlparse CLIENTS = { "official-mcp-client": { "redirect_uris": ["https://client.example.com/callback"], "trusted": True, "max_scopes": {"files:read", "files:write"}, }, # Registered five minutes ago through open DCR. It has an identity. # It has no trust. "dcr-attacker-7f3a": { "redirect_uris": ["https://attacker.com/callback"], "trusted": False, "max_scopes": {"files:read"}, }, "dcr-legit-new-app": { "redirect_uris": ["https://newapp.example.org/oauth/callback"], "trusted": False, "max_scopes": {"files:read"}, }, } CONSENTS = {} # (user, client_id, redirect_uri, frozenset(scopes)) -> True CSRF_TOKENS = {} # token -> (user, client_id) def redirect_ok(client_id, redirect_uri): """Exact match against the registered value, after parsing.""" client = CLIENTS.get(client_id) if client is None: return False, "unknown client_id" parsed = urlparse(redirect_uri) if parsed.scheme not in ("https",) and not ( parsed.scheme == "http" and parsed.hostname in ("127.0.0.1", "localhost") ): return False, "redirect must be https or loopback" if redirect_uri not in client["redirect_uris"]: return False, "redirect_uri does not exactly match the registered value" return True, "redirect exact match" def issue_consent_page(user, client_id): token = secrets.token_hex(8) CSRF_TOKENS[token] = (user, client_id) return token def record_consent(user, client_id, redirect_uri, scopes, csrf_token, origin_ok): if not origin_ok: return False, "consent POST came from another origin" if CSRF_TOKENS.get(csrf_token) != (user, client_id): return False, "missing or wrong CSRF token for this consent page" ok, why = redirect_ok(client_id, redirect_uri) if not ok: return False, why CONSENTS[(user, client_id, redirect_uri, frozenset(scopes))] = True return True, "consent recorded for this client only" def authorize(user, client_id, redirect_uri, scopes, consent_token=None, origin_ok=True, user_clicked_consent=False): client = CLIENTS.get(client_id) if client is None: return "DENY", "unknown client_id" ok, why = redirect_ok(client_id, redirect_uri) if not ok: return "DENY", why if not set(scopes) <= client["max_scopes"]: return "DENY", "scope exceeds what this client may request" key = (user, client_id, redirect_uri, frozenset(scopes)) if key in CONSENTS: return "ALLOW", "prior consent for this exact client, redirect and scopes" if not client["trusted"] and not user_clicked_consent: return "DENY", "untrusted self-registered client, no consent shown" if user_clicked_consent: ok, why = record_consent(user, client_id, redirect_uri, scopes, consent_token, origin_ok) if not ok: return "DENY", why return "ALLOW", "fresh consent recorded for this client" return "DENY", "no consent on file for this client" 

A few things are worth noting about this example. First, the redirect check compares the complete URI against the registered string. It never asks whether the URI contains a trusted name, because a path segment is not a host. Second, the consent key includes the client ID, the redirect URI, and the scope set. Change any one of them and the stored approval stops applying, which is what kills Case 3. Third, consent is recorded only after the CSRF token issued with that consent page comes back from the same origin. A form on another site has neither, which is what kills Case 2.

The flow, end to end:

client registers (DCR or metadata document) | v authorize() -- redirect exact match? -- no --> DENY | yes v scopes within this client's ceiling? -- no --> DENY | yes v consent on file for (user, client, redirect, scopes)? -- yes --> ALLOW | no v real consent page, CSRF token, same origin? -- no --> DENY | yes v record consent for this client only --> ALLOW 

Run It Against the Three Cases

The companion script, oauth_gate.py in the draft folder, drives nine checks through this gate: a proper setup approval for the official client, the three Salt Labs cases, an unregistered redirect variant, a scope grab, and three legitimate flows. Measured output on Python 3:

ALLOW setup: official client, real consent page: fresh consent recorded for this client DENY case 1: redirect https://attacker.com/.acme.com/ trick: redirect_uri does not exactly match the registered value DENY case 1b: unregistered redirect for a known client: redirect_uri does not exactly match the registered value DENY case 2: cross-site consent POST, no CSRF token: consent POST came from another origin DENY case 3: reuse official consent for attacker client: untrusted self-registered client, no consent shown DENY scope grab: untrusted client requests files:write: scope exceeds what this client may request ALLOW legit: official client, repeat visit: prior consent for this exact client, redirect and scopes ALLOW legit: new app, real consent click: fresh consent recorded for this client ALLOW legit: new app, repeat visit: prior consent for this exact client, redirect and scopes total: 9 checks, 4 allowed, 5 denied attack checks denied: 5/5 legit checks allowed: 3/3 

Run it yourself before you adapt it:

python3 oauth_gate.py curl -s https://your-mcp-server.example.com/.well-known/oauth-authorization-server | python3 -m json.tool 

The second command is reconnaissance on your own server. If the metadata document advertises a registration endpoint, assume anyone on the internet has already found it, and test your flow the way Salt Labs did: register a client with a redirect URI you control, try path and subdomain variants of a trusted name, submit the authorization step from another origin, then approve your official client and try a second client with the same account. If any of those completes without the user explicitly approving the new client, you have found your weak link before someone else does.

Where This Breaks

  • The gate decides at authorization time. It does not shorten the life of a token already issued, bind that token to your MCP server as its audience, or revoke it. Short token lifetimes, the resource parameter, and audience validation are separate controls, and Salt Labs lists them for a reason.
  • Exact redirect matching will break clients that legitimately vary their redirect URI, for example native apps using ephemeral loopback ports. RFC 8252 allows port flexibility for loopback redirects. Handle that as a named exception for loopback only, never as a looser string match for remote hosts.
  • Client ID Metadata Documents move the trust problem, they do not remove it. Your server now fetches a URL an unknown client supplied, which is its own server-side request surface, and a localhost client can still be impersonated. Decide which domains earn which scopes, and show the domain on the consent screen.
  • A consent screen only helps if the user can tell clients apart. If your screen shows a name the client supplied about itself, an attacker will supply a familiar name. Show the redirect host, which the client cannot fake without failing the exact match.
  • None of this fixes a user who reads a correct consent screen and clicks approve anyway. It restores the click to one real decision about one named client. That is a smaller promise than most OAuth diagrams make, and it is the honest one.

Build It If, Skip It If

Build it if:

  • Your MCP server supports OAuth and accepts clients you did not pre-register.
  • Two or more clients share one internal authorization service, which is where consent reuse hides.
  • Your consent step is a form post like any other, with no CSRF token of its own.

Skip it if:

  • You pre-register every client by hand and dynamic registration is off. Keep the exact redirect match and the per-client consent store anyway. They cost an afternoon at most and they are the parts that failed at scale.
  • Your server is local only, with no remote OAuth flow. Your risks live elsewhere, in the workspace and tool layers.

The minimal viable version fits in an afternoon: exact redirect comparison at registration and at authorize time, a consent store keyed by client, redirect, and scopes, and a CSRF token on the consent post. Everything else in the gate is refinement.

Pick one MCP server you run, register a test client against it tonight, and run the four attacker tests from the Salt Labs checklist against your own flow. Measure which ones complete. Fix the one that does, before you tune anything else.

If you run an MCP server with OAuth, which of the three weak links did you check first, and what did you find?

Resources

  1. Salt Labs, One-Click Account Takeovers Through MCP OAuth, December 1, 2026
  2. Salt Security announcement via EIN Presswire, December 1, 2026
  3. RFC 7591, OAuth 2.0 Dynamic Client Registration Protocol
  4. RFC 8252, OAuth 2.0 for Native Apps
  5. Model Context Protocol authorization specification