← Research

APIsec Labs · Excerpt · Original article: 7 min read

CVE-2026-108953: OS Command Injection by Whitelist Bypass in mac-shell-mcp

mac-shell-mcp gives AI agents a whitelisted shell on macOS.

mac-shell-mcp is an MCP (Model Context Protocol) server that gives AI agents a controlled shell on macOS. It ships a command whitelist containing things like ls, pwd, cat, meant to keep the agent from running anything dangerous.

CVE:CVE-2026-108953 · Severity: High (CVSS 4.0: 8.5 · CVSS 3.1: 7.8) · CWE: CWE-78, OS Command Injection · Affected: cfdude/mac-shell-mcp < 2.0.0

What Is mac-shell-mcp?

mac-shell-mcp is an open-source MCP server that lets AI assistants (Claude, Cursor, etc.) run terminal commands on macOS through a ZSH shell. It is designed to provide a "secure" execution layer with:

  • A command whitelist that classifies commands as SAFE, REQUIRES_APPROVAL, or FORBIDDEN.
  • An approval queue for sensitive operations like mv and cp.
  • A block list for dangerous commands like rm and sudo.

The premise is sound: give the model shell access, but fence it in. The problem is where the fence was built.

What 2.0.0 Changed

The maintainer shipped a ground-up rebuild, not a patch. Key changes:

Before (< 2.0.0)After (2.0.0)
execFile with shell: trueexecFile with no shell, argv reaches execve directly
Whitelist checked command basenameCommands resolve by full path from root-owned directories
No argument validationPer-command argument allowlists; a command declaring none accepts none
7 MCP tools could mutate policy at runtimeAll policy-mutation tools removed
Approval queue with no timeoutApproval queue removed entirely
Child process inherited the full environmentChild environment is constructed

Disclosure Timeline

DateEvent
Jan 28, 2026Vulnerability reported privately via GitHub Security Advisory (GHSA-2h3j-235x-vx2q)
Jun 13, 2026First follow-up sent; no response from maintainer
Late Sep 2026Second follow-up sent; no response
Aug 29, 2026Maintainer commits 2.0.0 fix (PR #20)
Oct 4, 2026Public issue #45 opened to request advisory publication
Oct 11, 2026CVE reserved via VulnCheck (third-party CNA)
Oct 12, 2026CVE-2026-108953 published

What You Can Do With This

If you use mac-shell-mcp:

  • Update to 2.0.0 immediately. The fix is a breaking change (7 tools removed, authorization model replaced), so test your integration, but don't delay.
  • Audit your MCP server connections. If you run multiple MCP servers in one session, any one of them could have sent crafted tool calls to the vulnerable version.

If you build MCP servers that execute commands:

  • Never pass shell: true to execFile or spawn. If you don't need shell interpretation, don't invite it. Pass arguments as an array and let Node call execve directly.
  • Validate arguments, not just command names. A whitelist that checks the binary but ignores the arguments is a gate with no wall.
  • Don't expose policy-mutation tools over MCP. If the model can change what commands are allowed, the whitelist is decorative.
  • Treat every tool call as untrusted input. MCP tool calls originate from model output, which is influenced by everything the model has read like web pages, documents, emails. Assume adversarial input.

References

The Bigger Question

mac-shell-mcp had a whitelist, an approval queue, and a forbidden list. It still shipped a High-severity command injection for months. If a server designed around security controls got this wrong, what's hiding in the MCP servers your team installed for convenience and never looked at again?

mcp-audit gives security teams visibility into which MCP servers are connected across developer machines, what tools they expose, and where the risk is before the next CVE makes it your problem.

For every application you run

Find what's deployed and prove which exploits are real.

Go to apisec.ai