Skip to content

MCP Security: Real Incidents, Risks, and Mitigation Strategies

Featured Image

Model Context Protocol (MCP) gives AI agents a standardized way to interact with external tools, databases, APIs, files, and services.

That connectivity is also where much of its security risk sits.

Since 2025, researchers have documented MCP-related attacks ranging from indirect prompt injection and data exfiltration to local code execution and malicious package distribution.

Two vulnerabilities received critical CVEs:

→ CVE-2025-49596 in MCP Inspector

→ CVE-2025-6514 in mcp-remote.

Other incidents exposed architectural weaknesses around excessive permissions, tool trust, and software supply chains.

So, where does an MCP attack cross from untrusted input into privileged execution?

1. Prompt Injection Can Become Data Exfiltration

One of the earliest documented MCP attack paths involved GitHub.

In May 2025, Invariant Labs demonstrated how a malicious GitHub issue could contain hidden instructions that were processed by an agent using GitHub’s MCP server. The agent had access to private repositories. The injected instructions caused it to retrieve private information and place that information into a public pull request.

The technical problem was the trust boundary:

Public issue → MCP server → agent context → private repository access → public GitHub action

The MCP server performed its intended operations. The failure occurred because the agent treated attacker-controlled issue content as an instruction with authority comparable to the user’s original request.

This is effectively a confused-deputy problem. The agent possessed privileges that the attacker did not, and prompt injection caused the agent to exercise those privileges on the attacker’s behalf.

Granular permissions are therefore critical. An agent processing public GitHub content should not automatically inherit unrestricted access to private repositories.

2. Excessive MCP Permissions Can Turn Prompt Injection into Credential Theft

A similar pattern appeared in a Supabase and Cursor incident.

An attacker placed instructions inside a support ticket. Cursor’s agent, connected to Supabase MCP, had access to a service_role credential. The injected instructions caused the agent to query the integration_tokens table and return sensitive tokens through the same attacker-controlled ticket.

The attack combined three conditions:

Untrusted input + privileged data access + attacker-controlled output

That combination is sometimes described as the agentic “lethal trifecta.”

The MCP connection itself did not need to be compromised. The attacker manipulated the model’s interpretation of content while the agent already had excessive database privileges.

A safer architecture would use scoped database credentials, row-level security, read-only access where possible, and explicit controls over which data can leave the agent’s trust boundary.

3. MCP Tooling Itself Can Introduce Remote Code Execution

CVE-2025-49596 demonstrates a different class of problem.

MCP Inspector’s local proxy previously exposed functionality without sufficient authentication. A malicious webpage could interact with the local proxy and ultimately trigger MCP commands on the developer’s machine. The vulnerability was rated CVSS 9.4 and fixed in MCP Inspector 0.14.1.

This matters because localhost is often treated as inherently trusted.

It isn’t.

A local development service exposed through a browser can become an attack surface when origin validation, authentication, and network binding are weak.

The mitigation is therefore architectural as well as procedural: update vulnerable versions, require authentication for local control surfaces, validate browser origins, and avoid exposing development proxies beyond the interfaces that actually require access.

4. A Remote MCP Server Can Reach the Host OS

CVE-2025-6514 exposed an even deeper trust failure in mcp-remote.

The vulnerable versions accepted an attacker-controlled authorization_endpoint during the OAuth flow. A malicious MCP server could provide a crafted value that reached Node’s open() handling and ultimately resulted in arbitrary OS command execution. Versions from 0.0.5 through 0.1.15 were affected; 0.1.16 contained the fix. The vulnerability received a CVSS 9.6 rating.

The attack path is particularly important:

Untrusted MCP server → malicious OAuth response → client-side URL handling → OS command execution

The vulnerable component was a client-side bridge, but the input originated from the remote MCP server.

That means validating server-supplied values must happen before those values reach operating-system primitives.

5. MCP Supply Chains Create Another Attack Surface

Security failures also appeared before an MCP server even reached the agent.

In September 2025, a malicious npm package impersonating postmark-mcp added a hidden BCC address to outgoing emails. Every email sent through the package could therefore be copied to an attacker-controlled address.

The dangerous part was the simplicity of the modification: the package could perform its advertised function while silently executing an additional action.

A separate 2026 incident involved a fake Oura Ring MCP server distributed through the software supply chain. The package contained an obfuscated loader associated with the StealC infostealer and targeted saved credentials, tokens, SSH keys, and cryptocurrency wallet data.

