T09 · Insecure Skill Coding Practices
Warning
- Location
- SKILL.md:104
- Finding
- Predictable Shared Temporary-File Paths<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md`, lines 104–105 **Vulnerability Type**: Predictable temporary-file usage **Risk Level**: Medium ### Vulnerable Code ```bash whisperkit-cli tts --text-file /tmp/llm-response.txt \ --output-path /tmp/voice-reply.m4a ``` The same insecure pattern also appears throughout `SKILL.md` at lines 56, 65, 68, 73, 90, 95, 101, 108, and 137–143. ### Technical Analysis The skill recommends fixed, predictable filenames in the globally shared `/tmp` directory for input and output. In multi-user or adversarial local environments, another process may pre-create these paths, substitute attacker-controlled files, or create symbolic links before the agent accesses them. The actual behavior depends on how `whisperkit-cli` opens files and on operating-system permissions. Nevertheless, the documented workflow does not require exclusive creation, verify file ownership, reject symbolic links, or isolate files in a private temporary directory. This creates opportunities for local race conditions, unauthorized reads, content replacement, and redirected writes. ### Attack Path 1. A local attacker predicts a documented path such as `/tmp/llm-response.txt` or `/tmp/voice-reply.m4a`. 2. Before the agent runs the command, the attacker creates that path as a file or symbolic link, or repeatedly replaces it in a race. 3. The agent invokes `whisperkit-cli` using the predictable path. 4. The CLI may read attacker-controlled text, overwrite an unintended writable target, or place generated audio where the attacker can retrieve or alter it. 5. Subsequent processing or attachment of the output may disclose or propagate manipulated content. ### Impact Assessment Exploitation is limited to the permissions of the account running the agent and generally requires local filesystem access. A successful attack could: - Disclose generated speech or source text. - Replace input with attacker-controlled content. - Tamper with audio subs ...[truncated 273 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions - Create a private temporary directory for every operation, for example with `mktemp -d`. - Set owner-only permissions, such as mode `0700` for the directory and `0600` for sensitive files. - Generate cryptographically unpredictable filenames instead of using fixed paths. - Open output files using exclusive-creation semantics and reject existing files. - Reject symbolic links or use platform APIs that prevent symlink following. - Verify ownership and file type before reading inputs or attaching outputs. - Remove temporary files and directories reliably after processing, including on errors or interruption. - Prefer a process API and securely opened file descriptors over shell-based temporary-file workflows. ]]>
