{
  "schema": "aidefend-secureflow-metadata-v1",
  "flow_id": "aidefend-research-sf0109-rufroot-ruflo-mcp-bridge-unauthenticated-rce",
  "title": "RufRoot: One Unauthenticated Request to Ruflo's MCP Bridge Ran Shell Commands in the Container",
  "subtitle": "Ruflo releases before 3.16.3 executed MCP tool calls from anyone who could reach the bridge, on a port that the default Docker Compose file published on every network interface. Noma Labs' proof of concept went from one request to stolen model-provider keys, poisoned agent memory, copied conversations and a script that loads again after a restart.",
  "summary": "Ruflo is an open-source platform for running groups of AI agents (swarms) with persistent memory and tool calling through the Model Context Protocol (MCP). Noma Labs found that its MCP Bridge, the server every tool call passes through, executed POST /mcp requests without authentication, on a port the default Docker Compose file published on all network interfaces. One request to the built-in terminal tool ran shell commands in the container. Noma's eight-step proof of concept then read the model-provider API keys, started swarms on the victim's keys, wrote a false policy into agent memory, copied every conversation and left a script that survives a restart. The flaw, CVE-2026-59726, is fixed in ruflo 3.16.3. No public source reviewed here reports use in a real attack.",
  "reviewed": true,
  "import_status": "curated-research",
  "ai_layers": [
    "tool-integrations-mcp",
    "autonomous-agents",
    "ai-infrastructure"
  ],
  "risk_impact": [
    "system-compromise-rce",
    "credential-identity-theft",
    "data-exfiltration",
    "model-poisoning-integrity",
    "resource-hijacking-cost"
  ],
  "affected_components": [
    "Ruflo MCP Bridge (Express.js server, POST /mcp, port 3001)",
    "ruflo__terminal_execute and the other tools served through the bridge",
    "Model-provider API keys in the bridge container environment",
    "AgentDB pattern store (persistent agent memory)",
    "MongoDB conversation store on the internal Docker network"
  ],
  "source_research": {
    "provider": "Noma Security",
    "primary_url": "https://noma.security/blog/rufroot-the-mcp-bridge-vulnerability-that-turns-agents-into-rogue-admins-cve-2026-59726/",
    "published": "2026-07-29",
    "note": "All eight steps come from Noma Labs' proof of concept, run against a default Ruflo deployment that the researchers operated on AWS EC2. The maintainers verified the claims from the source code without running the exploit. No reviewed public source reports use in a real attack."
  },
  "attack_steps": [
    {
      "id": "enumerate-tools",
      "title": "List the bridge's tools through the unauthenticated POST /mcp endpoint",
      "zhTitle": "不需驗證身分，就能透過 POST /mcp 列出 Bridge 的全部工具",
      "summary": "The proof of concept starts with a tools/list request to POST /mcp on port 3001. The bridge asks for no token, API key or other credential and returns all 233 tools it serves.",
      "zhSummary": "概念驗證的第一步，是對連接埠 3001 上的 POST /mcp 送出 tools/list 請求。Bridge 不要求 token、API 金鑰或其他憑證，直接回傳它提供的 233 個工具。",
      "tactic": "AML.TA0004",
      "technique": "AML.T0132",
      "layout": {
        "x": 0,
        "y": 0
      }
    },
    {
      "id": "terminal-rce",
      "title": "Run shell commands with ruflo__terminal_execute",
      "zhTitle": "呼叫 ruflo__terminal_execute，在容器內執行 shell 命令",
      "summary": "A tools/call request names ruflo__terminal_execute and supplies a command. The command runs inside the bridge container as the node user (UID 1000). Noma confirmed execution by having the host call back to a server the researchers controlled.",
      "zhSummary": "第二個請求用 tools/call 指定 ruflo__terminal_execute，並附上要執行的命令。命令會以 node 使用者（UID 1000）的身分在 Bridge 容器內執行。Noma 讓受測主機主動連回研究人員的伺服器，藉此確認命令真的跑了。",
      "tactic": "AML.TA0005",
      "technique": "AML.T0050",
      "layout": {
        "x": 650,
        "y": 0
      }
    },
    {
      "id": "dump-keys",
      "title": "Read the model-provider API keys from the container environment",
      "zhTitle": "從容器的環境變數讀出模型供應商的 API 金鑰",
      "summary": "The Compose file passes the provider keys (OpenAI, Anthropic, Google, OpenRouter and others) into the bridge container as environment variables, and every tool backend inherits the full environment. One printenv returns all of them.",
      "zhSummary": "Compose 設定檔把 OpenAI、Anthropic、Google、OpenRouter 等供應商的金鑰，以環境變數傳進 Bridge 容器，每個工具後端程序又都繼承了整份環境變數。因此只要執行一次 printenv，就能把這些金鑰全部列出來。",
      "tactic": "AML.TA0013",
      "technique": "AML.T0055",
      "layout": {
        "x": 1300,
        "y": 0
      }
    },
    {
      "id": "dump-conversations",
      "title": "Copy every conversation from the unauthenticated MongoDB",
      "zhTitle": "從沒有啟用身分驗證的 MongoDB 複製所有對話",
      "summary": "MongoDB runs on the internal Docker network without authentication. The proof of concept installs a MongoDB client under /tmp, dumps the messages, titles and metadata of every conversation, and sends them to an external endpoint.",
      "zhSummary": "MongoDB 在內部 Docker 網路上執行，沒有啟用身分驗證。概念驗證先在 /tmp 安裝 MongoDB 用戶端，匯出所有對話的訊息、標題與中繼資料（metadata），再傳到外部端點。",
      "tactic": "AML.TA0009",
      "technique": "AML.T0085.002",
      "layout": {
        "x": 1950,
        "y": 0
      }
    },
    {
      "id": "plant-backdoor",
      "title": "Write a beacon script that loads when the bridge restarts",
      "zhTitle": "植入一支會在 Bridge 重新啟動時載入的常駐程式",
      "summary": "The proof of concept writes /app/beacon.js, a script that sends the API keys out on a schedule. It arranges for the script to load when the bridge starts and then kills PID 1. Because the service uses restart: unless-stopped, Docker starts the container again with the script running.",
      "zhSummary": "概念驗證寫入 /app/beacon.js，這支程式會定時把 API 金鑰往外傳。接著把它設成 Bridge 啟動時就會載入，再終止容器的主程序（PID 1）。由於服務的重啟設定是 restart: unless-stopped，Docker 會自動把容器重新啟動，這支程式也跟著開始執行。",
      "tactic": "AML.TA0006",
      "technique": "AML.T0142",
      "layout": {
        "x": 2600,
        "y": 0
      }
    },
    {
      "id": "clear-history",
      "title": "Clear the shell history in the container",
      "zhTitle": "清除容器內的 shell 歷史記錄",
      "summary": "The final step clears the shell history inside the bridge container, so the container itself keeps no record of the commands that were run.",
      "zhSummary": "最後一步是清除 Bridge 容器內的 shell 歷史記錄，讓容器裡不留下執行過哪些命令的記錄。",
      "tactic": "AML.TA0007",
      "technique": "AML.T0138",
      "layout": {
        "x": 3250,
        "y": 0
      }
    },
    {
      "id": "spawn-swarm",
      "title": "Start attacker-controlled agent swarms on the victim's keys",
      "zhTitle": "用受害者的金鑰啟動由攻擊者控制的 agent 群組",
      "summary": "Calls to ruflo__swarm_init and ruflo__agent_spawn create agent swarms that the caller controls. They run on the deployment's own provider keys and compute. The maintainers' analysis shows that this step needs only the unauthenticated endpoint, with no shell.",
      "zhSummary": "呼叫 ruflo__swarm_init 與 ruflo__agent_spawn，就能建立由呼叫者控制的 agent 群組（swarm），用的是這套部署自己的供應商金鑰與運算資源。依維護者的分析，這一步只需要那個不驗證身分的端點，不必先取得 shell。",
      "tactic": "AML.TA0005",
      "technique": "AML.T0053",
      "layout": {
        "x": 650,
        "y": -670
      }
    },
    {
      "id": "poison-patterns",
      "title": "Write a false compliance policy into the AgentDB pattern store",
      "zhTitle": "把假的合規政策寫進 AgentDB pattern store",
      "summary": "A call to ruflo__agentdb_pattern-store saves attacker-written content in the agents' learning memory. Noma's example is a fake SOC2 compliance policy that tells the AI to put an attacker-controlled URL into every deployment script it generates. This step also needs only the unauthenticated endpoint.",
      "zhSummary": "呼叫 ruflo__agentdb_pattern-store，就能把攻擊者寫好的內容存進 agent 的學習記憶。Noma 舉的例子是一份假的 SOC2 合規政策，要求 AI 在產生的每一份部署腳本裡都加入攻擊者控制的網址。這一步同樣只需要那個不驗證身分的端點。",
      "tactic": "AML.TA0006",
      "technique": "AML.T0080.000",
      "layout": {
        "x": 650,
        "y": 670
      }
    }
  ],
  "threat_refs": [
    {
      "id": "AML.T0132",
      "name": "Misconfigured or Publicly Exposed AI Services"
    },
    {
      "id": "AML.T0050",
      "name": "Command and Scripting Interpreter"
    },
    {
      "id": "AML.T0055",
      "name": "Unsecured Credentials"
    },
    {
      "id": "AML.T0085.002",
      "name": "Conversation Context and Memory"
    },
    {
      "id": "AML.T0142",
      "name": "Event Triggered Execution"
    },
    {
      "id": "AML.T0138",
      "name": "Indicator Removal"
    },
    {
      "id": "AML.T0053",
      "name": "AI Agent Tool Invocation"
    },
    {
      "id": "AML.T0080.000",
      "name": "Memory"
    }
  ],
  "reader_narrative": {
    "pathCount": 3,
    "topologyNote": "Noma ran the eight steps as one automated script. The graph separates them by what each step needs: according to the maintainers' analysis, swarm creation and pattern-store poisoning need only the unauthenticated endpoint, while key theft, the conversation dump, the startup script and the cleanup go through the shell. Arrows along the shell path follow the order of the script.",
    "groups": [
      {
        "id": "entry",
        "kind": "shared",
        "eyebrow": "Proof-of-concept step 1",
        "label": "Unauthenticated tool endpoint",
        "summary": "The first request reaches POST /mcp without credentials and lists every tool the bridge serves.",
        "stepIds": [
          "enumerate-tools"
        ]
      },
      {
        "id": "shell",
        "kind": "path",
        "eyebrow": "Proof-of-concept steps 2, 3, 6, 7 and 8",
        "label": "Path A: a shell in the bridge container",
        "summary": "The terminal tool gives the caller a shell. The proof of concept uses it to read the keys, copy the conversations, plant a script that loads at startup and clear the history.",
        "stepIds": [
          "terminal-rce",
          "dump-keys",
          "dump-conversations",
          "plant-backdoor",
          "clear-history"
        ]
      },
      {
        "id": "swarm",
        "kind": "path",
        "eyebrow": "Proof-of-concept step 4",
        "label": "Path B: swarms on the victim's keys",
        "summary": "Agent-management tools start swarms that the caller controls. No shell is needed.",
        "stepIds": [
          "spawn-swarm"
        ]
      },
      {
        "id": "memory",
        "kind": "path",
        "eyebrow": "Proof-of-concept step 5",
        "label": "Path C: poisoned agent memory",
        "summary": "A memory tool stores an attacker-written pattern that later conversations can draw on. No shell is needed.",
        "stepIds": [
          "poison-patterns"
        ]
      }
    ]
  }
}
