T09 · Insecure Skill Coding Practices
- Location
scripts/mac_gui.py:165- Finding
AppleScript Injection Through Keyboard Combination Input
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This macOS desktop-control skill is open about its purpose, but it needs review because it grants broad screen and input control and contains unsafe AppleScript input handling.
Review this before installing if you would grant it Screen Recording, Accessibility, or Automation permissions. Use it only for tasks you explicitly want automated, avoid feeding untrusted app names or key-combo strings to the helper, stop before public submissions or destructive actions, and prefer a pinned virtual environment instead of the documented unpinned pip command.
scripts/mac_gui.py:165AppleScript Injection Through Keyboard Combination Input
scripts/mac_gui.py:139AppleScript Injection Through Application Name Input
SKILL.md:47Unpinned Third-Party Package Installation in Setup Instructions
The skill exposes shell-based GUI control capabilities but does not declare any explicit tool scope such as permissions or allowed-tools. Because the skill can capture screenshots, inject keyboard/mouse input, and invoke AppleScript/system commands on the host desktop, an agent may over-broaden its authority and perform sensitive local actions without clear policy boundaries.
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
def run(argv, *, input_text=None, timeout=15, check=False):
return subprocess.run(
argv,
input=input_text,
text=True,
Dynamic import() can load arbitrary modules at runtime, bypassing static analysis and potentially importing malicious code.
def have_module(name):
try:
__import__(name)
return True
except Exception:
return False
The script captures the user's screen and writes the image to disk without any user-facing confirmation, warning, or consent gate. In a desktop-control skill, screenshots can expose sensitive data such as messages, credentials, tokens, financial information, or other on-screen secrets, making silent capture particularly dangerous.
The skill can generate arbitrary keyboard input and mouse actions on the user's macOS desktop with no safety interlocks, confirmation, or foreground-target validation. In the context of a GUI automation skill, this capability can trigger destructive actions, approve prompts, change settings, send messages, or interact with sensitive applications if invoked unexpectedly or on the wrong window.
This code overwrites the system clipboard and immediately simulates Command+V without warning the user or restoring prior clipboard contents. That can leak or destroy clipboard data, and can also cause unintended submission of sensitive or dangerous text into whatever application currently has focus.
No suspicious patterns detected.