Back to skill

Security audit

AppleScript

Security checks for vulnerabilities and agentic risk

Overview

This is a local AppleScript automation skill with clear confirmation guardrails, though its default process-list probe is broader than necessary.

Install only if you are comfortable with a local agent running AppleScript against apps you name. Prefer target-specific permission checks instead of the documented every-process probe, and keep the confirmation gates enabled for writes, deletes, and bulk changes.

Vulnerability Patterns
  • 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
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • 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)

other

Warning
Location
script-patterns.md:11
Finding
Overly Broad Process Enumeration Used as a Default Permission Probe## Vulnerability Details **File Location**: `script-patterns.md`, lines 11–17 **Vulnerability Type**: Unnecessary environment reconnaissance and information exposure **Risk Level**: Medium ### Vulnerable Code ```applescript tell application "System Events" return name of every process end tell ``` The accompanying instruction states: ```text Use this first to verify permissions and baseline execution. ``` ### Technical Analysis The recommended read-only probe asks macOS `System Events` to return the name of every running process. This collects system-wide application activity even when the requested automation concerns only one target application. Using this probe by default violates data-minimization and least-scope principles. Verifying AppleScript execution or Automation permissions does not ordinarily require inventorying every running process. Although the project contains no mechanism for transmitting the collected data externally, the resulting process list becomes visible in command output and may enter the agent's working context. Process names can reveal sensitive contextual information, including security software, communication clients, financial applications, development tools, and other active user workflows. ### Attack Path 1. A user requests routine AppleScript automation for a specific application. 2. The agent follows the documented instruction to run the probe first. 3. `System Events` enumerates every running process rather than querying only the requested application. 4. The full process list is returned through `osascript` output and exposed to the agent. 5. That unrelated environmental information may be retained in session context, logs, or subsequent diagnostic output. No privilege escalation, persistence, or external exfiltration path was identified. The issue is limited to unnecessary local environment discovery and disclosure to the executing agent. ### Impact Assessment The probe can disclose the names of all processe ...[truncated 457 chars]
Remediation
## Remediation Suggestions 1. Replace the system-wide inventory with a target-scoped permission probe that checks only the application named in the user's request. 2. If only basic AppleScript availability must be tested, use a benign expression that does not query process state. 3. When application readiness must be checked, query whether the specific target process exists rather than returning every process name. 4. Do not return process metadata unless it is necessary to satisfy the user's explicit request. 5. Require informed user approval before performing system-wide process enumeration. 6. Normalize diagnostic output so that only a success indicator or target-specific result is returned. 7. Update the guidance to state that permission probes must follow data-minimization and least-scope principles. For example, a target-specific readiness check can be structured as: ```applescript tell application "System Events" return exists process "TargetApp" end tell ``` The target application name must be passed through a safe parameterization or deterministic escaping mechanism rather than concatenated as an untrusted command fragment.
Vulnerability Patterns
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • 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 (1)

Autonomous Decision Making

Medium
Category
Excessive Agency
Content
Stop immediately if any of these apply:
- Target identity is ambiguous.
- Dictionary commands differ from expected shape.
- Script attempts irreversible bulk change without confirmation.
Confidence
75% confidence
Finding
Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.

Static analysis

No suspicious patterns detected.