Back to skill

Security audit

Subtitle Generator

Security checks for vulnerabilities and agentic risk

Overview

This subtitle skill appears legitimate, but it needs Review because first use can automatically install unpinned packages into a persistent home-directory environment and trigger background notification behavior with limited user control.

Install only if you are comfortable with the skill creating and reusing ~/.whisper-venv, installing current package-index versions of Whisper-related dependencies, running long jobs in the background, and sending completion events through OpenClaw. Prefer a reviewed version that pins dependencies, asks before setup, uses private temp files, validates the venv, and narrows notification behavior.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
Findings (2)

T08 · Insecure Dependencies

Warning
Location
engines/__init__.py:104
Finding

Automatic Installation of Unpinned Third-Party Dependencies

Content
View full analysis

Vulnerability Details

File Location: requirements.txt:1-3; engines/__init__.py:104-115
Vulnerability Type: Supply-chain exposure through unpinned automatic dependency installation
Risk Level: Medium

Vulnerable Code

requirements.txt:1-3

text
faster-whisper
openai-whisper
ffmpeg-python

engines/__init__.py:104-115

python
# Step 3: Install requirements.txt
print("[Setup] Installing dependencies...")
try:
    result = subprocess.run(
        [str(pip_path), "install", "-r", str(requirements_path)],
        capture_output=True,
        text=True,
        timeout=600,
    )
    if result.returncode != 0:
        raise RuntimeError(f"Failed to install requirements: {result.stderr}")
    print("[Setup] Dependencies installed")

Technical Analysis

When neither ASR engine can be imported, the Skill automatically invokes pip to install dependencies from requirements.txt. The dependencies have no fixed versions or cryptographic hashes. Consequently, the package versions and transitive dependency graph can change without any modification to the reviewed Skill.

Python packages may execute code during installation, import, or normal runtime. Automatic installation therefore extends trust from the audited project to the latest package artifacts selected by the configured package index. A compromised future release, compromised transitive dependency, or unsafe package-index configuration could result in arbitrary code execution.

The environment readiness check also only verifies that pip list returns a nonempty package list. It does not verify the identities, versions, hashes, or integrity of the required packages.

Attack Path

  1. An attacker compromises a direct or transitive dependency distributed through the configured Python package index, or influences the package source used by pip.
  2. A user invokes the subtitle Skill on a system where the supported ...[truncated 889 chars]
Remediation
View remediation

Remediation Suggestions

  1. Pin exact versions for all direct dependencies and maintain a reviewed lock file containing the complete transitive dependency graph.
  2. Record cryptographic hashes for every accepted distribution and install with pip install --require-hashes.
  3. Use a controlled package repository or allowlisted internal mirror rather than relying implicitly on the user's package-index configuration.
  4. Do not install packages automatically during normal subtitle processing. Require an explicit, documented setup action and informed user approval.
  5. Verify required package names, versions, and hashes instead of treating any nonempty virtual environment as valid.
  6. Apply restrictive permissions to ~/.whisper-venv and reject environments owned by or writable by another user.
  7. Run dependency installation and model processing in an isolated, least-privileged environment where practical.
  8. Add automated dependency vulnerability and provenance scanning to the release process.

T09 · Insecure Skill Coding Practices

Warning
Location
subtitle/processor.py:22
Finding

Predictable Temporary Audio File Allows Collisions and Potential Symlink Overwrite

Content
View full analysis

Vulnerability Details

File Location: subtitle/processor.py:22-40, subtitle/processor.py:65, subtitle/processor.py:99-101
Vulnerability Type: Unsafe predictable temporary file handling
Risk Level: Medium

Vulnerable Code

subtitle/processor.py:22-40

python
def _extract_audio(self, video_path: Union[str, Path], output_audio: str = "audio.wav") -> Path:
    """Extract audio from video using ffmpeg."""
    import ffmpeg

    print(f"正在提取音频: {Path(video_path).name}")
    (
        ffmpeg
        .input(str(video_path))
        .output(
            output_audio,
            acodec='pcm_s16le',
            ac=self.DEFAULT_AUDIO_CHANNELS,
            ar=str(self.DEFAULT_AUDIO_SAMPLE_RATE),
        )
        .overwrite_output()
        .run(capture_stdout=True, capture_stderr=True)
    )
    return Path(output_audio)

subtitle/processor.py:65

python
audio_path = self._extract_audio(video_path)

subtitle/processor.py:99-101

python
finally:
    # Cleanup temp audio
    audio_path.unlink(missing_ok=True)

Technical Analysis

Every invocation uses the fixed relative filename audio.wav in the process's current working directory. The ffmpeg operation explicitly enables overwrite behavior. The code does not create a private temporary directory, generate a cryptographically unpredictable filename, or verify that the destination is a newly created regular file.

