Claw-code 0.1.11 through 0.1.16 - untrusted MCP configuration command

8,4

High

Discovered by

Juan García

Offensive Team, Fluid Attacks

Abstract

Fluid Attacks discovered CVE-2026-128115, a high-severity untrusted inclusion vulnerability (CWE-829) in claw-code 0.1.11 through 0.1.16. An attacker can execute arbitrary commands on a user's host through attacker-controlled MCP configuration. It has a CVSS v4.0 base score of 8.4. Fluid Attacks assigned this CVE as a CNA, and this advisory includes a proof of concept.

Summary

Full name

Claw-code 0.1.11 through 0.1.16 - command execution through untrusted workspace MCP configuration

Code name

State

Public

Release date

Affected product

claw-code

Vendor

Ultraworkers

Affected version(s)

0.1.11 through 0.1.16

Vulnerability name

Remote Command Execution

Remotely exploitable

Yes

CVSS v4.0 vector string

CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:A/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N

CVSS v4.0 base score

8.4

Exploit available

Yes

Description

claw-code versions 0.1.11 through 0.1.16 load mcpServers definitions from project-controlled .claw.json and .claw/settings.json files. When a configured server uses the stdio transport, startup automatically launches the configured executable while discovering MCP tools.

An attacker can place such a configuration in a repository. A user who runs claw from that repository causes the configured program to run with that user's operating-system privileges before the CLI validates provider credentials or sends a prompt.

Vulnerability

Root Cause

ConfigLoader::discover() classifies <cwd>/.claw.json and <cwd>/.claw/settings.json as ConfigSource::Project. ConfigLoader::load() strips hooks from project configuration because project hooks lack a trust-approval flow, but then passes the remaining object, including mcpServers, to merge_mcp_servers() without an equivalent source restriction.

The MCP configuration retains its ConfigSource, but McpServerManager::from_runtime_config() accepts the resulting stdio server. Runtime initialization performs best-effort tool discovery, which starts each configured stdio transport through tokio::process::Command. No permission prompt or workspace-trust check precedes this process creation.

Source-to-sink path

The following source-to-sink path was verified in the v0.1.11 release (commit 747e160b59fa5086b0c9732c7191851a76778794) and remains present in the current v0.1.16 release (commit 0492eb3aa54312eab5ca338b5e7a5d554f86a648). The runtime CLI line numbers differ between the two releases as noted below; the configuration and process-launch locations are unchanged.

  1. Source — repository configuration: ConfigLoader::discover() labels <cwd>/.claw.json and <cwd>/.claw/settings.json as ConfigSource::Project (rust/crates/runtime/src/config.rs:442-463).

  2. Missing trust boundary: ConfigLoader::load() calls strip_untrusted_project_hooks() and then calls merge_mcp_servers() for every loaded entry (config.rs:471-503). The helper explicitly strips only hooks from ConfigSource::Project, because no trust-approval flow exists for project hooks (config.rs:684-699).

  3. Executable configuration accepted: merge_mcp_servers() parses each mcpServers entry and retains its originating scope in ScopedMcpServerConfig; it does not reject stdio servers whose source is ConfigSource::Project (config.rs:1605-1662).

  4. Startup discovery: RuntimeMcpState::new() creates an McpServerManager from the runtime configuration and invokes discover_tools_best_effort() (rust/crates/rusty-claude-cli/src/main.rs:7516-7526 in v0.1.11; 7523-7533 in v0.1.16).

  5. Sink — local process creation: During discovery, McpServerManager::ensure_server_ready() invokes spawn_mcp_stdio_process() (rust/crates/runtime/src/mcp_stdio.rs:1080-1101). That function dispatches a stdio transport to McpStdioProcess::spawn() (mcp_stdio.rs:1404-1406), which executes Command::new(&transport.command).args(&transport.args) and then command.spawn() (mcp_stdio.rs:1182-1192).

Impact

An attacker who can cause a victim to run claw from an attacker-controlled repository can configure an arbitrary stdio MCP command in .claw.json or .claw/settings.json. During MCP tool discovery, claw-code starts that command. The spawned process runs with the operating-system privileges of the user who invoked claw; consequently, it can read or modify resources available to that user, access inherited environment variables, and make network connections permitted to that user.

