Back to skill

Security audit

macos-terminal-beautify

Security checks for vulnerabilities and agentic risk

Overview

This skill is mostly a coherent macOS terminal setup guide, but it asks users to run an unverified remote shell installer unattended and make persistent shell changes.

Review the installer commands before running them. Prefer pinning or manually inspecting the Oh My Zsh installer instead of executing the live master-branch script unattended, and only add the locale and ~/.zshrc changes if they match how you want every future shell session to behave.

Vulnerability Patterns
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • 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
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
Findings (1)

T03 · Remote Payload Retrieval and Execution

Error
Location
SKILL.md:42
Finding
Unverified Mutable Remote Installer Executed Directly by Shell## Vulnerability Details **File Location**: `SKILL.md`, line 42 **Vulnerability Type**: Remote payload retrieval and execution **Risk Level**: High **Complete Code Snippet**: ```bash sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" "" --unattended ``` ### Technical Analysis The installation instruction downloads a shell script from the mutable `master` branch of the Oh My Zsh repository and immediately executes its contents with `sh`. It does not pin the payload to a reviewed commit or release and performs no checksum or signature verification. Consequently, the code executed at installation time may differ from the code assessed during this audit. Although the URL points to the official Oh My Zsh GitHub organization and installing Oh My Zsh is consistent with the Skill's terminal-customization purpose, direct execution of mutable remote content is not the minimum-risk mechanism necessary to provide that functionality. The `--unattended` option also suppresses interactive installation prompts, reducing the user's opportunity to inspect or reject unexpected actions. ### Attack Path 1. An attacker compromises the upstream repository, a maintainer account, or another component capable of altering the script served from the referenced mutable branch. 2. The attacker adds malicious shell commands to the remote installer. 3. A user or agent follows the Skill and runs the documented installation command. 4. `curl` retrieves the current attacker-controlled script without integrity verification. 5. Command substitution passes the downloaded content directly to `sh`. 6. The malicious commands execute with the permissions of the user running the Skill. ### Impact Assessment A substituted installer could obtain arbitrary user-level code execution. It could read or modify files accessible to the invoking account, alter shell configuration and startup files, access environment varia ...[truncated 399 chars]
Remediation
## Remediation Suggestions 1. Pin the installer to a specific, reviewed commit rather than the mutable `master` branch. 2. Download the installer to a local file instead of piping or substituting it directly into a shell. 3. Verify its SHA-256 checksum against an independently trusted expected value or validate a cryptographic signature. 4. Allow the user to inspect the downloaded script before execution. 5. Avoid unattended execution unless automation is explicitly required and all resulting file changes are documented. 6. Prefer a trusted package-manager package or another installation method with version pinning and integrity controls where available. 7. Run the installer as an ordinary user and do not add `sudo` or other privilege-escalation mechanisms. A safer pattern is: ```bash curl -fL \ -o /tmp/ohmyzsh-install.sh \ "https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/<PINNED_COMMIT>/tools/install.sh" echo "<EXPECTED_SHA256> /tmp/ohmyzsh-install.sh" | shasum -a 256 -c - less /tmp/ohmyzsh-install.sh sh /tmp/ohmyzsh-install.sh --unattended rm -f /tmp/ohmyzsh-install.sh ``` The pinned commit and expected digest must be supplied from trusted, reviewed sources.
Vulnerability Patterns
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (4)

Tool Parameter Abuse

High
Category
Tool Misuse
Content
如果 brew 遇到 API 缓存问题(如 `cask.jws.json` 错误),先清除缓存:
```bash
rm -rf ~/Library/Caches/Homebrew/api/*.json
brew update
```
Confidence
90% confidence
Finding
Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Tool Parameter Abuse

High
Category
Tool Misuse
Content
如果 brew 遇到 API 缓存问题(如 `cask.jws.json` 错误),先清除缓存:
```bash
rm -rf ~/Library/Caches/Homebrew/api/*.json
brew update
```
Confidence
90% confidence
Finding
Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Natural-Language Policy Violations

Medium
Confidence
94% confidence
Finding
The skill unconditionally sets LANG and LC_ALL to en_US.UTF-8, overriding the user's existing locale without consent. This can alter command behavior, sorting, parsing, and downstream tool output in ways the user did not request, making the environment modification unsafe for a general-purpose setup skill.

Natural-Language Policy Violations

Low
Confidence
97% confidence
Finding
The script's user-facing messages are written entirely in Chinese, including status headings and installation messages. This can violate a language/locale policy when a skill forces a specific language without user opt-in and does not indicate that it is intentionally region- or locale-specific.

Static analysis

No suspicious patterns detected.