Back to skill

Security audit

Safari Browser Control

Security checks for vulnerabilities and agentic risk

Overview

This skill does what it claims, but it gives an agent broad control over your logged-in Safari session and includes an unsafe temporary helper pattern.

Review before installing. Use this only when you intentionally want an agent to operate your real Safari browser, preferably in a dedicated low-risk browser profile or session. Avoid using it around banking, admin consoles, private accounts, or sensitive open tabs unless you are prepared for the agent to read visible page data and perform actions there. The /tmp helper pattern should be fixed before routine use.

Vulnerability Patterns
  • Tool Hijacking and SpoofingModifies or replaces tools so legitimate-looking calls execute attacker logic
  • 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
Findings (1)

T07 · Tool Hijacking and Spoofing

Error
Location
SKILL.md:139
Finding
Predictable Shared Temporary Executable Allows Local Tool Hijacking## Vulnerability Details **File Location**: `SKILL.md`, lines 139–170 **Vulnerability Type**: Predictable executable path and unsafe temporary-file handling **Risk Level**: High ### Vulnerable Code ```bash # Test if Screen Recording permission is granted (background screenshot available) /tmp/safari_wid 2>/dev/null && echo "BACKGROUND_SCREENSHOT=true" || echo "BACKGROUND_SCREENSHOT=false" # Compile the helper once per session (if not already compiled) if [ ! -f /tmp/safari_wid ]; then cat > /tmp/safari_wid.swift << 'SWIFT' import CoreGraphics import Foundation let options: CGWindowListOption = [.optionOnScreenOnly, .excludeDesktopElements] guard let windowList = CGWindowListCopyWindowInfo(options, kCGNullWindowID) as? [[String: Any]] else { exit(1) } for window in windowList { guard let owner = window[kCGWindowOwnerName as String] as? String, owner == "Safari", let layer = window[kCGWindowLayer as String] as? Int, layer == 0, let wid = window[kCGWindowNumber as String] as? Int else { continue } print(wid) exit(0) } exit(1) SWIFT swiftc /tmp/safari_wid.swift -o /tmp/safari_wid fi # Capture Safari window in background (no activation needed) WID=$(/tmp/safari_wid) screencapture -l "$WID" -o -x /tmp/safari_screenshot.png ``` ### Technical Analysis The documented workflow creates, caches, and executes a helper using the globally predictable path `/tmp/safari_wid`. More critically, it executes that path before validating or compiling it. The later check only verifies whether the path is a regular file: ```bash if [ ! -f /tmp/safari_wid ]; then ``` It does not verify that the file was created by the current process, is owned by the current user, has safe permissions, contains the expected program, or is not controlled by another local process. If a malicious executable already exists at that path, compilation is skipped and the untrusted file is executed both during capability detection and while obtaining th ...[truncated 1517 chars]
Remediation
## Remediation Suggestions 1. Create a unique private working directory rather than using fixed paths: ```bash WORKDIR=$(mktemp -d "${TMPDIR:-/tmp}/safari-control.XXXXXX") || exit 1 chmod 700 "$WORKDIR" trap 'rm -rf "$WORKDIR"' EXIT HUP INT TERM SOURCE="$WORKDIR/safari_wid.swift" HELPER="$WORKDIR/safari_wid" SCREENSHOT="$WORKDIR/safari_screenshot.png" ``` 2. Compile and execute only the helper created during the current run. Do not treat a preexisting executable as a trusted cache. 3. Use restrictive permissions and a restrictive `umask`, such as `umask 077`, before creating files. 4. If caching is required, place the helper in a user-owned private cache directory and validate its ownership, permissions, file type, and cryptographic hash before execution. 5. Reject symbolic links and avoid check-then-use logic. Open or create files atomically where possible. 6. Store screenshots under the private working directory instead of the predictable `/tmp/safari_screenshot.png` path. 7. Ensure cleanup occurs through a shell `trap`, including on interruption or failure.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (2)

Missing User Warnings

High
Confidence
97% confidence
Finding
The skill explicitly operates on the user's live Safari session, including cookies, logins, and open tabs, but does not present a prominent privacy and account-impact warning. In this context, the capability is especially dangerous because any mistaken or overbroad use can expose sensitive data from authenticated sessions or perform actions on behalf of the user.

Vague Triggers

Medium
Confidence
96% confidence
Finding
The trigger list is very broad and overlaps with ordinary browsing-related requests, which can cause the skill to activate in contexts the user did not clearly intend. Because this skill can control the user's real Safari session, ambiguous invocation materially increases the chance of unintended page reads, clicks, navigation, or interaction with logged-in accounts.

Static analysis

No suspicious patterns detected.