T09 · Insecure Skill Coding Practices
- Location
scripts/transcribe.sh:16- Finding
Predictable Temporary File Paths Permit Symlink-Based File Overwrite
- Content
View full analysis
/dev/null || echo piper)}" echo "$TEXT" | "$PIPER_BIN" -m "$MODEL" "${CONFIG_ARGS[@]}" -f "$OUTPUT" 2>/dev/null echo "$OUTPUT" ``` `SKILL.md:135-137`: ```bash RESPONSE="Deployment complete. All checks passed." WAV=$(bash path/to/voiceclaw/scripts/speak.sh "$RESPONSE" /tmp/reply_$$.wav) ffmpeg -i "$WAV" -c:a libopus -b:a 32k /tmp/reply_$$.ogg -y -loglevel error ``` ### Technical Analysis The scripts and documented integration example construct files directly in the shared `/tmp` directory using the process ID (`$$`). Process IDs are observable or predictable, and these paths are not reserved through an atomic, exclusive file-creation operation. A local attacker can create a symbolic link at the expected path before the victim process writes to it. The transcription command explicitly uses `ffmpeg -y`, allowing replacement of an existing destination. Depending on the behavior of Piper and `ffmpeg`, the write can follow the symbolic link and modify its target. The transcription cleanup trap removes the predictable path but does not prevent the race or verify that the path is a regular file owned by the current process. The speech script does not clean up its default output at all because ...[truncated 1408 chars]- Remediation
View remediation
