Back to skill

Security audit

Apple Maps (MacOS)

Security checks for vulnerabilities and agentic risk

Overview

The skill is mostly coherent for opening Apple Maps, but its command examples can invite unsafe shell interpolation of user-provided map queries.

Install only if you are comfortable with a macOS automation skill that opens Apple Maps and stores limited local preferences. Before use, ensure map query values are percent-encoded and launched as separate process arguments rather than interpolated into a shell command.

Vulnerability Patterns
  • 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
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (1)

T09 · Insecure Skill Coding Practices

Error
Location
command-paths.md:19
Finding
Command Injection Through Unsafe Interpolation of Map Parameters<![CDATA[ ## Vulnerability Details **File Location**: `command-paths.md`, lines 19-21; related construction instructions in `operation-patterns.md`, lines 6-9 and 18-21 **Vulnerability Type**: OS command injection caused by unsafe handling of user-controlled URL parameters **Risk Level**: High ### Vulnerable Code Snippet ```bash open -a Maps "https://maps.apple.com/?q=coffee+near+me" open -a Maps "https://maps.apple.com/?q=restaurants&near=Madrid" open -a Maps "https://maps.apple.com/?saddr=Cupertino&daddr=San+Francisco&dirflg=d" ``` The associated operation instructions direct the agent to substitute user-controlled values into these commands: ```markdown ## Place Search Pattern 1. Confirm search query text. 2. Ask for area context if the request is ambiguous. 3. Build URL with `q` and optional `near`. 4. Show preview URL and launch with `open -a Maps`. 5. Confirm expected result type after launch. ``` ```markdown ## Route Pattern 1. Confirm origin (`saddr`) and destination (`daddr`). 2. Confirm route mode (`dirflg`: driving, walking, transit). 3. Build URL and show preview before launch. 4. Launch in Maps and verify mode/destination match intent. ``` ### Technical Analysis The skill instructs the agent to construct a shell command by inserting user-provided search text, area names, route origins, and destinations into an Apple Maps URL. It does not require RFC 3986 percent-encoding, strict input validation, or invocation through an API that passes arguments directly without a shell. Wrapping the URL in double quotes is insufficient when untrusted text is interpolated into a shell command. Shell constructs such as `$(...)` and backtick command substitutions remain active inside double-quoted strings. Embedded quotation marks or newline characters may also alter the intended command structure. For example, if an implementation inserts a malicious query such as `$(malicious_command)` directly into the documented template, the resulting command can tak ...[truncated 1774 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. **Avoid shell-based execution.** Invoke `open` through a process API that accepts an argument array: ```text executable: /usr/bin/open arguments: ["-a", "Maps", generated_url] shell: false ``` 2. **Percent-encode every user-controlled URL component.** Encode `q`, `near`, `saddr`, `daddr`, `ll`, and other values with a standards-compliant URL builder rather than string concatenation. 3. **Validate the completed URL.** Require: - Scheme exactly equal to `https`. - Host exactly equal to `maps.apple.com`. - Only documented parameter names. - No control characters, newlines, or embedded credentials. - A reasonable maximum length. 4. **Do not rely on double quotes as sanitization.** If a shell cannot be avoided, use platform-appropriate argument escaping in addition to URL encoding and reject shell-sensitive constructs. Direct non-shell execution remains the preferred control. 5. **Update the operation documentation.** Explicitly state that user input must never be inserted into a command template before encoding and that the command must be launched without shell evaluation. 6. **Add adversarial tests.** Test query and route values containing command substitutions, backticks, quotation marks, ampersands, semicolons, newlines, Unicode control characters, and percent-encoded equivalents. Verify that these values remain inert URL data and cannot create additional commands. ]]>
Vulnerability Patterns
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (1)

Autonomous Decision Making

Medium
Category
Excessive Agency
Content
- Sharing raw links that include private notes -> accidental disclosure.
- Using UI scripting as default path -> brittle behavior across locales.
- Opening many candidate links at once -> user loses context quickly.
- Assuming route mode without confirmation -> wrong transport directions.

## External Endpoints
Confidence
75% confidence
Finding
Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.

Static analysis

No suspicious patterns detected.