If the working directory is writable by another local user or process, an attacker can pre-create audio.wav, including as a symbolic link. Depending on platform and ffmpeg file-opening behavior, the extraction may follow the link and overwrite its writable target. The cleanup then removes the pathname used by the Skill rather than restoring overwritten target data.

Independent of symbolic-link exploitation, simultaneous Skill invocations use the same file. One process can overwrite or ...[truncated 1569 chars]

Remediation
View remediation

Remediation Suggestions

  1. Create a private temporary directory for each invocation with tempfile.TemporaryDirectory().
  2. Place the extracted audio inside that directory using a unique, unpredictable filename.
  3. Ensure the temporary directory is accessible only to the current user.
  4. Avoid using a fixed path in the current working directory.
  5. Where supported, reject symbolic links and validate that the created destination is a regular file owned by the current user.
  6. Pass the unique path directly to ffmpeg and remove the entire private temporary directory after transcription.
  7. Add tests covering concurrent processing and hostile pre-existing filesystem entries.
  8. Consider writing subtitle output atomically through a temporary file followed by a controlled rename to avoid partially written output.
Vulnerability Patterns
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
Findings (22)

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
92% confidence
Finding

The skill instructs the agent to execute shell commands and write/copy files, but it does not declare any explicit tool scope or allowed-tools boundary. This weakens policy enforcement and reviewability, making it easier for the skill to invoke broader capabilities than users or the platform expect.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The trigger list is very broad and includes generic English and Chinese phrases like 'subtitle', 'caption', and 'speech to text', increasing the chance of accidental activation in ordinary conversation. Misfires are more dangerous here because the skill can launch background shell execution, auto-install dependencies, and write files without an explicit, narrow invocation boundary.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill states that first use will automatically create a virtual environment and install dependencies, but this behavior is not surfaced as an explicit user warning in the skill description. Silent environment modification and package installation materially increase risk because they perform network/package actions and change the host state beyond simple subtitle generation.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The skill expands from subtitle generation into cross-platform user messaging by mandating use of a generic message tool with automatic channel routing. That adds an unrelated communication capability which could be abused for unsolicited messages, data leakage, or misleading notifications if the skill or downstream script is compromised.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The module prepends a home-directory virtual environment's site-packages to sys.path, then later reloads engine modules from that location. Trusting importable code from ~/.whisper-venv allows local persistence and code substitution: if an attacker can place or modify packages there, importing this skill can execute attacker-controlled Python code inside the agent process.

Content

No source excerpt is available for this finding.

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · engines/__init__.py (reported line 46)May include surrounding context.

