Back to skill

Security audit

macOS Notes

Security checks for vulnerabilities and agentic risk

Overview

The skill does what it claims for Apple Notes, but it also creates a persistent plaintext log of private note metadata without clear controls.

Install only if you are comfortable with the skill reading and creating Apple Notes and with a separate local log retaining note titles, note names, search terms, and folder/account names. Review or disable the logging behavior before using it for sensitive notes, passwords, health, legal, work, or account-related content.

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

Note
Location
scripts/notes.sh:25
Finding

Plaintext Logging of Sensitive Notes Metadata

Content
View full analysis

Vulnerability Details

File Location: scripts/notes.sh:25-31, with sensitive logging calls at scripts/notes.sh:151, scripts/notes.sh:222, and scripts/notes.sh:391
Vulnerability Type: Plaintext storage of potentially sensitive metadata with permissions dependent on the caller's umask
Risk Level: Low

Vulnerable Code

bash
LOGFILE="${SKILL_DIR:-$(dirname "$0")/..}/logs/notes.log"

# Append-only action log
log_action() {
  mkdir -p "$(dirname "$LOGFILE")"
  printf '%s\t%s\t%s\t%s\n' "$(date -u +%Y-%m-%dT%H:%M:%SZ)" "$1" "$2" "$3" >> "$LOGFILE"
}

Sensitive values are passed to the logging function at the following locations:

bash
log_action "create-note" "${account:-default}/${folder:-default}" "$title"
bash
log_action "read-note" "${account:-default}/${folder:-default}" "$name"
bash
log_action "search-notes" "${account:-default}" "$query"

Technical Analysis

The script stores note titles, requested note names, search queries, account names, and folder names in a persistent plaintext log. These values may reveal private subjects or sensitive search activity even though complete note bodies are not logged.

The logging function creates its directory and appends to the file without explicitly establishing restrictive permissions. Consequently, effective permissions depend on the invoking process's umask and on any pre-existing directory or log file. In an environment with permissive filesystem permissions, another local user or process could read the retained metadata.

Logging is documented in SKILL.md, but disclosure does not mitigate the confidentiality and retention risks associated with storing sensitive metadata in plaintext.

Attack Path

  1. A user creates or reads a note with a sensitive title, or searches for a sensitive term.
  2. The script passes the title, note name, query, account, or folder to log_action.
  3. log_action appen ...[truncated 858 chars]
Remediation
View remediation

Remediation Suggestions

  1. Do not log note titles, note names, or search queries by default. Replace them with non-sensitive operation identifiers or a fixed redacted marker.

  2. If correlation is required, use a keyed pseudonymous identifier rather than an unsalted hash that could be guessed from common titles or queries.

  3. Establish restrictive permissions before creating any logging resources:

    bash
    umask 077
    mkdir -p -m 700 "$(dirname "$LOGFILE")"
    touch "$LOGFILE"
    chmod 600 "$LOGFILE"
    
  4. Validate that an existing log path is a regular file owned by the current user before appending to it.

  5. Make detailed logging opt-in and clearly warn users that Notes metadata may be sensitive.

  6. Implement retention limits, secure rotation, and deletion so metadata is not stored indefinitely.

  7. Review backup policies to prevent unnecessary propagation of the log.

Vulnerability Patterns
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (9)

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
87% confidence
Finding

The skill invokes local executables (osascript, python3) and relies on environment-derived paths like $SKILL_DIR, but it declares no explicit tool scope or permission boundaries. That creates an authorization gap where an orchestrator may expose broader execution capability than intended, increasing the blast radius if the skill is invoked unexpectedly or its companion script is modified.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The trigger description is broad enough to match common phrases like 'note this down' or 'save this,' which can cause unintended invocation of a skill that reads and writes private Notes data. In this context, accidental activation is more dangerous because the skill can access personal content and create persistent records in a user’s notes.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

Line L144 makes a concrete behavioral claim that every action is logged with timestamp, command, and note title. In the provided skill file, all examples and operational guidance only invoke notes.sh commands and do not define or show any logging mechanism, so the documentation asserts behavior not evidenced by the code/documentation here.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

Mandating logging of note actions and note titles creates a secondary plaintext metadata trail about user content, which may expose sensitive subjects such as passwords, health topics, meetings, or account names even if full note bodies are not stored. Because this skill handles inherently personal notes on macOS, retaining human-readable titles materially increases privacy and breach impact.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The create-note command performs a persistent write by creating a new note in the user's Notes database, but the script provides no confirmation prompt or user-facing warning at the point of execution. Although the file has brief usage comments, they do not disclose the safety impact of modifying user data before the write occurs.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The read-note path accesses note plaintext and then logs note identifiers and scope to a persistent logfile. In a Notes skill, reading notes is expected, but retaining metadata about sensitive note access without clear disclosure creates avoidable privacy leakage and a secondary audit trail that may expose confidential interests, projects, or subjects.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Low
Category
Not specified by scanner
Confidence
80% confidence
Finding

The skill is presented as a Notes-management helper, but the code proactively checks for a running Notes process and opens Notes.app if it is not running. While this may be an implementation workaround for AppleScript reliability, it is still an extra capability with visible system side effects beyond the manifest's plain-language description.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Low
Category
Not specified by scanner
Confidence
94% confidence
Finding

The script creates a persistent logfile outside Apple Notes that records user actions, note titles, queries, and folder/account scope. For a skill whose stated purpose is to manage Notes, this is an undocumented secondary data store that can expose sensitive metadata to other local users, backups, or forensic review even after notes are deleted or moved.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

The script logs search queries and note browsing metadata during list/search operations, which can reveal sensitive topics even when note bodies are not stored. Because search terms and note titles often contain private information, this creates an unnecessary privacy exposure outside the Notes application.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.