OS Command Injection in github.com/sonirico/mcp-shell (CVE-2026-55582)
Summary
OS command injection in github.com/sonirico/mcp-shell (CVE-2026-55582). Successful exploitation can lead to full system takeover. Exploitable via security.yaml. Mitigation: upgrade to 0.6.0 or later.
Original description
The description as published by the source.
Summary
mcp-shell's "secure mode" is designed to restrict command execution to an allowlist of executables defined in security.yaml. The default configuration includes /usr/bin/git. The security validator in security.go blocks common shell metacharacters (|&;<>(){}[]$\``) but omits !, which is the prefix Git uses to execute shell aliases (alias.NAME=!CMD). An attacker who can invoke the shell_execMCP tool can pass/usr/bin/git -c alias.pwn=!as the command argument, bypassing all validation and achieving arbitrary OS command execution as themcp-shellprocess user. The default Docker image runs asmcpuser` (UID 1000) with Git installed and secure mode enabled, making this exploitable in the default deployment with no authentication required.
Details
The vulnerability is a classic OS Command Injection (CWE-78) in the shell_exec MCP tool handler. The data flow from attacker input to shell execution is:
main.go:89-91— The MCP tool schema exposes a required string parametercommandwith no server-side type constraints.main.go:102—shell_execis bound toshellHandler.handle.handler.go:34— The handler reads the attacker-controlled value:command, err := request.RequireString("command").handler.go:49— The command string is passed toh.validator.validateCommand(command).security.go:136—containsShellMetacharacterschecks for|&;<>(){}[]$\`` but!` is absent from the blocked set.
6.…
Source: GitHub Security Advisories (Global) NVD GitHub Advisory
Auto-generated summary
Assembled by SecPulse from the source data (CVSS, CWE, affected versions) using templates — no AI involved. Check the original description and references below for exact details.
A vulnerability tracked as CVE-2026-55582 has been found in github.com/sonirico/mcp-shell.
Attackers can target a specific entry point like security.yaml over the network to misuse the product.
Successful exploitation can lead to full system takeover. CVSS score: 8.4/10.
What to do: upgrade github.com/sonirico/mcp-shell to 0.6.0 or later.
If unsure, ask your IT team or search "github.com/sonirico/mcp-shell CVE-2026-55582" on the vendor's site.
CVE-2026-55582 (github.com/sonirico/mcp-shell) — CWE-78 / CVSS v3 8.4
Attack vector: local / unauthenticated / no user interaction
Attack surface: security.yaml / security.go / shell_exec / mcpuser
Patched: 0.6.0 — apply immediately
Plan: 1) Audit SBOM/dependencies, 2) Stage→prod upgrade, 3) Add WAF/proxy monitoring on affected endpoints, 4) Hunt IOCs in logs.
Refs: see the GHSA / vendor advisory / patched release linked on this page.
OS command injection (CWE-78) exists in github.com/sonirico/mcp-shell. Attackers reach the vulnerable code path via security.yaml without authentication.
Check the vendor advisory for the affected versions of github.com/sonirico/mcp-shell. Attack surface: security.yaml / security.go / shell_exec / mcpuser.
Severity: High (CVSS 8.4/10). Successful exploitation can lead to full system takeover.
Update to 0.6.0.
Until the patch is applied: disable the affected feature, apply WAF rules, or restrict access via network ACLs.
Search webserver/proxy logs for unusual request patterns matching this CVE's known IOCs. Run grep -r 'github.com/sonirico/mcp-shell' . against your dependency files (package-lock.json, requirements.txt, go.sum) to find affected services.
Response actions
Concrete steps and command examples for SOC/SRE teams to execute in order
-
1Identify exposure identify
grep -r 'github.com/sonirico/mcp-shell' . | grep -v node_modulesリポジトリと本番環境の依存ファイル (package-lock.json / requirements.txt / go.sum / Gemfile.lock 等) で
github.com/sonirico/mcp-shellを grep し、稼働しているサービス・バージョンを把握する。 -
2Apply patch patch
Upgrade github.com/sonirico/mcp-shell to 0.6.0ステージング環境で 0.6.0 に上げて回帰テスト → 本番反映。回帰テストはアプリの主要ハッピーパスを含めること。
-
3Post-deployment verification verify
Confirm patched version is live in productionパッチ適用後、ステージングで PoC または同等の悪用パターンを再現して脆弱性が閉じたことを確認。本番ではアクセスログ・WAF でアラート再発が無いか継続監視。
Affected packages
References
- package github.com
- web github.com
- web github.com
- web github.com
- web github.com
- web github.com