RufRoot: One Unauthenticated Request to Ruflo's MCP Bridge Ran Shell Commands in the Container
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.
Threat Analysis
- An MCP endpoint with no authentication, published by default. Every tool call, agent action and memory operation in Ruflo passes through its MCP Bridge, an Express.js server. Noma Labs found that POST /mcp handed tool calls straight to the execution function with no token, API key, header check or address allowlist, and that the default docker-compose.yml published the bridge port, 3001, on all network interfaces. How far that reaches depends on the firewall, security groups and segmentation around the host.
- One request for a shell, then seven more steps. One of the bridge's 233 tools, ruflo__terminal_execute, runs a caller-supplied command in the container as the node user (UID 1000). Noma's automated proof of concept listed the tools, ran a command, and printed the environment to collect the provider keys (OpenAI, Anthropic, Google, OpenRouter and others), which the Compose file passes in and every tool backend inherits. It then started attacker-controlled swarms on the victim's keys; stored a fake SOC2 compliance policy in the AgentDB pattern store (the agents' long-term memory), telling the AI to add an attacker-controlled URL to generated deployment scripts; copied every conversation from a MongoDB that had no authentication; wrote /app/beacon.js to load at startup and forced a restart; and cleared the shell history.
- How far the evidence goes. Noma reports that every step was confirmed on a default deployment it ran on AWS EC2. The maintainers verified the claims against the source code and state that they did not run the exploit. The CISA assessment attached to the CVE record on 9 July 2026 lists exploitation as none, and no public source reviewed here reports use in a real attack. Noma says that later conversations produce attacker-influenced output once the pattern is stored; the reviewed sources include no sample of such output.
- A blocklist on the wrong path, and three ways in. Ruflo had listed terminal_execute in a blocklist, but the check ran only in the autopilot flow and POST /mcp never called it. The maintainers also sorted the steps by what each one needs: key theft, the conversation copy, the startup script and the cleanup require the shell, while swarm creation and pattern-store poisoning need only the unauthenticated endpoint. Removing the terminal tool alone would therefore have left two paths open.
- What the fix changes, and what stays with the operator. ruflo 3.16.3, released on 1 July 2026, binds the bridge and MongoDB to loopback, refuses a public bind without MCP_AUTH_TOKEN, keeps terminal_execute off unless MCP_ENABLE_TERMINAL=true, requires a MongoDB password and makes the bridge filesystem read-only. All earlier versions are affected, and the advisory gives the flaw the maximum CVSS 3.1 score of 10.0. Redeploying does not remove a stored pattern or a planted script, and it does not invalidate keys that were already read. When the fix was merged, giving each backend only the keys it needs was left to a later release, and in loopback-only mode the bearer check and the allowlist for cross-origin requests (CORS) stay off unless they are configured.
Applicable AIDEFEND Defenses (12)
What Defenders Should Do Now
- Check what is actually listening. On every host that runs Ruflo, read the running version and the addresses bound to ports 3001 and 27017 from the running containers, then send a tools/list request with no credentials from a second machine. The check passes when the version is 3.16.3 or later, both ports are on loopback or limited to named sources, and the request gets no answer or a 401.
- If you cannot upgrade today, close the path with configuration. Map the ports to 127.0.0.1:3001:3001 and 127.0.0.1:27017:27017, restrict their sources at the security group or firewall, and set MCP_GROUP_DEVTOOLS to false. Then repeat the outside test and a terminal_execute call and confirm that both fail.
- After upgrading, set what the default leaves off. Set MCP_AUTH_TOKEN and an MCP_CORS_ORIGIN allowlist even for loopback-only use, and leave MCP_ENABLE_TERMINAL unset. Confirm that a call without the token is refused and that terminal_execute returns the disabled error on every request route.
- Treat a reachable instance as compromised until it is checked. Revoke and replace every provider key that was in the bridge environment, and confirm that the old keys are rejected. Remove pattern-store entries you cannot account for, and confirm in a new session that they no longer load. Rebuild the bridge from a clean image and check MongoDB for changed data.
- Limit what a shell in the bridge can reach. Give MongoDB a network shared only with the service that uses it, allow the bridge's outbound connections only to the provider domains in use, keep the filesystem read-only and cap spend on the keys. From inside the container, confirm that a database connection, a request to an arbitrary host and a write under /app all fail.
2 additional considerations
Give the deployment its own narrowly scoped provider keys
Keep a request record outside the bridge container
Conclusion
Last updated: