apple-notes-sdk-patterns
Warn
Audited by Gen Agent Trust Hub on Sep 9, 2026
Risk Level: MEDIUMCOMMAND_EXECUTIONDYNAMIC_EXECUTIONINDIRECT_PROMPT_INJECTION
Full Analysis
- [COMMAND_EXECUTION]: The
AppleNotesClient.runJxamethod inSKILL.mdexecutes shell commands viachild_process.execSyncusing string interpolation. The implementation uses a simple single-quote escapescript.replace(/'/g, "\\'")which is insufficient to prevent command injection in all shell environments, especially if inputs contain backticks or dollar signs. - [DYNAMIC_EXECUTION]: The skill demonstrates patterns for dynamically generating JavaScript for Automation (JXA) code. Methods such as
listNotes,createNote, andsearchNotesinterpolate variables directly into the JXA script string. For example, thesearchNotesmethod usesconst q = "${query}", which allows a malicious input to break out of the string literal and execute arbitrary JXA code. - [INDIRECT_PROMPT_INJECTION]: The skill establishes an attack surface where untrusted data (folder names, search queries, and note contents) is processed and passed to high-privilege execution tools.
- Ingestion points: Input parameters for
listNotes,createNote, andsearchNotesfunctions insrc/notes-client.ts. - Boundary markers: The skill includes textual instructions to treat inputs as data, but the provided code implementation lacks programmatic boundary markers or secure delimiters.
- Capability inventory: The skill utilizes
execSyncto interact with the macOS system via theosascripttool. - Sanitization: The sanitization logic is limited to a single character replacement and does not provide robust protection against script-level or shell-level injection.
Audit Metadata