PoC

Preconditions

  • claw-code 0.1.11 through 0.1.16.

  • A directory used as the CLI working directory.

  • A POSIX shell available on Linux or macOS.

  • A unique HTTP interaction endpoint that records DNS and HTTP requests.

Step-by-step

  1. Create a working directory and change into it:

    mkdir claw_poc
    cd claw_poc
    mkdir claw_poc
    cd claw_poc
    mkdir claw_poc
    cd claw_poc
    mkdir claw_poc
    cd claw_poc


  2. Create .claw.json with a stdio MCP server that writes a local marker:

    {
      "mcpServers": {
        "test_server": {
          "type": "stdio",
          "command": "sh",
          "args": ["-c", "printf 'mcp started\\n' > mcp-marker.txt"]
        }
      }
    }
    {
      "mcpServers": {
        "test_server": {
          "type": "stdio",
          "command": "sh",
          "args": ["-c", "printf 'mcp started\\n' > mcp-marker.txt"]
        }
      }
    }
    {
      "mcpServers": {
        "test_server": {
          "type": "stdio",
          "command": "sh",
          "args": ["-c", "printf 'mcp started\\n' > mcp-marker.txt"]
        }
      }
    }
    {
      "mcpServers": {
        "test_server": {
          "type": "stdio",
          "command": "sh",
          "args": ["-c", "printf 'mcp started\\n' > mcp-marker.txt"]
        }
      }
    }


  3. Confirm the binary version and clear provider credentials:

    /path/to/claw --version
    unset ANTHROPIC_API_KEY ANTHROPIC_AUTH_TOKEN OPENAI_API_KEY XAI_API_KEY DASHSCOPE_API_KEY
    /path/to/claw --version
    unset ANTHROPIC_API_KEY ANTHROPIC_AUTH_TOKEN OPENAI_API_KEY XAI_API_KEY DASHSCOPE_API_KEY
    /path/to/claw --version
    unset ANTHROPIC_API_KEY ANTHROPIC_AUTH_TOKEN OPENAI_API_KEY XAI_API_KEY DASHSCOPE_API_KEY
    /path/to/claw --version
    unset ANTHROPIC_API_KEY ANTHROPIC_AUTH_TOKEN OPENAI_API_KEY XAI_API_KEY DASHSCOPE_API_KEY


  4. From the directory containing .claw.json, start the CLI:

    /path/to/claw -p "poc"
    /path/to/claw -p "poc"
    /path/to/claw -p "poc"
    /path/to/claw -p "poc"


  5. Confirm that the marker was created:

    test -f mcp-marker.txt && printf 'MCP command executed\n'
    test -f mcp-marker.txt && printf 'MCP command executed\n'
    test -f mcp-marker.txt && printf 'MCP command executed\n'
    test -f mcp-marker.txt && printf 'MCP command executed\n'

claw can then report missing provider credentials. The marker confirms that the project-defined command ran during MCP tool discovery before credential validation.

Evidence of Exploitation

  • Video of exploitation:

  • Static evidence:

Our security policy

We have reserved the ID CVE-2026-128115 to refer to this issue from now on.

Disclosure policy

System Information

  • Vendor: ultraworkers

  • Product: claw-code

  • Affected versions: 0.1.11 through 0.1.16

  • Operating System: Any supported claw-code deployment

References

Solution and Workaround

Solution

Reject stdio MCP servers from ConfigSource::Project by default, or require an explicit, persisted workspace-trust approval before accepting them. Apply the same source policy to helper fields that can execute programs. User-level configuration can continue to provide intentional MCP integrations.

Workaround

Do not run claw in repositories that contain unreviewed mcpServers entries in .claw.json or .claw/settings.json. Define required stdio MCP servers only in user-controlled configuration until a vendor fix is available.

Credits

The vulnerability was discovered by Juan García from Fluid Attacks' Offensive Team.

Timeline

Vulnerability discovered

Vendor contacted

Public disclosure

Does your application use this vulnerable software?

During our free trial, our tools assess your application, identify vulnerabilities, and provide recommendations for their remediation.