This makes package provenance an MCP security control, not merely a software-development hygiene issue.

How to Mitigate MCP Security Risks?

MCP security needs controls at several layers:

1. Patch Vulnerable Tooling

Upgrade mcp-remote to 0.1.16 or later and MCP Inspector to 0.14.1 or later.

2. Reduce Agent Privileges

Give MCP servers narrowly scoped database, filesystem, GitHub, and API permissions. Avoid broad credentials such as unrestricted service accounts.

3. Treat Tool Metadata and External Content as Untrusted

Tool descriptions, GitHub issues, support tickets, documents, and API responses can all carry instructions capable of influencing an agent.

4. Verify MCP Packages

Check publisher identity, repository history, package provenance, dependency changes, pinned versions, hashes, and code before deployment.

5. Monitor Agent Actions

Log tool discovery, tool calls, arguments, authentication events, filesystem operations, database queries, and outbound network requests.

Traditional endpoint monitoring can miss agent-driven data movement because the activity may appear to come from legitimate applications.

6. Isolate High-Risk Tools

Run MCP servers and agents inside containers or VMs where possible, restrict outbound network access, and separate development credentials from production systems.

The Path to Secure MCP Adoption

MCP is quickly becoming part of the infrastructure behind AI agents. That means its security deserves the same architectural thinking we apply to APIs, databases, and production dependencies.

The incidents we have seen already point to a bigger issue:

An agent can turn a small trust failure into a privileged action.

A malicious instruction can trigger a database query. A compromised package can expose credentials. A vulnerable client can provide a path to the host system.

For CTOs and engineering leaders, the question should be:

What happens when an MCP connection we trust gets abused?

That answer should be designed before deployment. Scope the permissions. Isolate the execution environment. Verify every dependency. Monitor tool activity. Put clear boundaries around high-impact actions.

MCP will make AI agents significantly more capable. Our job as engineering leaders is to make sure that increased capability comes with equally strong control.

Get Consultation
How Secure is Your MCP Environment?
Get our MCP security assessment checklist and identify the security gaps that matter.

FAQs About MCP Security

What is MCP security?

MCP security refers to the controls used to protect AI agents, MCP servers, tools, credentials, and connected systems. It covers authentication, authorization, server trust, package security, sandboxing, data access, and monitoring. Strong MCP security limits what an agent can access and what actions it can perform if a tool or instruction is compromised.

Why is MCP security important for AI agents?

MCP allows AI agents to interact with databases, APIs, files, repositories, and other external systems. This gives agents useful capabilities but also creates additional security boundaries. A compromised MCP server, malicious instruction, or excessive permission can potentially turn an AI interaction into unauthorized system access or data exposure.

What are the main MCP security risks?

Common MCP security risks include prompt injection, excessive agent permissions, malicious MCP servers, vulnerable MCP clients, supply-chain attacks, credential exposure, and unauthorized tool execution. Weak authentication and limited monitoring can increase the impact of these risks. Security teams should evaluate both the MCP implementation and the systems connected to it.

How can organizations secure MCP servers?

Organizations should use trusted MCP packages, verify server provenance, keep MCP components updated, and run servers in isolated environments where possible. Access should follow least-privilege principles, with narrowly scoped credentials and network permissions. Organizations should also log MCP tool activity and monitor unusual processes, data access, and outbound connections.

How should teams monitor MCP security incidents?

Teams should capture MCP tool calls alongside authentication events, tool arguments, database activity, filesystem operations, processes, and outbound network connections. Correlating these events can help identify unusual agent behavior that traditional endpoint monitoring may miss. Security teams should also have procedures for revoking credentials and isolating compromised MCP components.

google
Siddharaj Sarvaiya
Siddharaj Sarvaiya
Program Manager - Azilen Technologies

Siddharaj is a technology-driven product strategist and Program Manager at Azilen Technologies, specializing in ESG, sustainability, life sciences, and health-tech solutions. With deep expertise in AI/ML, Generative AI, and data analytics, he develops cutting-edge products that drive decarbonization, optimize energy efficiency, and enable net-zero goals. His work spans AI-powered health diagnostics, predictive healthcare models, digital twin solutions, and smart city innovations. With a strong grasp of EU regulatory frameworks and ESG compliance, Siddharaj ensures technology-driven solutions align with industry standards.

Related Insights