Back to skill

Security audit

faster-whisper 中文版 - 高性能本地语音转文字工具

Security checks for vulnerabilities and agentic risk

Overview

This speech-to-text skill is mostly purpose-aligned, but its batch script can execute unintended shell commands from crafted filenames or options, and it forces a third-party model mirror without clear opt-in.

Review before installing. Avoid running the batch script on directories containing untrusted filenames until eval is removed, prefer the single-file transcribe.py path for trusted inputs, use the official Hugging Face endpoint unless you intentionally trust the mirror, and pin dependencies for reproducible installs.

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 (3)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/batch_transcribe.sh:150
Finding

Arbitrary Command Injection Through Batch Transcription Arguments and Filenames

Content
View full analysis
/dev/null; then echo " ✓ 完成: $output_file" SUCCESS_COUNT=$((SUCCESS_COUNT + 1)) else ``` ### Technical Analysis The script builds a shell command as a string using values derived from command-line arguments and audio filenames. It subsequently passes that string to `eval`, which causes the shell to parse all embedded content a second time. The apparent double quotes embedded in `cmd` do not provide a security boundary after attacker-controlled data has already been concatenated into the command string. Shell metacharacters, command substitutions, escaped quotation marks, or separators present in values such as `MODEL`, `LANGUAGE`, `OUTPUT_DIR`, or `audio_file` can become executable shell syntax during the `eval` operation. The affected inputs include: - Model names supplied through `--model` - Language values supplied through `--language` - Device and compute-type values - Output-directory-derived filenames - Audio filenames discovered in the input directory ### Attack Path 1. An attacker creates an audio file with a filename containing shell syntax, or convinces a user to invoke the batch script with a malicious option value. 2. The script accepts the value without restricting it to a safe character set. 3. The value is interpolated into the `cmd` string. 4. `eval "$cmd"` reparses the attacker-controlled content as shell ...[truncated 924 chars]
Remediation
View remediation
/dev/null; then echo " ✓ Complete: $output_file" else echo " ✗ Failed: $filename" fi ``` Additional hardening should include: 1. Validate `MODEL` and `LANGUAGE` against explicit allowlists where practical. 2. Validate `DEVICE` and `COMPUTE_TYPE` against the choices accepted by `transcribe.py`. 3. Use `--` before positional filenames where supported to prevent filenames beginning with a hyphen from being interpreted as options. 4. Add regression tests using filenames containing spaces, quotation marks, semicolons, command substitutions, and newline characters. 5. Do not replace `eval` with an unquoted string expansion; only direct array execution reliably preserves argument boundaries. ]]>

T08 · Insecure Dependencies

Warning
Location
requirements.txt:1
Finding

Unpinned Python Dependencies Permit Unreviewed Supply-Chain Changes

