MCP Python SDK OAuth Flaw Lets Malicious Servers Hijack AI Agent Accounts
A flaw in the Model Context Protocol Python SDK lets malicious servers steal OAuth credentials to hijack AI agent accounts.
Overview
A high-severity flaw in the official Model Context ProtocolAn open standard for connecting AI assistants to external data sources, files, and software tools Python SDKA bundle of code libraries, tools, and documentation that developers import to build apps for a platform allows malicious serversA computer or program on a network that stores data and responds to requests from client devices to steal OAuthAn open standard that lets one app use another service without sharing your password authenticationVerifying that a user, device, or program really is who it claims to be before allowing access material and take over AI agent accounts. The issue affects vulnerable HTTP-based clients that connect to untrusted servers while using OAuth to access legitimate identity providersThe central service that checks user logins and issues authentication tokens to connected workplace apps such as Google, Okta, or Microsoft Entra ID. MCP is an open protocolAn agreed set of rules and message formats that computers follow to exchange data over a network that lets AI assistants and agents connect with external tools, APIsA structured interface that lets one software program request data or actions from another program, and data sources. When a client needs authentication, it performs OAuth discovery to determine which authorizationChecking whether an already logged-in user or program has permission to perform a specific action server should handle login. The vulnerable SDK trusted data supplied by the MCP serverA connector program that gives an AI assistant access to a specific database, file system, or web API too heavily, allowing an attacker to redirectA web flaw where a trusted site accepts an outside URL parameter and forwards visitors there sensitive OAuth exchanges to attacker-controlled infrastructure. The flaw affects MCP Python SDK 1.9.1 through 1.29.1 in the 1.x branch and versions 2.0.0 through 2.1.1 in the 2.x branch.
Terms in this story
- Model Context Protocol
- An open standard for connecting AI assistants to external data sources, files, and software tools. Software teams use the Model Context Protocol so an AI coding tool or chatbot can query databases and run local commands, which makes securing those tool connections a major concern.
- Protocol
- An agreed set of rules and message formats that computers follow to exchange data over a network. Every internet service relies on a network protocol such as HTTP for web pages or DNS for domain lookups, and a logic flaw in a protocol's design affects every vendor that implements it.
- SDK
- A bundle of code libraries, tools, and documentation that developers import to build apps for a platform. Mobile app developers include third-party advertising or analytics SDKs in their apps, and a malicious or buggy SDK can quietly collect data from every app that bundles it.
- Servers
- A computer or program on a network that stores data and responds to requests from client devices. Online stores, email systems, and multiplayer games all run on servers in data centers or the cloud, making unpatched servers a primary target for intruders.
- OAuth
- An open standard that lets one app use another service without sharing your password. When you click a button to sign in with an existing account or let a calendar app read your schedule, OAuth issues an access token without sharing your password. Security+ objective 4.6 lists the term
- authentication
- Verifying that a user, device, or program really is who it claims to be before allowing access. When you enter a password, scan a fingerprint, or present a key, authentication checks your identity before a server decides what your account is allowed to do.
- identity providers
- The central service that checks user logins and issues authentication tokens to connected workplace apps. When your school or employer uses single sign-on, the identity provider is the login server that verifies your password and multifactor code before letting you into email or cloud apps. Security+ objective 4.6 lists the term
- APIs
- A structured interface that lets one software program request data or actions from another program. Mobile apps, websites, and cloud services talk to backend servers through an API, and a poorly protected API can let attackers pull customer records in bulk. Security+ objective 4.7 lists the term
- authorization
- Checking whether an already logged-in user or program has permission to perform a specific action. Authentication checks who you are at the front door, while authorization decides whether your student account is allowed to read only your own grades or edit the class roster.
- MCP server
- A connector program that gives an AI assistant access to a specific database, file system, or web API. When a developer connects an AI agent to an MCP server, a bug or malicious prompt in that connector can let the agent run unintended shell commands or read private files.
- redirect
- A web flaw where a trusted site accepts an outside URL parameter and forwards visitors there. Attackers abuse an open redirect on a well-known website so the link in their email starts with a trusted domain name before forwarding the victim to a fake login page.
- configuration
- A text file that stores settings, network addresses, and options for how a program or server runs. Attackers who gain read access to a server look for its configuration file first because it often contains database passwords, API keys, and internal server paths.
This page is a short description made for this site. The article itself, with its author's name and its own link, is on the Cyber Security News website. Cite the article, not this page.
Read the full article on Cyber Security News (opens in a new tab)
Course connections
Each line below connects this story to a Security+ objective (a skill on CompTIA's Security+ exam, a common first cybersecurity certification), a CYBR 101 week, or a cybersecurity job, and quotes the words that made the connection.
- Kind of story: Vulnerability and patch
"...high-severity flaw in the official Model Context Protocol (MCP) Python SDK..." Found by reading the article; these exact words are in it - Who is affected: "AI Agent Accounts..."
Copied word for word from the article - Security+ 2.3 Explain various types of vulnerabilities.
"MCP Python SDK OAuth Flaw Lets Malicious Servers Hijack AI Agent Accounts..." Found in the headline - Security+ 4.3 Explain various activities associated with vulnerability management.
"A high-severity flaw in the official Model Context Protocol..." Found in the opening sentences - Security+ 4.6 Given a scenario, implement and maintain identity and access management.
"MCP Python SDK OAuth Flaw Lets Malicious Servers Hijack AI Agent..." Found in the headline - CYBR 101 week 10: the web, cookies, phishing, incident response and logs
"......AI agent accounts. The issue affects vulnerable HTTP-based MCP clients that connect to untrusted..." Found in the opening sentences - CYBR 101 week 2: the CIA triad, threat actors, risk and CVEs
"......a malicious MCP server to steal OAuth authentication material and take over AI agent accounts...." Found in the opening sentences - CYBR 101 week 6: AI, how it is attacked, and what it does for attackers and defenders
"......SDK OAuth Flaw Lets Malicious Servers Hijack AI Agent Accounts..." Found in the headline - CYBR 101 week 8: networks, ports, DNS and packets
"......high-severity flaw in the official Model Context Protocol (MCP) Python SDK could allow a malicious..." Found in the opening sentences
How a story is connected to the course, and every objective, week and job role