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.
