OS Command Injection in github.com/sonirico/mcp-shell (CVE-2026-55581)
Summary
OS command injection in github.com/sonirico/mcp-shell (CVE-2026-55581). 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 ships a default Docker configuration (security.yaml) that includes /bin/bash in the allowed_executables allowlist. The command validator (security.go) only checks whether the first token of the supplied command matches an allowed executable; it does not inspect or reject shell command-mode flags such as -c. As a result, any MCP tool caller can send command=/bin/bash -c to the shell_exec tool and execute commands that are not in the allowlist — including id, env, curl, wget, and any other binary present in the container. The bypass works with the default Docker image, requires no authentication, and requires no modifications to server configuration. Successful exploitation gives the attacker arbitrary OS command execution inside the container as mcpuser.
Details
mcp-shell implements a secure mode in which command execution is restricted to an explicit allowlist of executables defined in security.yaml. The Docker image ships this file with the following entry:
# security.yaml (line 29)
allowed_executables:
- "ls"
- ...
- "/bin/bash" # Only allow if you trust the arguments
The comment itself acknowledges the risk, but the shipped default does not enforce any argument-level restriction. The validation logic in security.go is responsible for enforcing secure mode:
// security.go:84-96
for _, allowed := range v.config.AllowedExecutables {
if v.matchesExecutable(executable, allowed) {…
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-55581 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-55581" on the vendor's site.
CVE-2026-55581 (github.com/sonirico/mcp-shell) — CWE-78 / CVSS v3 8.4
Attack vector: local / unauthenticated / no user interaction
Attack surface: security.yaml / allowed_executables / security.go / shell_exec
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 / allowed_executables / security.go / shell_exec.
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