CVE-2026-55582: mcp-shell Secure Mode Allowlist Bypass via Git Shell Alias
mcp-shell's secure mode can be completely bypassed by passing a Git command with a shell alias argument, letting any MCP client run arbitrary OS commands even when the allowlist is active.

The problem
mcp-shell exposes a shell_exec MCP tool that validates commands against an allowlist of executables and a set of blocked metacharacters. The default Docker image ships with /usr/bin/git in allowed_executables and blocked_patterns: [].
The metacharacter blocklist in security.go (containsShellMetacharacters) covers |&;<>(){}[]$\ but omits !. Git treats -c alias.NAME=!CMD as a runtime config entry that runs CMD as a shell command when the alias name is used as a subcommand, so every check passes and arbitrary code executes as the mcpuser` process (UID 1000).
Proof of concept
A working proof-of-concept for CVE-2026-55582 in github.com/sonirico/mcp-shell, with the exact payload below.
{
"jsonrpc": "2.0",
"id": 2,
"method": "tools/call",
"params": {
"name": "shell_exec",
"arguments": {
"command": "/usr/bin/git -c alias.pwn=!touch pwn /tmp/mcp-shell-mcp-poc",
"base64": false
}
}
}The validator in security.go:136 checks containsShellMetacharacters against |&;<>(){}[]$\ but ! is absent from the set. containsDangerousShellConstructs also misses it. Both functions return false for alias.pwn=!touch`, so validation passes.
The executor calls exec.CommandContext(ctx, "/usr/bin/git", "-c", "alias.pwn=!touch", "pwn", "/tmp/mcp-shell-mcp-poc"). Git interprets -c alias.pwn=!touch as a runtime config alias, then resolves the pwn subcommand by running sh -c 'touch "$@"' _ /tmp/mcp-shell-mcp-poc.
The patch (commit f31377f, v0.6.0) adds ! to the blocked metacharacter set, adds a alias.*=! blocked argument pattern, and removes git from the default allowed_executables with an explicit startup warning that flags any alias-capable tool placed in the allowlist.
The fix
Upgrade to mcp-shell v0.6.0. Remove git (and any other alias-capable or interpreter-style binary) from allowed_executables in your security.yaml. The patched default config no longer includes git and warns at startup if such a binary is detected in the allowlist.
Related research
- high · 8.4CVE-2026-55581CVE-2026-55581: mcp-shell Secure Mode Allowlist Bypass via /bin/bash -c
- highCVE-2026-55580CVE-2026-55580: mcp-shell OS Command Injection via Security-Disabled Default and Shell Interpreter in Allowlist
- high · 7.8uniget CLI: Inverted Signature-Guard Condition Allows Unsigned Metadata RCE
- high · 8CVE-2026-71312CVE-2026-71312: rclone SFTP PowerShell Smart-Quote Filename OS Command Injection