Malicious MCP Servers Bypass AI Agent Permissions: Inside the GitHub Search Hijack Targeting Cursor and Claude
Security researchers uncover weaponized Model Context Protocol servers running the Beretta stealer during process initialization, completely evading agent-level human approval prompts.
Published: 2026.12.04
Ranked first in 18 of 54 developer search queries
Executes in memory prior to first agent tool invocation
Documented crypto diversion across 23 static addresses
The Initialization-Phase Breach: How MCP Server Spawning Bypasses Agent Security Prompts
Model Context Protocol (MCP) integrations grant AI coding assistants external execution capabilities, database connections, and file access. When a developer registers an MCP server inside an environment like Cursor, Claude Code, or Cline, the agent spawns the underlying binary as a local child process. This process inherits the developer’s full operating system permissions.
A newly documented campaign dubbed MIOU demonstrates a critical architectural vulnerability in how developer tools isolate MCP runtimes. Malicious servers disguised as developer utilities for cryptocurrency exchanges execute an info-stealer named Beretta directly inside a function decorator. The malicious routines fire during the server’s initialization routine, mapping an encrypted binary into memory within 7 to 18 seconds of the host process launching.
Because the operating system executes this code before the AI agent issues its first tool call, interactive confirmation banners fail to intercept the payload. Security models that rely on user confirmation dialogs before invoking tools operate strictly at the application layer. By targeting the initialization handshake between the agent host and the local sub-process, the attack renders agent-level permission prompts structurally useless.
Malware detonation occurs prior to the agent tool-approval boundary
Developer points Cursor or Claude to a cloned repository containing a malicious MCP entry point.
A decorator executes during Python/Node server bootstrap, inheriting standard OS user privileges.
Within 7–18 seconds, an encrypted payload drops a COM-hijacking binary disguised as an Edge WebView component.
User-facing 'Approve tool execution?' prompts appear only after host environment compromise is complete.
Anatomy of the MIOU Campaign: Bot Farm Manipulation and the Beretta Stealer
The threat actors distributed the malware by manipulating GitHub repository ranking algorithms. Rather than relying on typosquatting package registries such as npm or PyPI, the group established 36 public repositories masquerading as portfolio trackers and trading bots for Lighter and Aster. The campaign deployed automated bot farms to simulate organic engagement and elevate the repositories across developer search queries.
Of 1,319 GitHub accounts interacting with the repositories, 1,222 were bot profiles created in coordinated batches. Automated scripts generated 26,407 of the 26,511 recorded commits, creating artificial commit frequency and star velocity. This artificial activity pushed the malicious repositories to the top search position in 33.3% of targeted queries (18 out of 54 search variations tested by researchers).
The primary payload, identified as Beretta, deploys custom cryptographic routines and configuration formatting distinct from commercial stealers like StealC. Once resident in memory, Beretta alters Windows Component Object Model (COM) interfaces by disguising its executable as an Edge WebView component. It maintains a persistent clipboard hijacker configured with 23 hardcoded cryptocurrency addresses, diverting transactions when developers copy addresses into desktop wallets or web browsers. Attacker-controlled wallets absorbed approximately $49,900 in diverted transactions between February and November.
Telemetry extracted from 36 malicious repositories analyzed by Apiiro
1,222 out of 1,319 total interacting accounts originated from coordinated bot farms.
26,407 bot commits manufactured continuous developer activity signals.
Hardcoded destination addresses monitored and diverted outbound wallet transfers.
Structural Blind Spots in Enterprise AppSec: Why Repository-Cloned MCPs Evade Scanners
Enterprise application security pipelines primarily inspect third-party dependencies through Software Composition Analysis (SCA) scanners connected to formal registries. When an engineer installs a package from PyPI, npm, or crates.io, automated pipeline scanners parse lockfiles (package-lock.json, poetry.lock) to cross-reference known Vulnerabilities and Exposures (CVEs) and scan for malicious maintainer updates.
Repository-cloned MCP servers bypass this detection boundary entirely. Because developers register MCP endpoints via direct Git clones (git clone followed by pointing the agent configuration JSON to a local executable or script), security telemetry pipelines never receive an installation event from a central artifact repository.
| Metric & Architectural Layer | Standard Registry Dependency (npm / PyPI) | Direct Git-Cloned MCP Server |
|---|---|---|
| SCA Telemetry Visibility | Immediate via lockfile tracking and manifest parsing | Zero visibility; treated as local unmanaged source code |
| Execution Permission Context | Package post-install scripts or runtime invocation | Inherits host developer user account permissions |
| Interception Mechanism | Registry quarantine, hash matching, lockfile pinning | Host-based Endpoint Detection and Response (EDR) only |
| Static Analysis Coverage | Pre-commit hooks, CI/CD static security scanners | Unaudited if executed exclusively on local workstations |
| Execution Trigger | Application runtime invocation | Server initialization decorator on agent launch |
| Bypass Surface | Typosquatting, compromised maintainer credentials | GitHub search algorithm manipulation and bot commit farming |
This delivery mechanism introduces a profound gap between developer workstation flexibility and enterprise compliance controls. Removing the cloned directory from the filesystem does not remediate an infection. Because Beretta modifies Windows COM registry entries and establishes persistent background processes, remediation requires full endpoint containment, credential revocation, and wallet migration from an isolated device.
Enterprise Containment and Runtime Isolation Architecture for AI Agents
Protecting enterprise environments from weaponized MCP infrastructure requires shifting trust boundaries from application-level confirmations to strict process isolation. Relying on an engineer to vet hundreds of lines of initialization logic before adding an MCP server to an agent configuration file is an unviable security strategy.
Architectural boundaries dictate exposure to initialization exploits
- • Runs directly inside developer user session and OS environment
- • Initialization code can modify host COM objects and clipboard
- • Accesses unencrypted local keys, shell histories, and credentials
- • MCP server spawns inside an ephemeral container or gVisor sandbox
- • No access to host clipboard, OS registry, or host-level network sockets
- • Execution terminates immediately upon agent process shutdown
Engineering organizations deploying AI coding agents must implement three mandatory controls to insulate developer workstations:
- Enforce Containerized MCP Runtimes: Never execute third-party MCP servers directly on bare-metal workstations. Configure Cursor and Claude integrations to spawn MCP processes exclusively within unprivileged Docker containers, rootless Podman instances, or lightweight micro-VMs. Restrict mounted volumes to the specific project directory, explicitly excluding the host filesystem, user profile, and SSH/GPG directories.
- Implement Egress Filtering and Clipboard Sandboxing: Bind MCP execution sandboxes to isolated network namespaces. Prevent outbound connections unless the server explicitly requires external API access, and block access to host inter-process communication (IPC) channels. The container must have no programmatic interface to the host operating system clipboard or Windows COM subsystems.
- Audit Local Agent Configuration Manifests: Security teams must treat local agent configurations (such as
claude_desktop_config.jsonor editor settings) as monitored configuration items. Deploy endpoint compliance scripts to detect newly registered command-line executables and flag unvetted GitHub repositories operating as MCP backends before execution starts.