T09 · Insecure Skill Coding Practices
- Location
transcribe.py:75- Finding
Predictable Shared Temporary File Enables File Clobbering and Audio Disclosure
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This is a coherent offline transcription skill, but its temporary audio handling can expose or overwrite local files in some environments.
Install only if you are comfortable with local processing of audio files and the current temporary-file risk. Avoid using it for sensitive recordings or on shared/multi-user machines until the script uses a private unique temporary directory and reliable cleanup.
transcribe.py:75Predictable Shared Temporary File Enables File Clobbering and Audio Disclosure
The skill clearly instructs use of shell execution and environment variables, but it does not declare any explicit tool scope or permissions. That weakens containment and reviewability because an agent may invoke shell-capable behavior without a narrowly declared boundary, increasing the chance of unintended command execution or broader system access.
The description says to use the skill whenever a user sends a voice message, audio file, or asks to transcribe speech to text, which is broad enough to trigger on many normal conversations without strong gating. In an agent setting, overly broad invocation criteria can cause automatic processing of user files or paths with insufficient confirmation, raising privacy and misuse risks.
Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.
mkdir -p ~/.vosk/models && cd ~/.vosk/models
# Chinese (small, fast)
curl -LO https://alphacephei.com/vosk/models/vosk-model-small-cn-0.22.zip
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
missing.append("vosk (pip install vosk)")
try:
subprocess.run(["ffmpeg", "-version"], capture_output=True, check=True)
except (subprocess.CalledProcessError, FileNotFoundError):
missing.append("ffmpeg (brew install ffmpeg)")
The model selection logic explicitly prefers Chinese models first, and the setup instructions likewise present the Chinese model as the default recommendation. This imposes a language/locale choice on users without offering an explicit opt-in or selection mechanism.
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
"-f", "wav",
output_file
]
result = subprocess.run(cmd, capture_output=True, text=True)
if result.returncode != 0:
raise RuntimeError(f"FFmpeg error: {result.stderr}")
return output_file
Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.
convert_to_wav(audio_file, temp_wav)
wf = wave.open(temp_wav, "rb")
# Create recognizer
rec = KaldiRecognizer(model, wf.getframerate())
rec.SetWords(True)
The skill does not prominently warn users that supplied voice messages and audio files will be locally decoded, converted, and transcribed. While local processing is better than remote exfiltration, the absence of a user-facing notice can still lead to unexpected handling of sensitive audio content and metadata.