Back to skill

Security audit

mac-use

Security checks for vulnerabilities and agentic risk

Overview

This skill appears to do what it says, but it gives an agent broad Mac screen-reading and click/type control with weak scoping, risky shared temp files, and non-isolated install guidance.

Install only if you are comfortable giving the host process Screen Recording and Accessibility control over your Mac. Use it in a virtual environment, avoid system-wide pip installation, keep sensitive windows and clipboard contents clear, do not use it for passwords or secrets, and require explicit approval before any send, purchase, delete, settings, account, or financial action.

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

T08 · Insecure Dependencies

Warning
Location
requirements.txt:1
Finding

Unpinned dependencies and unsafe system-wide installation guidance

Content
View full analysis
=12.0 pyautogui>=0.9 Pillow>=10.0 ``` `SKILL.md:19-21`: ```bash pip3 install --break-system-packages -r {baseDir}/requirements.txt ``` `README.md:73-75`: ```bash pip3 install --break-system-packages -r requirements.txt ``` ### Technical Analysis All three third-party dependencies use open-ended lower-bound constraints. Consequently, an installation can retrieve package versions that did not exist when the Skill was reviewed. The project provides neither a lock file nor cryptographic hashes that bind installation to reviewed artifacts. The primary installation guidance also uses `--break-system-packages`, which bypasses Python's externally managed environment protection. This can modify a shared Homebrew or system-level Python environment instead of isolating the Skill's dependencies. Python packages may execute build-backend or setup-related code during installation, and their modules execute code when imported. The Skill imports these dependencies immediately in `scripts/mac_use.py`, including `pyautogui`, `Vision`, `Quartz`, and Pillow modules. A compromised or malicious future package release could therefore execute with the privileges of the user running the installation or Skill. This finding does not establish that the currently named packages are malicious. The vulnerability is the absence of version and artifact integrity controls combined with guidance to alter a shared Python environment. ### Attack Path 1. An attacker compromises the release process or distribution account of one of the declared dependencies, or publishes a future release containing malicious installation or import behavior. 2. A user follows ...[truncated 1284 chars]
Remediation
View remediation
=` constraints. 2. Generate and commit a lock file that includes transitive dependencies. 3. Require cryptographic hashes for downloaded artifacts, for example through a hash-locked requirements file and `pip install --require-hashes`. 4. Review dependency updates before changing the lock file, including package ownership, release history, source distribution behavior, and published wheels. 5. Make an isolated virtual environment the default installation procedure: ```bash python3 -m venv .venv source .venv/bin/activate python -m pip install --require-hashes -r requirements.lock ``` 6. Remove `--break-system-packages` from the recommended setup. If retained as a non-default alternative, clearly warn that it modifies a shared Python environment. 7. Consider automated dependency vulnerability scanning and reproducible builds as part of release validation. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/mac_use.py:35
Finding

Predictable shared temporary files permit state tampering and file clobbering

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (14)

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
93% confidence
Finding

The skill clearly instructs use of shell commands and writes artifacts to /tmp, but it declares no explicit tool scope or permission boundaries. In an agent environment, that mismatch increases the chance the skill can be invoked with broader-than-expected capabilities, enabling unintended command execution or filesystem side effects.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

This skill is designed to control arbitrary macOS GUI applications by opening apps, clicking, typing, and pressing keys, which can directly trigger real-world actions like sending messages, approving dialogs, changing settings, or modifying/deleting data. While it includes some operational guidance, it does not prominently frame these actions as potentially destructive or require confirmation before high-risk interactions, making accidental harmful automation more likely.

Content

No source excerpt is available for this finding.

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
91% confidence
Finding

This builds AppleScript code by interpolating the untrusted app_name directly into an osascript -e string. A crafted app name containing quotes or AppleScript syntax could break out of the intended string literal and execute arbitrary AppleScript commands, which is especially dangerous in a GUI automation skill that already has permission to control applications.

Content

Scanner excerpt · scripts/mac_use.py (reported line 133)May include surrounding context.

python
def activate_app(app_name):
    """Bring an app to the foreground."""
    subprocess.run(
        ["osascript", "-e", f'tell application "{app_name}" to activate'],
        capture_output=True,
        timeout=5,

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
93% confidence
Finding

Although the window title is partially escaped, app_name is still interpolated directly into AppleScript source in the System Events tell process clause. This enables AppleScript injection via crafted process names and could be used to trigger unintended automation actions on the host.

Content

Scanner excerpt · scripts/mac_use.py (reported line 150)May include surrounding context.

python
f'to perform action "AXRaise" of window "{safe_title}"'
    )
    try:
        subprocess.run(["osascript", "-e", script], capture_output=True, timeout=5)
        time.sleep(0.3)
    except Exception:
        pass

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The skill captures a full-screen screenshot, crops it, and persists image data to predictable files under /tmp without any user-facing warning or minimization. In the context of a desktop-control skill, this can expose sensitive information from emails, chats, passwords, or unrelated windows if the capture or storage is accessed by other local processes or reused unexpectedly.

