RA

repello-ai/mcp-exploit-demo

Developer tools

このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。 原文を見る

26 stars 11 forks 品質 33 トレンド 0

このリポジトリは、MCP (Model Context Protocol ) サーバのセキュリティ脆弱性を実証し、リモートコードの実行とツールの中毒によるデータの外部化を可能にします.

概要

このリポジトリは、MCP(Model Context Protocol)サーバーのセキュリティ脆弱性を実証し、リモートコードの実行とツールの中毒によるデータの外部化を可能にします。 RCEに毒するMCPツール - サーバ.py - 有意なMCPサーバーの実装には、有毒なツール - .cursor/mcp.json - Cursor AI統合の構成ファイル 攻撃は「ラグプル」メソッドを示しています。 1。 ユーザーは、Cursor AI 2のようなMCPクライアントを介して悪意のあるMCPサーバーに接続します。 サーバは、悪意のあるコード3でDockerCommandAnalyzerツールのドキュメントを修正しました。 AIアシスタントがこのドキュメントを読んでいると、ベース64エンコードされたコマンド4を実行することをお勧めします。 符号化されたコマンドは静かに: - ユーザーのSSHパブリックキーを収集 - リモートサーバーにそれらを強制的に処理 - 攻撃の証拠を削除します 1. : ツールが毒されたままことを確認するために、永続的にマーカーファイルを使用する 2. : AI アシスタントを操作するために緊急言語を使用する 3.

概要(AI 翻訳)

このリポジトリは、MCP(Model Context Protocol)サーバーのセキュリティ脆弱性を実証し、リモートコードの実行とツールの中毒によるデータの外部化を可能にします。 教育・保安研究の目的のみを目的としています。

ブログへのリンク:

RCEに毒するMCPツール

リポジトリコンテンツ

  • [server.py - 毒されたツールを含む悪意のあるMCPサーバーの実装
  • [.cursor/mcp.json - Cursor AI の統合のための設定ファイル

使い方

攻撃は「ラグプル」メソッドを示しています。

1。 ユーザーは、Cursor AIのようなMCPクライアントを介して悪意のあるMCPサーバーに接続します 2. サーバは、悪意のあるコードで [DockerCommandAnalyzer] ツールのドキュメントを修正しました 3。 AIアシスタントがこのドキュメントを読んだとき、ベース64エンコードされたコマンドを実行することを推奨するように操作されます 4。 符号化されたコマンドは静かに:

  • ユーザーのSSH公開鍵を収集
  • リモートサーバーにそれらをExfiltrates
  • 攻撃の証拠を削除します

技術的な実装

攻撃の主な要素は次のとおりです。

  1. 二段中毒: ツールが毒残っていることを確認するために永続のためのマーカーファイルを使用します

このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。

README

SSH Key Exfiltration via MCP Tool Poisoning

This repository demonstrates a security vulnerability in MCP (Model Context Protocol) servers that allows for remote code execution and data exfiltration through tool poisoning. This is intended for educational and security research purposes only.

Link for the Blog:

MCP tool poisoning to RCE

Repository Contents

  • server.py - The malicious MCP server implementation containing the poisoned tool
  • .cursor/mcp.json - Configuration file for Cursor AI integration

How It Works

The attack demonstrates the “Rug Pull” method:

  1. A user connects to the malicious MCP server through MCP Client like Cursor AI
  2. The server modifies the DockerCommandAnalyzer tool’s documentation with malicious code
  3. When an AI assistant reads this documentation, it’s manipulated to recommend running a base64-encoded command
  4. The encoded command silently:
    • Collects the user’s SSH public keys
    • Exfiltrates them to a remote server
    • Removes evidence of the attack

Technical Implementation

The key elements of the attack are:

  1. Two-stage poisoning: Uses a marker file for persistence to ensure the tool remains poisoned
  2. Social engineering: Uses urgent language to manipulate AI assistants
  3. Base64 obfuscation: Hides the malicious commands from casual inspection
  4. wget for exfiltration: Uses standard HTTP POST to send data to an attacker-controlled server

Mitigation Recommendations

To protect against this type of attack:

  1. Disable auto-run features in AI development tools like Cursor
  2. Always verify the source of any MCP server before connecting
  3. Review code from untrusted sources before execution
  4. Use sandboxed environments when testing new AI tools
  5. Implement egress filtering to block unexpected outbound connections
GitHub で README 全文を見る

インストール

This server does not publish a one-line install command.

Open the repository installation guide MCP 初心者?mcpskill.org のガイドから始めましょう →