Back to skill

Security audit

Safe Shell

Security checks for vulnerabilities and agentic risk

Overview

This skill is meant to make shell use read-only, but its command validator can approve unsafe command strings and it also permits broad environment-variable disclosure.

Review this carefully before installing. The skill's goal is useful, but do not rely on it as a hard safety boundary for shell execution unless the validator is fixed to parse structured commands, reject all shell control syntax, remove or redact environment-variable dumps, and use a pinned, verifiable installer.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
Findings (3)

T09 · Insecure Skill Coding Practices

Error
Location
safe-shell.js:62
Finding

Shell command validation can be bypassed through unhandled control operators

Content
View full analysis
trimmed === cmd || trimmed.startsWith(cmd + ' ') || trimmed.startsWith(cmd + '\t') ); if (!isAllowed) { return { safe: false, reason: 'Command is not in the allowlist', blocked: false }; } return { safe: true }; ``` The approved, unchanged command is subsequently displayed for execution by a separate tool: ```javascript console.log(`Approved command: ${command}`); console.log('Actual execution must be performed through the exec tool'); ``` ### Technical Analysis The allowlist only verifies that the supplied string begins with an approved executable name. It does not parse the command into an executable and arguments, nor does it comprehensively reject shell syntax. The blocked-pattern list does not prohibit all of the following constructs: - Semicolon command sequencing - `&&` and `||` conditional execution - Arbitrary pipelines - Command substitution - Relative-path output redirection - Shell-specific expansion and quoting behaviors Consequently, input beginning with an allowed command can contain an additional unapproved operation. The complete string is then presented as approved and intended to be passed to an external execution tool. This also contradicts the documentation in `SKILL.md:185`, which states that command chains such as `;`, `&&`, and `||` are blocked. The JavaScript file does not directly execute the command, so exploitation depends on an agent or downstream component trusting the validator and passing the approved string to a shell. That downstream behavior is explicitly contemplated by the program's execution message. # ...[truncated 1362 chars]
Remediation
View remediation

T05 · Unauthorized Access and Privilege Escalation

Warning
Location
safe-shell.js:18
Finding

Unrestricted environment-variable enumeration can expose credentials

Content
View full analysis
Remediation
View remediation

T08 · Insecure Dependencies

Warning
Location
SKILL.md:12
Finding

Installation executes an unpinned package from a mutable release tag

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Rogue AgentSelf-Modification, Session Persistence
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
Findings (9)

External Script Fetching

High
Category
Supply Chain
Confidence
90% confidence
Finding

Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.

Content

Scanner excerpt · SKILL.md (reported line 99)May include surrounding context.

md
| 任何修改 | `chmod`, `chown`, `attrib`, `touch` | 配置破坏 |
| 关机重启 | `shutdown`, `reboot`, `halt`, `restart` | 断连 |
| 进程控制 | `kill`, `pkill`, `killall`, `taskkill` | 服务中断 |
| 管道执行 | `curl \| sh`, `wget \| bash`, `\| cmd` | 恶意代码 |
| 提权 | `sudo`, `su`, `runas` | 权限风险 |
| 下载执行 | `curl`, `wget`, `Invoke-WebRequest` | 潜在风险 |
| 远程连接 | `ssh`, `scp`, `sftp`, `rdp` | 安全风险 |

External Script Fetching

High
Category
Supply Chain
Confidence
90% confidence
Finding

Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.

Content

Scanner excerpt · SKILL.md (reported line 99)May include surrounding context.

md
| 任何修改 | `chmod`, `chown`, `attrib`, `touch` | 配置破坏 |
| 关机重启 | `shutdown`, `reboot`, `halt`, `restart` | 断连 |
| 进程控制 | `kill`, `pkill`, `killall`, `taskkill` | 服务中断 |
| 管道执行 | `curl \| sh`, `wget \| bash`, `\| cmd` | 恶意代码 |
| 提权 | `sudo`, `su`, `runas` | 权限风险 |
| 下载执行 | `curl`, `wget`, `Invoke-WebRequest` | 潜在风险 |
| 远程连接 | `ssh`, `scp`, `sftp`, `rdp` | 安全风险 |

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
91% confidence
Finding

The skill advertises shell-based capabilities but does not declare an explicit tool scope such as allowed-tools or permissions. That creates ambiguity for the runtime and reviewers, and can let the agent invoke broader shell access than the skill text informally intends.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
89% confidence
Finding

The manifest references an MCP-related installer command without a fixed version, so consumers may fetch different code depending on time and registry state. In a security-oriented shell skill, that broadens the attack surface to upstream package compromise or typosquatting-like replacement risks.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
93% confidence
Finding

The installation command uses npx clawhub@latest, which is not a pinned immutable version and may resolve to different code over time. This creates a supply-chain risk where a future compromised or breaking release could change what gets installed or executed.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The manifest description and the entire markdown guidance are presented in Chinese, including operational examples and safety constraints. This effectively forces a language/locale for users without documenting an opt-in or a justified region-specific scope.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
93% confidence
Finding

The repeated use of npx clawhub@latest in installation instructions again introduces an unpinned dependency path. Because this skill is positioned as a security control, mutable installation sources are especially problematic and undermine trust in the claimed safety properties.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
75% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · SKILL.md (reported line 129)May include surrounding context.

md
| 磁盘操作 | `diskutil erase`, `dd` | 磁盘数据丢失 |
| SIP | `csrutil` | 系统完整性破坏 |
| 启动安全 | `bless` | 启动修改 |
| 系统偏好 | `defaults write` | 配置修改 |

### 🐧 Linux 专用危险命令

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The file’s natural-language comments and user-facing messages are written exclusively in Chinese, and the skill description states its behavior only in that language. For a general-purpose shell executor, this imposes a specific language/locale without offering the user a choice or documenting a region-specific justification.

Content

No source excerpt is available for this finding.