Categories
CVE-2026-55582 high CVSS 8.4

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:

  1. main.go:89-91 — The MCP tool schema exposes a required string parameter command with no server-side type constraints.
  2. main.go:102 — shell_exec is bound to shellHandler.handle.
  3. handler.go:34 — The handler reads the attacker-controlled value: command, err := request.RequireString("command").
  4. handler.go:49 — The command string is passed to h.validator.validateCommand(command).
  5. security.go:136 — containsShellMetacharacters checks 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.

❓ What is the problem

OS command injection (CWE-78) exists in github.com/sonirico/mcp-shell. Attackers reach the vulnerable code path via security.yaml without authentication.

📍 Affected scope

Check the vendor advisory for the affected versions of github.com/sonirico/mcp-shell. Attack surface: security.yaml / security.go / shell_exec / mcpuser.

🔥 Severity

Severity: High (CVSS 8.4/10). Successful exploitation can lead to full system takeover.

🔧 How to fix

Update to 0.6.0.

🛡️ Workaround

Until the patch is applied: disable the affected feature, apply WAF rules, or restrict access via network ACLs.

🔍 Detection

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

  1. 1
    Identify 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 し、稼働しているサービス・バージョンを把握する。

  2. 2
    Apply patch patch
    Upgrade github.com/sonirico/mcp-shell to 0.6.0

    ステージング環境で 0.6.0 に上げて回帰テスト → 本番反映。回帰テストはアプリの主要ハッピーパスを含めること。

  3. 3
    Post-deployment verification verify
    Confirm patched version is live in production

    パッチ適用後、ステージングで PoC または同等の悪用パターンを再現して脆弱性が閉じたことを確認。本番ではアクセスログ・WAF でアラート再発が無いか継続監視。

Affected packages

go github.com/sonirico/mcp-shell
[{"type":"SEMVER","events":[{"introduced":"0"},{"fixed":"0.6.0"}]}]

References

We use cookies for analytics and ad measurement. This setting applies to all Game co., Ltd. sites. Details