MCP Security: Understanding the OWASP MCP Top 10 Vulnerabilities
Introduction
Artificial intelligence applications are increasingly moving beyond simple question-and-answer interactions. Modern AI assistants can access external tools, retrieve information from internal systems, interact with APIs, and perform actions on behalf of users. These capabilities make AI applications more useful, but they also introduce new security considerations.
The Model Context Protocol (MCP) is designed to make these integrations easier by providing a standardized way for AI applications to communicate with external tools and data sources. However, connecting an AI model to external systems also creates additional trust boundaries and potential attack surfaces.
A compromised MCP server, poorly configured permission, malicious tool description, or exposed credential could affect more than the AI conversation itself. Depending on the permissions granted to the integration, an attacker may be able to access sensitive information, manipulate tool behaviour, or trigger unintended operations.
This article explores the OWASP MCP Top 10 security risks, explains how these weaknesses can affect real-world AI integrations, and discusses practical controls developers and security teams should consider when designing MCP-based applications.
What Is Model Context Protocol (MCP)?
Model Context Protocol is an open protocol that enables AI applications to communicate with external tools, services, and data sources through a standardized interface. Instead of implementing a separate integration for every AI application and external service, developers can use MCP to establish a consistent communication mechanism.
For example, an AI assistant could use MCP to connect to a filesystem, query a database, interact with a source-code repository, or retrieve information from an internal knowledge platform.
An MCP environment commonly includes three components:
- MCP Host: The AI application that provides the user interface and coordinates interactions with the model and connected MCP clients.
- MCP Client: The component within the host that establishes and manages communication with an MCP server.
- MCP Server: The service that exposes capabilities such as tools, resources, and prompts to the AI application.
For example, when a developer asks an AI coding assistant to inspect a project, the application may communicate with a filesystem MCP server to retrieve relevant files. If the server exposes additional capabilities, the assistant might also be able to create, modify, or execute operations, depending on the permissions and implementation.
This is where security becomes important. An integration that begins as a read-only information source can become a significant attack surface if it is granted excessive access or is not properly secured.
Why Does MCP Introduce Security Challenges?
MCP creates a structured connection between AI applications and external systems. However, the AI model may interpret information received through these connections as context for its next response or action.
This creates several security concerns:
- Expanded access: AI applications may gain access to files, databases, APIs, and other internal resources.
- Trust boundaries: Information from external tools may contain inaccurate, manipulated, or malicious instructions.
- Permission management: Excessive permissions can allow an AI application or compromised integration to perform actions beyond its intended purpose.
- Credential exposure: API keys, access tokens, and other secrets may be exposed through insecure configurations or implementation mistakes.
- Limited visibility: Traditional application logging may not capture the complete sequence of interactions between users, models, MCP clients, and servers.
To help security professionals understand these risks, OWASP has introduced the MCP Top 10 project, which identifies important security concerns associated with Model Context Protocol implementations.
Understanding the OWASP MCP Top 10 Risks
1. MCP01 - Token Mismanagement and Secret Exposure
Token mismanagement occurs when authentication credentials, API keys, or access tokens are stored, transmitted, or handled insecurely. MCP integrations often depend on credentials to communicate with external services. If these credentials are exposed, an attacker may be able to access connected systems without going through the intended application workflow.
For example, an MCP server may use a long-lived API token to access a cloud storage service. If the token is hardcoded into a configuration file or accidentally included in application logs, anyone who obtains it may be able to access the resources permitted by that credential.
Recommended security controls:
- Store credentials in a secure secrets management service rather than source code or plain-text configuration files.
- Use short-lived credentials and rotate secrets regularly.
- Apply least-privilege permissions to tokens and service accounts.
- Prevent credentials from appearing in logs, error messages, and model context.
- Monitor for unexpected credential usage and revoke compromised tokens immediately.
2. MCP02 - Privilege Escalation via Scope Creep
Privilege escalation via scope creep occurs when an MCP integration gradually receives more permissions than it needs to perform its intended function. This can happen when developers grant broad access to simplify implementation or when additional capabilities are introduced without reviewing the original permission model.
Consider an MCP server designed to retrieve project information from a source-code repository. If it is granted unrestricted write access across the organisation, a compromised component could potentially modify repositories that are unrelated to the original task.
The risk increases when permissions are shared across multiple tools or when users cannot clearly understand which actions an AI assistant is authorised to perform.
Recommended security controls:
- Define permissions according to individual tools and business requirements.
- Separate read and write operations wherever possible.
- Require additional approval for sensitive or destructive actions.
- Review permission changes whenever new MCP capabilities are introduced.
- Use isolated service accounts rather than shared administrative credentials.
3. MCP03 - Tool Poisoning
Tool poisoning occurs when an attacker manipulates the information associated with an MCP tool so that an AI model is influenced into using it in an unintended or unsafe way.
MCP tools typically include descriptions that explain their purpose and how they should be used. AI applications may rely on these descriptions when deciding which tool to invoke. If an attacker can modify a tool description or introduce malicious instructions into its metadata, the model may be influenced by content that appears to be legitimate tool guidance.
For example, a malicious tool description might encourage an AI assistant to include sensitive project information when calling another service. The user may only see an ordinary tool interaction while the underlying tool instructions influence the model's behaviour.
Recommended security controls:
- Only install MCP servers and tools from trusted and verified sources.
- Review tool descriptions and metadata before deployment.
- Validate tool inputs and outputs independently of the model.
- Restrict tools to clearly defined business functions.
- Monitor changes to tool definitions and server configurations.
4. MCP04 - Software Supply Chain Attacks and Dependency Tampering
MCP servers often depend on third-party packages, open-source libraries, container images, and external services. These dependencies can introduce vulnerabilities into an otherwise secure integration.
An attacker who compromises a package or publishes a malicious dependency could introduce harmful functionality into an MCP server. This may allow unauthorised access, data collection, or execution of malicious code within the environment where the server operates.
For example, a development team may install an MCP server from a public repository without reviewing its dependencies. A compromised package included in that server could execute malicious code when the service starts.
Recommended security controls:
- Use trusted package repositories and verify package maintainers.
- Pin dependency versions and maintain software bills of materials (SBOMs).
- Scan dependencies for known vulnerabilities and suspicious behaviour.
- Review source code and build processes before deploying MCP servers.
- Use signed artifacts and controlled deployment pipelines where supported.
5. MCP05 - Command Injection and Execution
Command injection occurs when untrusted input is passed to operating system commands or execution environments without appropriate validation. This is particularly important for MCP servers that interact with filesystems, shells, developer tools, or system-level operations.
For example, an MCP tool may accept a filename or command parameter and pass it directly to a shell. If the implementation does not properly validate the input, an attacker may manipulate the parameter to execute unintended commands.
The impact depends on the privileges of the MCP server process. A server running with broad operating system permissions could expose files, modify data, or execute operations beyond the intended tool function.
Recommended security controls:
- Avoid passing untrusted input directly to shell commands.
- Use safe process execution methods with structured arguments.
- Validate and allowlist input values.
- Run MCP servers with restricted operating system permissions.
- Use container isolation and filesystem restrictions where appropriate.
6. MCP06 - Intent Flow Subversion
Intent flow subversion occurs when an attacker manipulates the sequence of information or actions within an AI application so that the model moves away from the user's original intent.
AI applications often combine user instructions, retrieved content, tool responses, and system-level instructions when deciding what action to perform. If untrusted information influences this process, the model may make decisions that do not match the user's expectations.
For example, a user may ask an AI assistant to summarise a document. The document could contain hidden or misleading instructions encouraging the assistant to perform an unrelated action using an available tool. If the application does not properly separate trusted instructions from untrusted content, the assistant may be influenced by that material.
Recommended security controls:
- Clearly separate system instructions, user requests, and external content.
- Treat retrieved documents and tool responses as untrusted input.
- Require explicit confirmation before sensitive actions.
- Validate whether a proposed tool action matches the user's original request.
- Apply policy checks outside the language model before executing important operations.
7. MCP07 - Insufficient Authentication and Authorization
Authentication verifies the identity of a user or service, while authorization determines which resources and actions that identity can access. Weaknesses in either area can allow unauthorised parties to communicate with an MCP server or access capabilities that should be restricted.
For example, an internally hosted MCP server may expose database operations without properly verifying the identity of the connecting client. An attacker who can reach the service may be able to invoke tools or retrieve information without appropriate authorization.
Recommended security controls:
- Implement appropriate authentication for MCP clients and servers.
- Enforce authorization checks on individual operations and resources.
- Validate access tokens, audiences, scopes, and expiry where applicable.
- Protect network communication using secure transport.
- Do not assume that an internal network automatically makes a client trustworthy.
8. MCP08 - Lack of Audit and Telemetry
Without sufficient logging and monitoring, security teams may struggle to understand what happened during an MCP-related incident. Traditional application logs may record that a request occurred without capturing which tool was invoked, what resource was accessed, or which identity initiated the operation.
For example, an AI assistant may retrieve sensitive information through an MCP server and pass it into another connected service. If the application does not maintain useful audit records, investigators may find it difficult to reconstruct the sequence of events.
Recommended security controls:
- Record tool invocations, user identities, timestamps, and execution outcomes.
- Monitor unusual access patterns and unexpected tool usage.
- Maintain logs across the host, client, and server components.
- Protect audit logs against unauthorised modification.
- Redact credentials and sensitive personal information from logs.
9. MCP09 - Shadow MCP Servers
Shadow MCP servers are MCP integrations deployed or used without appropriate organisational approval, visibility, or security oversight. They may be introduced by developers experimenting with AI tools or by teams connecting external services without following established security processes.
These integrations can create unmanaged access paths into organisational systems. Security teams may not know which servers are running, what data they can access, or whether their dependencies and permissions have been reviewed.
For example, a developer might run a locally installed MCP server that connects an AI assistant to an internal database. If the integration is not registered or monitored, it may bypass the organisation's normal security review process.
Recommended security controls:
- Maintain an inventory of approved MCP servers and integrations.
- Establish a formal review process before new servers are deployed.
- Monitor endpoints and environments for unauthorised MCP services.
- Apply standard vulnerability management and configuration policies.
- Provide developers with approved integration options and clear security guidance.
10. MCP10 - Context Injection and Over-Sharing
Context injection and over-sharing occur when sensitive or irrelevant information is introduced into an AI application's context without appropriate controls. MCP servers may retrieve information from multiple sources, and the model may use that information when generating responses or deciding which tools to invoke.
For example, an MCP server connected to an internal knowledge base may retrieve documents containing confidential business information. If access controls are not applied correctly, the AI assistant could expose information to a user who should not have access to it.
The risk is not limited to malicious instructions. Even legitimate data retrieval can create a privacy or confidentiality problem when the application retrieves more information than necessary.
Recommended security controls:
- Apply access controls before retrieving data from connected systems.
- Retrieve only the information required to complete the user's request.
- Classify sensitive data and apply appropriate handling policies.
- Prevent confidential information from being shared with unauthorised tools or users.
- Review how context is retained, transmitted, and removed across the application.
Practical Example: How an MCP Integration Can Be Exploited
Consider an AI-powered coding assistant connected to an MCP server that provides access to project files and development tools.
A developer asks the assistant to review a repository and identify potential security issues. During the review, the assistant retrieves a project file containing malicious instructions disguised as ordinary documentation. The instructions attempt to influence the assistant to access sensitive files and send their contents to an external destination.
This scenario combines several security concerns:
- Untrusted content: The malicious instructions are embedded in a file retrieved by the MCP server.
- Intent manipulation: The content attempts to redirect the assistant away from the developer's original request.
- Excessive permissions: The impact could be greater if the MCP server has access to sensitive files or unrestricted tools.
- Data exposure: Sensitive information could be disclosed if the application allows unauthorised data transfer.
The exact outcome depends on the AI application's design, available tools, permission boundaries, and security controls. Reading malicious instructions does not automatically mean that an AI assistant will execute them. However, this example demonstrates why external content must be treated as untrusted and why sensitive operations should be independently authorised.
Security Best Practices for MCP Implementations
Securing MCP requires more than protecting the protocol connection. Organisations should consider the complete application architecture, including the AI host, client, server, external services, credentials, and data sources.
The following practices provide a useful starting point:
- Apply least privilege: Give each MCP server only the permissions necessary for its intended function. Avoid unrestricted access to files, databases, and external services.
- Validate tool operations: Do not rely entirely on the language model to determine whether an action is safe. Enforce authorization and input validation in the application and server implementation.
- Protect credentials: Use secure secret storage, appropriate token lifetimes, and credential rotation. Never expose secrets in model context or application logs.
- Review external dependencies: Assess MCP server source code, packages, container images, and update mechanisms before deployment.
- Isolate execution environments: Use containers, restricted operating system accounts, and network controls to limit the impact of a compromised server.
- Monitor interactions: Maintain useful audit records for tool calls, access decisions, and sensitive operations.
- Test realistic attack scenarios: Include prompt injection, malicious tool metadata, unauthorized access, command injection, and data exposure scenarios in security assessments.
- Review integrations continuously: Reassess permissions, dependencies, server configurations, and data access as the AI application evolves.
Conclusion
MCP makes it easier for AI applications to interact with external tools and services, but these capabilities introduce security risks that should be considered during architecture and development. A vulnerability in an MCP server or an overly permissive integration can affect the confidentiality, integrity, and availability of connected systems.
The OWASP MCP Top 10 provides a useful starting point for identifying these risks. However, organisations should not treat the list as a complete security assessment. Each implementation has its own trust boundaries, data flows, permissions, and operational requirements.
Security teams and developers should evaluate MCP integrations as part of the wider application security process. Threat modelling, secure authentication, least-privilege access, dependency assessment, input validation, and continuous monitoring can help reduce the risks associated with AI-connected systems.
As AI applications become more capable of taking actions on behalf of users, securing the connections between models and external systems will become an increasingly important part of secure AI architecture.
Comments
Post a Comment