T08 · Insecure Dependencies
- Location
generate_subtitles.py:14- Finding
Unpinned dependencies and unsafe privileged installation guidance
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill mostly does what it says, but it needs review because it encourages unsafe privileged package installation and can send subtitle text to third-party TTS services without a clear privacy warning.
Review before installing. Use an isolated virtual environment with pinned dependencies, do not follow the sudo pip3 --break-system-packages instruction, avoid running this as root, and only use ElevenLabs or Edge TTS with subtitle text you are comfortable sending to those providers. Be cautious on shared machines because the tool uses predictable temporary paths under /tmp.
generate_subtitles.py:14Unpinned dependencies and unsafe privileged installation guidance
replace.py:121Predictable shared temporary files permit symlink attacks and cross-process interference
The supplied code chunk implements only the subtitle-generation portion of the declared description. It loads a Whisper model, transcribes the input video, formats segment timestamps, and outputs an .srt file. It does not perform the skill's primary declared behavior of replacing video audio with synthesized speech, nor does it call ElevenLabs or Edge TTS, modify video/audio tracks, align generated speech to the original audio timing in the described way, adjust speed, or insert silence. Because the declared purpose presents a broader dubbing/TTS pipeline while this code only handles subtitle generation, the description does not accurately represent what this code chunk actually does.
Most of the declared audio-replacement behavior is accurately represented: the script takes a video and subtitle file, generates TTS with ElevenLabs or Edge, aligns each segment to subtitle timestamps, adjusts speed using ffmpeg atempo with a user-supplied range, adds silence, concatenates segments, and muxes the new audio into the video. However, the description also claims 'Includes subtitle generation from video using Whisper,' which is a material declared capability not implemented here. The script requires --srt as an input and contains no Whisper import, transcription logic, or subtitle extraction from the video. This is a description-behavior mismatch due to a missing declared feature, though there are no obvious undeclared unrelated or malicious capabilities.
The skill documents capabilities that imply shell execution, file reads/writes, environment-variable access, and network use, but it does not declare any tool scope or permission boundaries. In an agent environment, that omission weakens least-privilege controls and can allow broader-than-expected access when processing user-supplied video, subtitles, and API credentials.
The skill encourages use of ElevenLabs or Edge TTS without clearly warning that subtitle text derived from the user's video may be transmitted to third-party services. Because subtitles can contain sensitive spoken content, users may unknowingly disclose private, proprietary, or regulated information to external providers.
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
from faster_whisper import WhisperModel
except ImportError:
print("Error: faster-whisper not installed.")
print("Install with: sudo pip3 install faster-whisper --break-system-packages")
sys.exit(1)
The skill description says it includes subtitle generation from video using Whisper, which implies code that transcribes the video audio into subtitles. In this file, the CLI requires an existing --srt input and there is no Whisper import, invocation, or transcription logic anywhere; the implementation only replaces audio based on provided subtitles.
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
def get_duration(filepath):
"""Get audio/video duration in seconds"""
result = subprocess.run(
["ffprobe", "-v", "error", "-show_entries", "format=duration",
"-of", "default=noprint_wrappers=1:nokey=1", filepath],
capture_output=True, text=True
Subtitle text is transmitted to a third-party TTS provider, which may contain sensitive or copyrighted content, without any prominent warning, consent flow, or privacy guardrails. In a media-processing skill, users may reasonably expect local transformation unless cloud transmission is made explicit, so the context increases the privacy risk.
The hardcoded ElevenLabs endpoint confirms that this tool relies on a third-party service for some processing, which creates a privacy and data-governance risk when handling subtitle text. The danger is contextual rather than malicious: users may unknowingly send content off-device.
def generate_elevenlabs(text, output_path, voice_id, api_key):
"""Generate audio using ElevenLabs API"""
url = f"https://api.elevenlabs.io/v1/text-to-speech/{voice_id}"
headers = {
"Accept": "audio/mpeg",
"Content-Type": "application/json",
This code sends subtitle contents to an external API over the network, which is a real data-exposure event. While this is part of the feature, it becomes security-relevant because the transmitted text may include sensitive content and the skill does not appear to enforce explicit consent or minimization.
"voice_settings": {"stability": 0.5, "similarity_boost": 0.75}
}
response = requests.post(url, json=data, headers=headers)
if response.status_code == 200:
with open(output_path, 'wb') as f:
f.write(response.content)
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
def extract_original_audio(video_file, output_file):
"""Extract audio from video"""
subprocess.run([
"ffmpeg", "-y", "-i", video_file, "-vn", "-acodec", "mp3",
"-ar", "44100", "-ac", "1", output_file
], capture_output=True)
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
def split_audio(audio_file, start_time, duration, output_file):
"""Split audio file from start_time for duration"""
subprocess.run([
"ffmpeg", "-y", "-i", audio_file, "-ss", str(start_time),
"-t", str(duration), "-vn", "-acodec", "mp3", output_file
], capture_output=True)
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
def adjust_speed(input_file, output_file, speed_ratio):
"""Adjust audio speed using atempo"""
subprocess.run([
"ffmpeg", "-y", "-i", input_file, "-filter:a", f"atempo={speed_ratio}",
"-vn", output_file
], capture_output=True)
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
def add_silence(duration, output_file):
"""Generate silence audio"""
subprocess.run([
"ffmpeg", "-y", "-f", "lavfi", "-i", f"anullsrc=r=44100:cl=mono",
"-t", str(duration), "-q:a", "9", output_file
], capture_output=True)
The concat list is written using raw file paths into ffmpeg's concat demuxer format with -safe 0, but paths are not escaped or validated. If an attacker can influence file names written into the list, specially crafted names containing quotes or concat directives could alter ffmpeg's interpretation, causing unintended file access or processing behavior.
for file in files:
f.write(f"file '{file}'\n")
subprocess.run([
"ffmpeg", "-y", "-f", "concat", "-safe", "0", "-i", concat_list,
"-c", "copy", output_file
], capture_output=True)
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
silence_file = audio_file + ".silence.mp3"
add_silence(silence_duration, silence_file)
subprocess.run([
"ffmpeg", "-y", "-i", audio_file, "-i", silence_file,
"-filter_complex", "[0:a][1:a]concat=n=2:v=0:a=1[out]",
"-map", "[out]", output_file
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
def replace_video_audio(video_file, audio_file, output_file):
"""Replace video audio with new audio"""
subprocess.run([
"ffmpeg", "-y", "-i", video_file, "-i", audio_file,
"-c:v", "copy", "-c:a", "aac", "-b:a", "192k",
"-map", "0:v:0", "-map", "1:a:0",
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
silence_file = f"{temp_dir}/end_silence.mp3"
add_silence(silence_needed, silence_file)
subprocess.run([
"ffmpeg", "-y", "-i", merged_audio, "-i", silence_file,
"-filter_complex", "[0:a][1:a]concat=n=2:v=0:a=1[out]",
"-map", "[out]", final_audio
The manifest focuses on replacing video audio and generating subtitles, but does not mention reading secrets from environment variables or credential-dependent operation. Accessing ELEVENLABS_API_KEY introduces a credential-handling capability beyond the core local media-processing purpose unless the manifest explicitly scopes external authenticated TTS use.
No suspicious patterns detected.