Content

No source excerpt is available for this finding.

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · scripts/mac_use.py (reported line 232)May include surrounding context.

python
def capture_full_screen():
    """Take a full-screen screenshot. Returns True on success."""
    r = subprocess.run(
        ["/usr/sbin/screencapture", "-x", SCREENSHOT_FULL],
        capture_output=True, timeout=10,
    )

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
95% confidence
Finding

The keystroke AppleScript is created by interpolating the untrusted key value into a quoted script string without escaping. An attacker who can influence combo/main_key could inject additional AppleScript statements, causing arbitrary GUI actions or broader system automation under the user's privileges.

Content

Scanner excerpt · scripts/mac_use.py (reported line 553)May include surrounding context.

python
else:
        mod_str = ""
    script = f'tell application "System Events" to keystroke "{key}"{mod_str}'
    r = subprocess.run(["osascript", "-e", script], capture_output=True, timeout=10)
    if r.returncode != 0:
        sys.stderr.write(f"osascript keystroke failed: {r.stderr.decode().strip()}\n")

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · scripts/mac_use.py (reported line 568)May include surrounding context.

python
else:
        mod_str = ""
    script = f'tell application "System Events" to key code {code}{mod_str}'
    r = subprocess.run(["osascript", "-e", script], capture_output=True, timeout=10)
    if r.returncode != 0:
        sys.stderr.write(f"osascript keycode failed: {r.stderr.decode().strip()}\n")

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The type command writes arbitrary text to the system clipboard via pbcopy and then pastes it, overwriting the user's existing clipboard contents without notice or restoration. In a GUI automation skill, that can leak or destroy sensitive clipboard data and can also expose the injected text to clipboard history tools or other local observers.

Content

No source excerpt is available for this finding.

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · scripts/mac_use.py (reported line 577)May include surrounding context.

python
if args.app:
        activate_and_find(args.app)

    proc = subprocess.Popen(["pbcopy"], stdin=subprocess.PIPE)
    proc.communicate(args.text.encode("utf-8"))

    keystroke_via_osascript("v", ["command"])

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
97% confidence
Finding

The dependency is specified with a lower bound only, which allows installation of any newer release and makes builds non-reproducible. This increases supply-chain risk because future incompatible or compromised versions could be pulled in without review, though the issue is configuration weakness rather than direct exploit code.

Content

Scanner excerpt · requirements.txt (reported line 1)May include surrounding context.

text
pyobjc-framework-Vision>=12.0
pyautogui>=0.9
Pillow>=10.0

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
97% confidence
Finding

Using an unpinned pyautogui version means the installed package may vary over time, undermining reproducibility and allowing unexpected vulnerable or malicious upstream releases to be introduced. In a GUI-control skill, this matters because the package has direct input automation capability and would run with the user's desktop permissions.

Content

Scanner excerpt · requirements.txt (reported line 2)May include surrounding context.

text
pyobjc-framework-Vision>=12.0
pyautogui>=0.9
Pillow>=10.0

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
98% confidence
Finding

Pillow is unpinned, so deployments may resolve to different versions, including releases with known security issues. Because this skill processes screenshots/images as part of macOS GUI automation, an image library weakness is more relevant than in unrelated contexts and could expose the host to parsing-related vulnerabilities or denial of service.

Content

Scanner excerpt · requirements.txt (reported line 3)May include surrounding context.

text
pyobjc-framework-Vision>=12.0
pyautogui>=0.9
Pillow>=10.0

Unverifiable Dependency: Pillow has 16 known advisory(ies) (CVE-2016-2533 (Pillow buffer overflow in ImagingPcdDecode); CVE-2023-50447 (Arbitrary Code Execution in Pillow); CVE-2021-27922 (Pillow Uncontrolled Resource Consumption) +13 more), but the manifest does not pin a version, so it is unknown whether the installed release is affected

Low
Category
Supply Chain
Confidence
95% confidence
Finding

Pillow has multiple known advisories, and because no exact version is pinned, there is no way to verify whether the installed release includes fixes. Given the skill's visual automation purpose, Pillow is likely used on attacker-influenced image data such as screenshots or loaded assets, which makes known image-parsing flaws more operationally relevant.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.