MCP Servers Enable Arbitrary Code Execution and Data Theft


Model Context Protocol (MCP) servers face serious security flaws that let attackers run code and steal data. Launched by Anthropic in November 2024, MCP connects AI agents to external systems. Attackers now exploit this bridge for “machine-in-the-middle” attacks on local or SaaS-hosted servers.

Praetorian researchers found these gaps in February 2026 using MCPHammer validation tool. Attackers gain user-level access without tripping alarms. They execute code with victim privileges and pull sensitive files or credentials silently.

MCP servers act as trusted intermediaries. Attackers target them regardless of hosting type. No visual alerts warn users during compromise. Persistence or AI response poisoning follows undetected.

The rush to AI workflows ignores these risks. Legit tools chain with malicious ones for stealthy corporate access. Companies need strict MCP oversight now.

Core Attack Vectors

Praetorian demonstrated real exploits across MCP setups.

Malicious servers run arbitrary commands at user privilege. Local data like credentials flows out. TextEdit can display exfiltrated Slack messages as proof.

Supply chain hits package configs before tools launch. uvx downloads Python packages dynamically from config files. Typosquatting grabs similar names.

Slack MCP server tool permissions showing read-only and write โ€“ delete capabilities (Source โ€“ Praetorian)

Technical Breakdown

Attack TypeMethodImpact
Server CompromiseMalicious MCP endpointCode execution, data exfil
Supply Chainuvx typosquattingZero-click at startup
PersistenceSilent installsLong-term access
Response PoisoningManipulated AI outputsUser behavior control

Slack MCP Example

Praetorian tested Slack integration permissions.

  • Read-only access shows messages
  • Write-delete grants channel control
  • No auth verification exposes endpoints

Attackers chain read access to credential dumps. Full server control follows.

TextEdit launched displaying all exfiltrated Slack messages (Source โ€“ Praetorian)

Mitigation Steps

Organizations must lock down MCP deployments.

  • Review all MCP configs as adversarial code
  • Audit tool permissions, ban “always allow”
  • Monitor data flows between AI services
  • Block uvx dynamic package pulls
  • Deploy MCPHammer for validation
Common MCP Server Configuration File (Source โ€“ Praetorian)

Official Vendor Guidance

Praetorian Statement: “MCP creates hidden attack surface. Treat servers as untrusted code until proven safe.”

Anthropic Security: Review MCP server auth requirements in production docs.

FAQ

What is MCP vulnerable to?

Arbitrary code execution and data exfiltration via server compromise.

How do supply chain attacks work?

Typosquatting uvx package configs for zero-click execution.

Which data gets stolen?

Credentials, local files, Slack messages, browser data.

Is it local or cloud only?

Both. Hits workstation and SaaS MCP servers.

How to detect compromise?

Monitor unusual TextEdit launches, network flows to MCP endpoints.

Primary researcher tool?

MCPHammer validation framework from Praetorian.

Readers help support VPNCentral. We may get a commission if you buy through our links. Tooltip Icon

Read our disclosure page to find out how can you help VPNCentral sustain the editorial team Read more

User forum

0 messages