CVE-2026-55581

mcp-shell: Secure Mode Allowlist Bypass via Default `/bin/bash` Executable

Published Aug 25, 2026 CVSS 3.1 · 8.4 High EPSS < 1% KEV · Not listed
Description
mcp-shell is an MCP server for running shell commands securely, auditably, and on demand. Prior to 0.6.0, the default Docker security.yaml includes /bin/bash in allowed_executables, while security.go validates only the first token and checkBlockedPatternsAndCommands does not reject the shell command-mode flag -c. A caller of the shell_exec MCP tool can provide the command argument `/bin/bash -c <arbitrary-command>`, which passes validation and reaches executor.go, where parseCommand and exec.CommandContext execute the arbitrary command as mcpuser outside the intended allowlist. This issue is fixed in version 0.6.0.

Analysis

AI-generated

Technical impact

The description mentions that mcp-shell, before version 0.6.0, includes /bin/bash in its default Docker security.yaml allowlist. The validation logic in security.go only checks the first token of a command, and checkBlockedPatternsAndCommands does not block the shell command‑mode flag –c. Consequently, a caller of the shell_exec tool can supply the command `/bin/bash -c <arbitrary‑command>`, which passes validation, reaches executor.go, and is executed by exec.CommandContext as the mcpuser account. This bypasses the intended allowlist and allows an attacker to run arbitrary commands with the privileges of mcpuser, a clear remote code execution flaw that was fixed in version 0.6.0.

Affected Systems

The issue affects installations of sonirico mcp-shell prior to version 0.6.0. In the default Docker configuration, /bin/bash is included in allowed_executables and the bug resides in security.go and executor.go, allowing the bypass.

Risk and Exploitability

The CVSS score of 8.4 classifies this as a high‑severity exploit. The EPSS score is not available, and the vulnerability is not listed in CISA KEV. An adversary who can invoke shell_exec on the running MCP server—by accessing the related API endpoint or other communication channel—may choose any shell command to execute. The exploit requires only that the attacker can supply a command string; no additional privilege escalation beyond mcpuser is needed, making it both highly impactful and potentially easy to deploy once the service is exposed.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade to mcp-shell version 0.6.0 or later, which resolves the allowlist bypass and addresses CWE-1188, CWE-183, and CWE-78.
  • Review and update the Docker security.yaml to remove /bin/bash from the allowed_executables list, thereby mitigating CWE-183 and preventing command injection via CWE-78.
  • Restrict the shell_exec interface to authorized users only and implement comprehensive input validation that checks all command tokens, guarding against CWE-1188 and CWE-78.

Generated by OpenCVE AI on August 25, 2026 at 21:16 UTC.

Tracking

Sign in to view the affected projects.

Advisories

Source ID Title
Github GHSA Github GHSA GHSA-3x77-wg38-92r3 mcp-shell has a Secure Mode Allowlist Bypass via Default `/bin/bash` Executable
History
Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'poc', 'Technical Impact': 'total'}, 'version': '2.0.3'}

Type Values Removed Values Added
First Time appeared Sonirico
Sonirico mcp-shell
Vendors & Products Sonirico
Sonirico mcp-shell
Type Values Removed Values Added
Description mcp-shell is an MCP server for running shell commands securely, auditably, and on demand. Prior to 0.6.0, the default Docker security.yaml includes /bin/bash in allowed_executables, while security.go validates only the first token and checkBlockedPatternsAndCommands does not reject the shell command-mode flag -c. A caller of the shell_exec MCP tool can provide the command argument `/bin/bash -c <arbitrary-command>`, which passes validation and reaches executor.go, where parseCommand and exec.CommandContext execute the arbitrary command as mcpuser outside the intended allowlist. This issue is fixed in version 0.6.0.
Title mcp-shell: Secure Mode Allowlist Bypass via Default `/bin/bash` Executable
Weaknesses CWE-1188
CWE-183
CWE-78
References
Metrics cvssV3_1

{'score': 8.4, 'vector': 'CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H'}

Weaknesses
  • CWE-1188

    Initialization of a Resource with an Insecure Default

  • CWE-183

    Permissive List of Allowed Inputs

  • CWE-78

    Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')

Sources

Status
PUBLISHED
Assigner
GitHub_M
Published
Updated
Aug 25, 2026, 7:01 PM
Reserved
Jun 16, 2026, 11:18 PM
Status
Deferred
Published
Aug 25, 2026, 4:16 PM
Modified
Sep 9, 2026, 9:07 PM