Back to skill

Security audit

Homebrew

Security checks for vulnerabilities and agentic risk

Overview

This Homebrew helper is coherent and mostly user-directed, but it tells agents to run a live remote installer script directly in Bash without integrity verification.

Install only if you are comfortable with an agent managing Homebrew packages on your Mac. Before allowing Homebrew installation, prefer reviewing the official installer source or running the official Homebrew install flow yourself; also confirm package names and Brewfile locations before install, uninstall, cleanup, or bundle commands.

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:36
Finding
Unverified Remote Homebrew Installer Execution## Vulnerability Details **File Location**: `SKILL.md`, line 36 **Vulnerability Type**: Remote payload retrieval and execution **Risk Level**: High **Complete Code Snippet**: ```bash /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" ``` ### Technical Analysis The Skill instructs the Agent to retrieve a remote shell script and pass the response directly to Bash. The URL references the mutable `HEAD` revision rather than a reviewed and pinned commit, and the command performs no checksum or signature verification before execution. Consequently, the effective code can change after the Skill has been audited. The URL appears to reference Homebrew's official GitHub organization, and the workflow requires the user to agree before installation. These factors reduce accidental or deceptive invocation risk but do not provide payload integrity. A compromised upstream repository or account, malicious upstream modification, or failure in the trusted delivery chain could replace the response with arbitrary shell commands. Homebrew installation is consistent with the Skill's declared purpose. However, immediately executing an unpinned network response is not the minimum-risk mechanism necessary to provide that functionality. ### Attack Path 1. Homebrew is not installed on the target macOS system. 2. The user requests or approves Homebrew installation. 3. The Agent executes the documented `curl` and Bash command. 4. The command downloads the current contents of `install.sh` from mutable `HEAD`. 5. If the upstream source or delivery chain has been compromised or maliciously changed, attacker-controlled shell commands are returned. 6. Bash executes those commands immediately without local review or integrity verification. ### Impact Assessment A substituted installer can execute arbitrary commands with the invoking user's privileges, including reading or modifying user-accessible files ...[truncated 351 chars]
Remediation
## Remediation Suggestions 1. Do not pipe remotely downloaded content directly into a shell. 2. Pin the installer URL to a specific, reviewed Homebrew repository commit instead of `HEAD`. 3. Download the installer to a local file before execution. 4. Verify the file against a trusted SHA-256 digest or a valid cryptographic signature obtained through a separate trusted channel. 5. Display the source, pinned revision, and verification result to the user, then obtain explicit confirmation before running the verified file. 6. Execute with ordinary user privileges unless a specific installation step demonstrably requires elevation; explain and separately confirm any privileged action. 7. If a trustworthy immutable revision and integrity value cannot be maintained, direct the user to Homebrew's official installation documentation rather than automatically executing the installer.
Vulnerability Patterns
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • 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 (3)

Natural-Language Policy Violations

Low
Confidence
89% confidence
Finding
The skill includes multiple Chinese-only example utterances for routing user intent, such as the trigger text on this line, but does not explicitly offer a language or locale choice. This can be a natural-language policy issue when a skill appears to assume a specific language without user opt-in.

Missing User Warnings

Low
Confidence
80% confidence
Finding
The markdown describes `brew bundle dump --file Brewfile`, which writes a Brewfile into the current working location, but it does not explicitly warn that this operation creates or may overwrite a local file. Since SQP-2 for markdown covers behaviors affecting user data or system integrity, this file-writing behavior should be disclosed more clearly.

Natural-Language Policy Violations

Low
Confidence
93% confidence
Finding
The intent-to-command mapping is expressed entirely through Chinese example requests, which implies a default language choice for user interaction. Because the file does not clearly offer language selection or justify a Chinese-only scope, this conflicts with the language/locale policy guidance.

Static analysis

No suspicious patterns detected.