Analysis · DiggingBeagle record

OAuth can complete correctly while an agent authenticates the wrong trust relationship

A September MCP Python SDK advisory and a November Copilot CLI device-code demonstration expose different identity-binding mistakes. The first lets an untrusted server choose a credential destination; the second relies on human consent to an unintended OAuth flow.

Published
Nov 19, 2026

Overview

A successful OAuth exchange says that a token was issued through a recognized protocol. It does not, by itself, establish that the human or application intended the recipient, the issuer or the requested scope. Two separate agent-security findings reveal why that distinction matters. The MCP Python SDK had an authorization-server binding weakness, and Microsoft later demonstrated a user being induced to approve an unintended device-code flow in a coding agent.

The server should not name the destination for its own credentials

The MCP Python SDK advisory, originally published September 28, 2026, describes HTTP OAuth client paths in which an untrusted MCP server could influence authorization-server metadata. In affected versions, the client could send a pre-provisioned secret, authorization code or signed assertion toward a token endpoint chosen through the server-controlled discovery path. The issue relied on missing issuer validation and credential-to-issuer binding, not on an agent being persuaded by a prompt.

The vulnerability covered the Python mcp SDK's affected 1.x and 2.x client lines and was corrected in 1.30.0 and 2.2.0 respectively, with an important configuration condition. For unattended client-credentials and private-key-JWT providers, the advisory says operators must explicitly set issuer=; simply upgrading without that binding can leave those providers following the server-advertised authority. The report explicitly excludes stdio clients and some other client configurations, so the entire MCP ecosystem cannot be assumed vulnerable.

The user can approve the wrong client on the right website

The Copilot CLI device-code demonstration, published November 17, addresses a different actor. There, a user is tricked into entering a device code and granting consent in a legitimate authentication interface. Subsequent remote steering, cloud-history access or repository reads depend on the resulting OAuth scope, account grants and enabled agent features. The identity server did not have to be malicious. The binding failed between the person's intent and the authorization request they accepted.

Boundary Attacker-controlled input Correct place for the check
MCP OAuth issuer Server metadata identifying an authorization endpoint Client issuer pinning and credential registration binding
Device-code consent An authorization request the victim did not initiate Human-visible client identity, scope review and policy-constrained grants

Both situations can culminate in a real credential or token being presented in an unintended context. Yet they demand different defenses. A pop-up asking the user to approve a tool call cannot repair a secret being sent automatically to an attacker-selected issuer. Strict issuer validation cannot prevent a human from knowingly entering an unexpected device code for an attacker-selected application.

This is a comparison of two disclosed mechanisms, not evidence that the same attacker exploited both or that either has a documented number of live victims. The generalizable lesson is that OAuth authorization is an agreement among specific identities and resources, not a reusable state called 'authenticated' that an agent can safely carry between arbitrary tools.

Research behind this