T09 · Insecure Skill Coding Practices
- Location
scripts/speak.sh:23- Finding
Predictable Temporary Files Permit Symlink-Based File Overwrite
- Content
View full analysis
/dev/null ``` ### Technical Analysis The script constructs temporary filenames directly under `/tmp` using only the current process ID. Process IDs are observable and sufficiently predictable on multi-user systems. The script does not atomically reserve these files before `curl` and `ffmpeg` write to them. An attacker with local access can pre-create a matching path as a symbolic link or race the script between path selection and file creation. Depending on ownership and operating-system protections, the write operation may follow the link and overwrite another file writable by the Skill's invoking account. At minimum, pre-created paths can interfere with processing and cause denial of service. Shell quoting prevents command injection through these variables, but it does not protect against filesystem race conditions or symbolic links. ### Attack Path 1. A local attacker monitors process creation or predicts the process ID that will execute `speak.sh`. 2. The attacker creates `/tmp/qwen_tts_.wav` or `/tmp/qwen_tts_.ogg` before the script writes to it. 3. The path is made a symbolic link to a target file, or an incompatible file is placed there to disrupt execution. 4. `curl` or `ffmpeg` accesses the attacker-controlled path. 5. If the target is writable by the invoking user and platform protections permit following the link, its contents may be overwritten. Otherwise, the operation fails, resulting in denial of service. ### Impact Assessment Successful exploitation can overwrite files accessible t ...[truncated 318 chars]- Remediation
View remediation