python
def _check_venv_packages(pip_path: Path) -> bool:
    """Check if the venv has packages installed by running pip list."""
    try:
        result = subprocess.run(
            [str(pip_path), "list", "--format=json"],
            capture_output=True,
            text=True,

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The skill automatically creates a virtual environment and runs python/pip subprocesses on the host system as part of normal operation. That behavior enables unreviewed code execution paths, dependency fetching, and environment mutation, which is especially risky for an agent skill that may be triggered by user requests rather than an administrator-controlled setup phase.

Content

No source excerpt is available for this finding.

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
91% confidence
Finding

The code resolves python/python3 from the host PATH and executes it to create a virtual environment. If PATH is attacker-influenced or the runtime environment is shared, a malicious interpreter binary could be selected, causing arbitrary code execution on the host during skill setup.

Content

Scanner excerpt · engines/__init__.py (reported line 94)May include surrounding context.

python
python_cmd = shutil.which("python") or shutil.which("python3") or "python3"
        else:
            python_cmd = shutil.which("python3") or shutil.which("python") or "python3"
        result = subprocess.run(
            [python_cmd, "-m", "venv", str(venv_path)],
            capture_output=True,
            text=True,

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
96% confidence
Finding

This automatically invokes pip to install dependencies onto the host from requirements.txt, which can execute arbitrary code via dependency installation hooks or malicious packages. In a skill context, automatic package installation materially increases attack surface because simply using the skill can trigger host-side code execution and network-backed supply-chain exposure.

Content

Scanner excerpt · engines/__init__.py (reported line 109)May include surrounding context.

python
# Step 3: Install requirements.txt
    print("[Setup] Installing dependencies...")
    try:
        result = subprocess.run(
            [str(pip_path), "install", "-r", str(requirements_path)],
            capture_output=True,
            text=True,

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The code prints user-visible messages in Chinese at L33 and L44, which forces a specific language for user interaction. Under the policy, locale or language constraints should not be imposed unless the user is given a choice or the constraint is clearly documented and justified.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The code prints Chinese-only status messages at L33 and L47, which imposes a specific language on users without any opt-in or documented locale constraint. This is a natural-language policy issue because the skill does not provide a language selection mechanism or justify a Chinese-only interface.

Content

No source excerpt is available for this finding.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · SKILL.md (reported line 160)May include surrounding context.

md
"ffmpeg 未找到,请先安装 ffmpeg:\n"
            "  Windows: winget install ffmpeg  或  https://ffmpeg.org/download.html\n"
            "  macOS:  brew install ffmpeg\n"
            "  Linux:  sudo apt install ffmpeg  或  sudo yum install ffmpeg"
        )

# Add skills subtitle-generator to path for imports

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · scripts/main.py (reported line 45)May include surrounding context.

python
"ffmpeg 未找到,请先安装 ffmpeg:\n"
            "  Windows: winget install ffmpeg  或  https://ffmpeg.org/download.html\n"
            "  macOS:  brew install ffmpeg\n"
            "  Linux:  sudo apt install ffmpeg  或  sudo yum install ffmpeg"
        )

# Add skills subtitle-generator to path for imports

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

This subtitle skill contains logic to emit system events and wake another AI/session, which is unrelated to core transcription functionality. That creates an unnecessary side-effect channel that can be leveraged for covert signaling, automation chaining, or triggering external actions in environments where skills are expected to remain single-purpose.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The external agent/event invocation capability is unjustified for a subtitle-generation skill and violates least privilege. In context, the code is explicitly designed to wake a main session AI that may then send Telegram notifications, introducing an unnecessary bridge from file processing to external messaging/agent behavior.

Content

No source excerpt is available for this finding.

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
93% confidence
Finding

The skill invokes an external executable (openclaw) with user-influenced message content, which expands the skill’s capabilities beyond subtitle generation into agent/event triggering. Although subprocess.run is used without a shell, reducing classic command injection risk, this still creates a cross-component execution path that could be abused to trigger unintended actions or data exfiltration through the external event system.

Content

Scanner excerpt · scripts/main.py (reported line 63)May include surrounding context.

python
# Last resort: try common nvm path (Linux/WSL)
        openclaw_cmd = str(Path.home() / ".nvm/versions/node/v24.14.0/bin/openclaw")
    try:
        result = subprocess.run(
            [openclaw_cmd, "system", "event", "--text", message, "--mode", "now"],
            capture_output=True,
            text=True,

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

Multiple user-facing strings and exceptions are hardcoded in Chinese, including status output and error messages. This imposes a specific language/locale on users without offering a choice or documenting a justified region-specific constraint, which matches the language policy violation criteria.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Low
Category
Not specified by scanner
Confidence
83% confidence
Finding

These lines require calling openclaw system event --mode now to wake the AI after background execution completes. Triggering system events is an orchestration/control-plane capability rather than a direct subtitle-generation function, and the manifest does not indicate such system-interaction behavior as part of the skill's purpose.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
96% confidence
Finding

The dependency 'faster-whisper' is unpinned, so installs may pull different versions over time, including versions with newly introduced vulnerabilities, breaking changes, or malicious supply-chain compromises. In a subtitle-generation skill that processes user-provided media, dependency drift increases risk because widely used ML and media packages can have significant transitive dependency trees and native components.

Content

Scanner excerpt · requirements.txt (reported line 1)May include surrounding context.

text
faster-whisper
openai-whisper
ffmpeg-python

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
96% confidence
Finding

The dependency 'openai-whisper' is unpinned, which makes builds non-reproducible and exposes the environment to unexpected upstream changes or compromised releases. Because this skill performs speech-to-text on potentially untrusted audio/video content, relying on floating package versions can amplify exposure through vulnerable parsing, model-loading, or transitive package behavior.

Content

Scanner excerpt · requirements.txt (reported line 2)May include surrounding context.

text
faster-whisper
openai-whisper
ffmpeg-python

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
97% confidence
Finding

The dependency 'ffmpeg-python' is unpinned, allowing uncontrolled upgrades to a library that interfaces with media-processing workflows. This is especially relevant in a subtitle/media skill because media tooling often handles complex, attacker-controlled file formats, so accepting arbitrary dependency versions increases the chance of inheriting vulnerable or incompatible behavior.

Content

Scanner excerpt · requirements.txt (reported line 3)May include surrounding context.

text
faster-whisper
openai-whisper
ffmpeg-python

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
89% confidence
Finding

The user-facing usage text and examples include Chinese parameter labels and notification descriptions alongside English text, which effectively assumes Chinese comprehension for part of the interface. The file does not state that this is a region-specific tool or offer an explicit language/locale choice.

Content

No source excerpt is available for this finding.