subprocess module call
Medium
- Category
- Dangerous Code Execution
- Content
def _run_osascript(script: str) -> tuple[int, str]: """执行 AppleScript, 返回 (returncode, output)""" p = subprocess.run(["osascript", "-e", script], capture_output=True, text=True, timeout=30) return p.returncode, p.stdout.strip()- Confidence
- 96% confidence
- Finding
- The code passes dynamically constructed AppleScript directly to `osascript`, and that script later embeds untrusted user-controlled values such as `contact`, `message`, and file paths without robust escaping. This creates an AppleScript injection path that can execute arbitrary UI actions or AppleScript commands on the host, which is especially dangerous because the skill automates a privileged desktop application.