Content
View full analysis
=1.2.0 ``` Relevant installation behavior from `setup.sh`: ```bash if command -v uv &> /dev/null; then uv pip install --python "$VENV_DIR/bin/python" -r "$SCRIPT_DIR/requirements.txt" else "$VENV_DIR/bin/pip" install --upgrade pip "$VENV_DIR/bin/pip" install -r "$SCRIPT_DIR/requirements.txt" fi # 根据平台安装 PyTorch if [ "$HAS_CUDA" = true ]; then if command -v uv &> /dev/null; then uv pip install --python "$VENV_DIR/bin/python" torch --index-url https://download.pytorch.org/whl/cu121 else "$VENV_DIR/bin/pip" install torch --index-url https://download.pytorch.org/whl/cu121 fi elif [ "$OS_TYPE" = "macos" ]; then if command -v uv &> /dev/null; then uv pip install --python "$VENV_DIR/bin/python" torch else "$VENV_DIR/bin/pip" install torch fi fi ``` ### Technical Analysis The `faster-whisper` requirement specifies only a lower bound and does not impose an upper bound, exact version, or package hash. PyTorch is installed without any version pin. Transitive dependencies are also not locked. Consequently, two installations of the same reviewed Skill version can retrieve and execute different dependency versions. Package installation and later Python imports execute code supplied by these dependencies. The effective trusted codebase can therefore change without any corresponding modification to the audited project. This does not prove that the current upstream packages are malicious. The vulnerability is the absence of reproducible dependency constraints and integrity controls, which leaves the installation exposed to a compromised release, malicious dependency takeover, or unexpectedly unsafe fu ...[truncated 1071 chars]
Remediation
View remediation
``` 2. Pin PyTorch to an exact platform-compatible version in `setup.sh` or separate platform lockfiles. 3. Generate reviewed lockfiles containing all transitive dependencies. 4. Require package hashes during installation, such as through `pip install --require-hashes`. 5. Separate CUDA, CPU, and macOS dependency sets so each platform has a reproducible resolution. 6. Prevent automatic dependency upgrades during normal setup. Update dependencies through a controlled process that includes vulnerability scanning and code review. 7. Pin or explicitly constrain build-system dependencies as well as runtime dependencies. 8. Run setup without elevated privileges and keep the virtual environment isolated from system Python. ]]>

T08 · Insecure Dependencies

Warning
Location
scripts/batch_transcribe.sh:111
Finding

Batch Processing Unconditionally Trusts a Third-Party Model Mirror

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • 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
Findings (19)

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
91% confidence
Finding

The skill documentation instructs users to run shell commands and references scripts that can write files, but it does not declare any explicit tool scope such as allowed-tools or permissions. This creates a mismatch between declared and actual capabilities, which weakens policy enforcement and increases the chance the skill is invoked with broader powers than users or the platform expect.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The trigger terms include very broad phrases like 'whisper' and generic speech-to-text requests, which can cause the skill to activate in unrelated contexts. Over-broad activation is dangerous because it may cause unintended shell execution, model downloads, or file processing when the user did not clearly request this specific skill.

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 145)May include surrounding context.

  1. ffmpeg 未找到
    bash
    # Ubuntu/Debian
    sudo apt install ffmpeg
    
    # macOS
    brew install ffmpeg
    

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 151)May include surrounding context.

  1. ffmpeg 未找到
    bash
    # Ubuntu/Debian
    sudo apt install ffmpeg
    
    # macOS
    brew install ffmpeg
    

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The script hard-codes LANGUAGE="zh" as the default, which imposes a specific language setting unless the user explicitly overrides it. This is a natural-language locale policy issue because the file does not present a user choice first or justify the locale restriction as region-specific.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The script unconditionally overrides Hugging Face access to use an external mirror (HF_ENDPOINT=https://hf-mirror.com), causing a supposedly local transcription tool to make network-dependent model fetches through a third-party service. This expands the trust boundary, can leak usage metadata, and creates supply-chain risk if the mirror serves tampered or outdated model artifacts.

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 · setup.sh (reported line 49)May include surrounding context.

sh
if [ "$OS_TYPE" = "macos" ]; then
        echo "   brew install ffmpeg"
    else
        echo "   Ubuntu/Debian: sudo apt install ffmpeg"
        echo "   Fedora: sudo dnf install ffmpeg"
        echo "   Arch: sudo pacman -S ffmpeg"
        echo "   CentOS/RHEL: sudo yum install ffmpeg"

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 · setup.sh (reported line 50)May include surrounding context.

sh
if [ "$OS_TYPE" = "macos" ]; then
        echo "   brew install ffmpeg"
    else
        echo "   Ubuntu/Debian: sudo apt install ffmpeg"
        echo "   Fedora: sudo dnf install ffmpeg"
        echo "   Arch: sudo pacman -S ffmpeg"
        echo "   CentOS/RHEL: sudo yum install ffmpeg"

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 · setup.sh (reported line 51)May include surrounding context.

sh
if [ "$OS_TYPE" = "macos" ]; then
        echo "   brew install ffmpeg"
    else
        echo "   Ubuntu/Debian: sudo apt install ffmpeg"
        echo "   Fedora: sudo dnf install ffmpeg"
        echo "   Arch: sudo pacman -S ffmpeg"
        echo "   CentOS/RHEL: sudo yum install ffmpeg"

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 · setup.sh (reported line 52)May include surrounding context.

sh
if [ "$OS_TYPE" = "macos" ]; then
        echo "   brew install ffmpeg"
    else
        echo "   Ubuntu/Debian: sudo apt install ffmpeg"
        echo "   Fedora: sudo dnf install ffmpeg"
        echo "   Arch: sudo pacman -S ffmpeg"
        echo "   CentOS/RHEL: sudo yum install ffmpeg"

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
78% confidence
Finding

The README highlights Chinese optimization and a default language of Chinese, which can be acceptable for a localized skill, but the presentation does not clearly frame this as a user-chosen locale preference at the top level. Although later examples mention other language options, the introductory language could be read as enforcing a locale by default rather than requesting user choice.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

The README instructs users to set HF_ENDPOINT to a third-party Hugging Face mirror, which causes model downloads to traverse an alternate network endpoint without any explicit notice about privacy, integrity, or trust implications. While this is common for performance/access reasons, users are not warned that requests, metadata, and downloaded artifacts may be subject to the mirror operator's logging, availability, or tampering risks.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

Although the document mentions model download near the end, the skill description and primary usage path do not clearly warn users before first use that large model files may be fetched over the network. This can surprise users with bandwidth use, storage consumption, and external network access, which is especially sensitive in restricted or privacy-conscious environments.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

The manifest sets the skill language to "zh-CN", and the description/tags also indicate a Chinese-only experience. In this file there is no natural-language indication that users may choose another language or that the locale restriction is optional, which can violate the policy against forcing a specific language without opt-in.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

The configuration sets DEFAULT_LANGUAGE="zh" as the default, which imposes a specific language choice rather than leaving detection automatic or requiring user selection. This is a natural-language locale policy concern because the file does not present the language as an opt-in default for all users.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

This requirements file includes all explanatory comments only in Chinese, with no indication that the language is optional or justified by a region-specific constraint. That can violate a language/locale policy when users or maintainers are not given a choice or opt-in.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
90% confidence
Finding

The dependency is only lower-bounded (faster-whisper>=1.2.0), which allows future unreviewed versions to be installed. This can introduce supply-chain risk, unexpected breaking changes, or vulnerable upstream releases into the skill environment, especially because this is a local transcription tool that may process untrusted audio inputs and native ML dependencies.

Content

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

text
# 核心依赖 — PyTorch 由安装脚本单独安装(如果检测到 GPU 则安装 CUDA 版本)
faster-whisper>=1.2.0

# 注意:PyTorch 将在 setup.sh 中根据硬件环境自动安装:
# - NVIDIA GPU: 安装 CUDA 版本的 PyTorch

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
82% confidence
Finding

The CLI defaults --language to zh, and the surrounding help/examples are written as if Chinese is the expected default behavior. This is a natural-language locale choice imposed unless the user explicitly overrides it, which can violate language/locale policy when no opt-in or neutral default is provided.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
96% confidence
Finding

This shell script presents all user-facing messages, installation guidance, and examples in Chinese only. That creates a natural-language locale policy concern because the skill forces a specific language without offering the user an explicit language choice or documenting a justified regional constraint.

Content

No source excerpt is available for this finding.