Back to skill

Security audit

fruitmail — Apple Mail Search

Security checks for vulnerabilities and agentic risk

Overview

The skill is purpose-built for local Apple Mail search, but it asks for highly sensitive mail access and ships an installable script with under-scoped privacy guidance and input-validation flaws.

Review before installing. This tool can read Apple Mail metadata and message bodies from the local Mail store and can export results, so use it only for explicit local-mail searches, avoid broad exports unless necessary, and be cautious with values copied from untrusted text. The script should validate numeric IDs, limits, and dates before use, and --no-copy should be avoided unless you accept live database integrity risk.

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
references/install.md:70
Finding

SQL Injection Through Unvalidated Command-Line Arguments

Content
View full analysis
($NOW_EXPR - ($DAYS * 86400)) AND m.deleted = 0 ORDER BY m.date_sent DESC LIMIT $LIMIT" ;; ``` Date values and the limit are also interpolated directly: ```bash date-range) [ ${#ARGS[@]} -lt 2 ] && { echo "Usage: mail-search date-range YYYY-MM-DD YYYY-MM-DD" >&2; exit 1; } FROM_DATE="${ARGS[0]}"; TO_DATE="${ARGS[1]}" QUERY="SELECT m.ROWID as id, CASE WHEN (m.read = 0) THEN '●' ELSE ' ' END as unread, $DATE_EXPR as date, COALESCE(a.comment, a.address, 'Unknown') as sender, s.subject FROM messages m JOIN subjects s ON m.subject = s.ROWID LEFT JOIN addresses a ON m.sender = a.ROWID WHERE m.date_sent >= (strftime('%s', '$FROM_DATE') - $EPOCH_OFFSET) AND m.date_sent < (strftime('%s', '$TO_DATE', '+1 day') - $EPOCH_OFFSET) AND m.deleted = 0 ORDER BY m.date_sent DESC LIMIT $LIMIT" ;; ``` Message IDs are inserted into SQL without validation: ```bash thread) [ ${#ARGS[@]} -lt 1 ] && { echo "Usage: mail-search thread " >&2; exit 1; } MSG_ID="${ARGS[0]}" QUERY="SELECT m.ROWID as id, CASE WHEN (m.read = 0) TH ...[truncated 4468 chars]
Remediation
View remediation
&2 exit 1 fi } ``` Apply this validation to `LIMIT`, `DAYS`, and every message ID. Enforce sensible upper bounds as well, such as a maximum result limit and maximum recent-day range. 2. **Strictly validate date syntax and calendar validity.** Require the `YYYY-MM-DD` format: ```bash if [[ ! "$FROM_DATE" =~ ^[0-9]{4}-[0-9]{2}-[0-9]{2}$ ]] || [[ ! "$TO_DATE" =~ ^[0-9]{4}-[0-9]{2}-[0-9]{2}$ ]]; then echo "Error: dates must use YYYY-MM-DD" >&2 exit 1 fi ``` After checking the shape, parse each value using an appropriate date parser and reject nonexistent dates. 3. **Use parameter binding rather than SQL string interpolation.** Where supported, pass user values through SQLite parameter facilities such as `.parameter` and reference named parameters from the query. Keep SQL syntax static and bind only data values. 4. **Constrain dynamic SQL elements that cannot be bound.** SQLite may not support binding in every structural position in the same way as data values. For `LIMIT`, convert and validate the value as an integer before interpolation. Never place raw input into an SQL structural context. 5. **Reject missing option values and unexpected extra arguments.** Before reading `$2` for options such as `--limit` and `--db`, verify that a value exists. Each command should enforce its exact expected argument count instead of accepting unused trailing arguments. 6. **Reduce the impact of a successful injection.** Keep copied-database mode as the default, clearly warn about the integrity risk of `--no-copy`, and consider removing live-database mode unless it is essential. Open the copied database in read-only/query-only mode where practical, for example by ena ...[truncated 355 chars]
Vulnerability Patterns
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
Findings (5)

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The description says the skill should be used when asked to 'find, search, read, or list emails,' which is broad enough to match many ordinary user requests without clearly signaling that it will access a sensitive local mail store. Because the skill can read message metadata and bodies and export results, over-broad invocation increases the chance of unintended activation and privacy-invasive access beyond user expectations.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The documentation explains how to search subjects, senders, threads, bodies, attachments, and export results, but it does not prominently warn that this reads highly sensitive local email contents from ~/Library/Mail and may expose personal, financial, legal, or authentication-related data. Without an explicit privacy warning and consent guidance, users or calling agents may invoke the skill in ways that over-collect, reveal, or persist confidential email data.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The installation instructions create a script that directly reads the user's local Apple Mail database and message bodies, including sender, recipients, subjects, attachments, and email content, but they do not provide a clear privacy warning or consent boundary. This is dangerous because users may install and run it without understanding that it bypasses the normal Mail UI and exposes sensitive mailbox data to shell commands and downstream automation.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The manifest describes a fast Apple Mail search skill to find, search, read, or list emails via SQLite. The documented script also exposes an open <id> command that launches Mail.app for a selected message, which is an interactive side effect outside the stated search/read-by-database behavior.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

Most of the script performs local SQLite queries over Apple Mail data, which directly matches the stated purpose. In contrast, the open branch uses the macOS open command to launch Mail.app on a message URL, introducing external application execution rather than just searching or reading mail data.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.