T09 · Insecure Skill Coding Practices
- Location
SKILL.md:31- Finding
Predictable Shared Temporary File Exposes Audio and Enables File Clobbering
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, line 31
Vulnerability Type: Predictable temporary-file usage
Risk Level: MediumVulnerable Code:
bash ffmpeg -y -i input_audio.ogg -ar 16000 -ac 1 -f wav /tmp/voice.wavTechnical Analysis
The transcription workflow writes audio to the fixed path
/tmp/voice.wav. Because/tmpis commonly shared by multiple local users and processes, the predictable filename creates race-condition and symbolic-link risks. The-yoption directs FFmpeg to overwrite an existing destination without confirmation.A local attacker may pre-create
/tmp/voice.wavas a symbolic link to another file. If the user running FFmpeg has permission to modify the linked target, FFmpeg may overwrite that target. Concurrent transcription processes may also overwrite or consume one another's audio. Furthermore, the instructions do not remove the temporary file after transcription, potentially leaving sensitive voice data accessible beyond its intended lifetime.Attack Path
- A local attacker predicts that the documented workflow will use
/tmp/voice.wav. - Before the workflow starts, the attacker creates a symbolic link or competing file at that path.
- The operator executes the documented FFmpeg command.
- Because
-ypermits unconditional replacement, FFmpeg writes through the prepared path where operating-system permissions allow it. - A linked target may be corrupted, or attacker-controlled audio may be substituted and subsequently transcribed.
- If no attacker intervenes, the generated audio may nevertheless remain in
/tmpand expose sensitive speech to other processes or users where local permissions permit access.
Impact Assessment
Exploitation does not independently grant elevated privileges; its effect is bounded by the filesystem permissions of the user executing FFmpeg. Within those permissions, it may enable unintended file replacement, workf ...[truncated 198 chars]
- A local attacker predicts that the documented workflow will use
- Remediation
View remediation
Remediation Suggestions
- Create a unique, private temporary directory with
mktemp -drather than using a fixed shared filename. - Apply restrictive permissions with
umask 077. - Register a shell cleanup trap so temporary audio is removed on successful completion, failure, or interruption.
- Ensure the destination is newly created and cannot be resolved through an existing symbolic link.
- Quote all paths to prevent parsing problems.
Example hardened workflow:
bash umask 077 tmpdir="$(mktemp -d)" || exit 1 trap 'rm -rf -- "$tmpdir"' EXIT HUP INT TERM voice_file="$tmpdir/voice.wav" ffmpeg -nostdin -i input_audio.ogg -ar 16000 -ac 1 -f wav "$voice_file" && ~/whisper.cpp/build/bin/whisper-cli \ -m ~/whisper.cpp/models/ggml-large-v3.bin \ -f "$voice_file" \ -l auto \ --no-timestamps- Create a unique, private temporary directory with
