<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:webfeeds="http://webfeeds.org/rss/1.0"><channel><title>Mcp-Shell - CraftedSignal Threat Feed</title><link>https://feed.craftedsignal.io/products/mcp-shell/</link><description>Trending threats, MITRE ATT&amp;CK coverage, and detection metadata. Fed continuously.</description><generator>Hugo</generator><language>en</language><managingEditor>hello@craftedsignal.io</managingEditor><webMaster>hello@craftedsignal.io</webMaster><lastBuildDate>Tue, 25 Aug 2026 16:02:16 +0000</lastBuildDate><atom:link href="https://feed.craftedsignal.io/products/mcp-shell/feed.xml" rel="self" type="application/rss+xml"/><image><url>https://feed.craftedsignal.io/favicon-32x32.png</url><title>CraftedSignal Threat Feed</title><link>https://feed.craftedsignal.io/</link><width>32</width><height>32</height></image><webfeeds:icon>https://feed.craftedsignal.io/favicon.svg</webfeeds:icon><item><title>MCP-Shell Secure Mode Allowlist Bypass via Shell Interpreter</title><link>https://feed.craftedsignal.io/briefs/2026-08-mcp-shell-bypass/</link><pubDate>Tue, 25 Aug 2026 16:02:16 +0000</pubDate><author>hello@craftedsignal.io</author><guid isPermaLink="true">https://feed.craftedsignal.io/briefs/2026-08-mcp-shell-bypass/</guid><description>The mcp-shell tool contains a security bypass where improper validation of command-line arguments allows an attacker to execute arbitrary commands by leveraging a default-allowed shell interpreter.</description><content:encoded><![CDATA[<p>The mcp-shell utility, often deployed as an MCP (Model Context Protocol) tool, contains a critical security flaw in its secure mode validation logic. By default, the application ships with a <code>security.yaml</code> configuration that includes <code>/bin/bash</code> in its <code>allowed_executables</code> allowlist. The application's validation function, located in <code>security.go</code>, performs command authorization by splitting input strings on whitespace and evaluating only the first token (the executable) against the allowlist.</p>
<p>Because the validator fails to inspect subsequent arguments or identify shell command-mode flags, an attacker can supply a command payload such as <code>/bin/bash -c &lt;arbitrary_command&gt;</code>. The application validates the first token (<code>/bin/bash</code>), confirms it is on the allowlist, and proceeds to execute the full command string via <code>exec.CommandContext</code>. This results in the execution of unapproved binaries and shell scripts within the container environment under the <code>mcpuser</code> identity. The vulnerability is present in the official Docker image and requires no authentication or server configuration changes to exploit.</p>
<h2 id="attack-chain">Attack Chain</h2>
<ol>
<li>Attacker identifies an MCP tool interface exposing the <code>shell_exec</code> function.</li>
<li>Attacker prepares a JSON-RPC request to the <code>tools/call</code> method with <code>name</code> set to <code>shell_exec</code>.</li>
<li>Attacker sets the <code>command</code> argument to <code>/bin/bash -c &lt;malicious_payload&gt;</code> (e.g., <code>/bin/bash -c id</code>).</li>
<li>The application receives the input in <code>handler.go</code> and triggers the validation logic in <code>security.go</code>.</li>
<li><code>security.go</code> splits the input string and identifies the executable as <code>/bin/bash</code>, which passes the allowlist check.</li>
<li>The <code>checkBlockedPatternsAndCommands</code> function fails to identify the <code>-c</code> flag as a security risk, returning a successful validation state.</li>
<li>The full command string is passed to <code>executor.go</code>, which invokes <code>exec.CommandContext</code> with the provided arguments.</li>
<li>The container executes the malicious payload via the shell interpreter, granting the attacker arbitrary command execution.</li>
</ol>
<h2 id="impact">Impact</h2>
<p>Successful exploitation results in arbitrary OS command execution (CWE-78) within the container's environment. Attackers can leverage the installed base of binaries (e.g., <code>curl</code>, <code>wget</code>, <code>grep</code>, <code>sed</code>) to perform data exfiltration, read sensitive files accessible to <code>mcpuser</code>, modify the container's writable filesystem, or pivot to other network-accessible resources. The impact is elevated for production environments where these containers are used to bridge LLM agents with internal infrastructure.</p>
<h2 id="recommendation">Recommendation</h2>
<ol>
<li>Remove shell interpreters (e.g., <code>/bin/bash</code>, <code>/bin/sh</code>, <code>/bin/dash</code>) from the <code>allowed_executables</code> list in <code>security.yaml</code> to prevent command-mode injection.</li>
<li>Implement argument-level validation in <code>security.go</code> to explicitly deny common shell command-mode flags (such as <code>-c</code>) when a shell interpreter is used.</li>
<li>Upgrade to a patched version of <code>mcp-shell</code> that incorporates regex-based argument validation for sensitive binaries.</li>
<li>Review and harden the container's entrypoint and environment variables to ensure that only the minimum necessary binaries are present in the runtime image.</li>
</ol>
]]></content:encoded><category domain="severity">high</category><category domain="type">advisory</category><category>command-injection</category><category>mcp</category><category>container-security</category></item><item><title>mcp-shell Insecure Configuration and Allowlist Bypass</title><link>https://feed.craftedsignal.io/briefs/2026-08-mcp-shell-insecure-defaults/</link><pubDate>Tue, 25 Aug 2026 16:02:06 +0000</pubDate><author>hello@craftedsignal.io</author><guid isPermaLink="true">https://feed.craftedsignal.io/briefs/2026-08-mcp-shell-insecure-defaults/</guid><description>mcp-shell versions prior to 0.6.0 suffer from default-disabled security settings and insecure allowlists, enabling unauthenticated arbitrary command execution via connected LLM agents.</description><content:encoded><![CDATA[<p>mcp-shell, a tool designed to provide shell execution capabilities to Large Language Models (LLMs) via the Model Context Protocol (MCP), contains two critical configuration flaws that negate its security controls. First, the application ships with security features disabled by default in <code>config.go</code>. Unless an operator explicitly defines the <code>MCP_SHELL_SEC_CONFIG_FILE</code> environment variable, the <code>validateCommand</code> function short-circuits and allows all incoming commands without restriction. Second, the default <code>security.yaml</code> configuration included in the Docker image provides an insecure allowlist containing shell interpreters such as <code>/bin/bash</code> and <code>/usr/bin/python3</code>.</p>
<p>These flaws enable an LLM connected to the mcp-shell server to execute arbitrary commands on the underlying system. The attack surface is significant because mcp-shell operates via stdio transport; an attacker (or a compromised/misaligned LLM agent) can issue <code>shell_exec</code> calls that bypass validation either due to the &quot;disabled by default&quot; state or by abusing allowed interpreters to execute nested command strings, effectively bypassing metacharacter filters. These vulnerabilities affect all deployments prior to version 0.6.0, including source-based and official container-based installations.</p>
<h2 id="attack-chain">Attack Chain</h2>
<ol>
<li>The operator deploys mcp-shell using default installation steps (git clone or official Docker image).</li>
<li>The operator fails to explicitly set the <code>MCP_SHELL_SEC_CONFIG_FILE</code> environment variable, leaving the security module in a disabled state (Finding 1) OR the operator uses the default <code>security.yaml</code> which permits shell interpreters (Finding 2).</li>
<li>The attacker (e.g., a malicious or poisoned LLM) establishes a session with the mcp-shell server over the stdio transport.</li>
<li>The attacker sends a <code>tools/call</code> request to the mcp-shell server specifying the <code>shell_exec</code> method.</li>
<li>The server process receives the command request; if security is disabled, it proceeds directly to system execution.</li>
<li>If in &quot;secure mode&quot; with an insecure allowlist, the attacker executes <code>/bin/bash -c '&lt;arbitrary_command&gt;'</code> which the server permits because <code>/bin/bash</code> is on the allowlist and the string contains no forbidden metacharacters.</li>
<li>The server process spawns the interpreter, which in turn executes the embedded malicious payload.</li>
<li>The attacker achieves arbitrary code execution on the host with the privileges of the mcp-shell process.</li>
</ol>
<h2 id="impact">Impact</h2>
<p>Successful exploitation allows for full arbitrary command execution on the host system running mcp-shell. Given that mcp-shell is designed to interact with LLMs, this can result in unauthorized data exfiltration, system configuration changes, and lateral movement from the host. Because the threat model involves LLMs acting as the agent, the vulnerability is reachable without network-level access, provided the LLM has been tricked or configured to invoke the <code>shell_exec</code> tool.</p>
<h2 id="recommendation">Recommendation</h2>
<ol>
<li>Upgrade mcp-shell to version 0.6.0 or higher immediately to address the insecure default configurations and updated example allowlists.</li>
<li>For existing deployments, manually create a restrictive <code>security.yaml</code> that excludes all shell interpreters (e.g., <code>bash</code>, <code>sh</code>, <code>python</code>, <code>perl</code>, <code>ruby</code>) and enforce <code>Enabled: true</code> in the configuration.</li>
<li>Set the <code>MCP_SHELL_SEC_CONFIG_FILE</code> environment variable explicitly in all deployment environments (including Kubernetes/Docker orchestrators) to ensure validation is active.</li>
<li>Implement strict sandboxing (e.g., Docker containers with minimal capabilities or separate namespaces) for mcp-shell processes as a layer of defense-in-depth, acknowledging that sandboxing does not mitigate the primary vulnerability of unauthorized intra-session command execution.</li>
</ol>
]]></content:encoded><category domain="severity">high</category><category domain="type">advisory</category><category>vulnerability</category><category>rce</category><category>mcp</category><category>llm-security</category></item></channel></rss>