Back to skill

Security audit

Audio Video To Text

Security checks for vulnerabilities and agentic risk

Overview

This is a coherent transcription skill with local security and privacy cautions, but no artifact-backed evidence of malicious behavior.

Install this in a virtual environment, avoid running package installation as root unless necessary, and be careful with confidential recordings. On shared machines, fix or avoid the predictable /tmp/audio_extract.wav workflow before processing video, especially when using --keep-audio.

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)

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/transcribe.py:62
Finding
Predictable Shared Temporary Audio File Enables Symlink and Race Attacks## Vulnerability Details **File Location**: `scripts/transcribe.py`, lines 62-74; usage and cleanup at lines 209 and 226-230 **Vulnerability Type**: Predictable and insecure temporary-file handling **Risk Level**: Medium ### Vulnerable Code ```python def extract_audio(input_file, temp_audio="/tmp/audio_extract.wav"): """从视频文件中提取音频""" try: subprocess.run([ "ffmpeg", "-i", input_file, "-vn", "-acodec", "pcm_s16le", "-ar", "16000", "-ac", "1", "-y", temp_audio ], check=True, capture_output=True) return temp_audio except subprocess.CalledProcessError as e: print(f"音频提取失败:{e.stderr.decode()}") sys.exit(1) ``` The predictable path is used and later removed as follows: ```python audio_file = extract_audio(args.input) ``` ```python finally: # 清理临时文件 if audio_file != args.input and not args.keep_audio: try: os.remove(audio_file) except: pass ``` ### Technical Analysis Every video transcription writes extracted audio to the fixed path `/tmp/audio_extract.wav`. Shared temporary directories are writable by other local users, and a predictable filename provides no isolation between processes. The `-y` option instructs FFmpeg to overwrite the destination without prompting. The script does not securely create the file, verify its ownership, reject symbolic links, or ensure that it belongs to the current invocation. This creates the following security conditions: - A local attacker can pre-create the path as a symbolic link to another file writable by the victim. - Concurrent invocations can overwrite, transcribe, or remove each other's temporary audio. - An attacker can race file creation or replacement between extraction, transcription, and cleanup. - When `--keep-audio` is used, sensitive speech remains at a known path that may be accessible to ...[truncated 1969 chars]
Remediation
## Remediation Suggestions - Use `tempfile.TemporaryDirectory()` to create a private, uniquely named directory for each invocation. - Generate the extracted-audio path inside that directory rather than using a fixed global path. - Ensure the temporary directory and files are accessible only to the current user. - Manage cleanup through a context manager so it executes reliably on success and failure. - Do not suppress cleanup exceptions indiscriminately; report failures without exposing sensitive paths unnecessarily. - If retained audio is required, require an explicit destination rather than retaining it under a predictable shared path. - Consider verifying that any destination is a regular file owned by the current user and is not a symbolic link. Example hardening pattern: ```python import tempfile from pathlib import Path with tempfile.TemporaryDirectory(prefix="transcribe-") as temp_dir: audio_file = str(Path(temp_dir) / "audio.wav") extract_audio(args.input, audio_file) result = transcribe( audio_file, model_name=args.model, language=args.language, device=args.device ) format_output(result, args.output_format, output_file) ``` If `--keep-audio` must be supported, copy the completed audio to a user-selected path only after transcription and apply restrictive permissions.

T08 · Insecure Dependencies

Note
Location
SKILL.md:23
Finding
Unpinned Third-Party Dependencies Create a Supply-Chain Risk## Vulnerability Details **File Location**: `SKILL.md`, line 23; dependency imports and checks in `scripts/transcribe.py`, lines 17 and 26-35 **Vulnerability Type**: Unpinned and unhashed third-party dependencies **Risk Level**: Low ### Vulnerable Code The installation instructions resolve unrestricted package versions: ```bash pip install openai-whisper ffmpeg-python ``` The script then relies on those packages: ```python try: import whisper except ImportError: missing.append("openai-whisper") try: import ffmpeg except ImportError: missing.append("ffmpeg-python") ``` ### Technical Analysis The project does not provide a pinned requirements file, lock file, integrity hashes, or an explicitly trusted package index. Following the documented command therefore installs whatever versions the configured Python package index resolves at installation time. Python packages can execute build and installation logic, and their imported modules execute with the permissions of the user running the Skill. Mutable dependency resolution also makes installations non-reproducible: a version installed after the audit may differ materially from the version reviewed or tested. No evidence was found that the named dependencies are currently malicious, misspelled, or retrieved from a known unsafe source. The confirmed issue is the absence of version and integrity controls, which exposes users to upstream compromise, unexpected releases, compromised package-index configuration, or dependency substitution. ### Attack Path 1. A user follows the documented installation command. 2. `pip` queries the user's configured package index or mirror without project-enforced version or hash constraints. 3. The index resolves a compromised, malicious, or incompatible release of one of the dependencies or its transitive dependencies. 4. Package build or installation code executes during installation, or malicious modu ...[truncated 1105 chars]
Remediation
## Remediation Suggestions - Provide a reviewed `requirements.txt`, lock file, or equivalent dependency manifest with exact versions. - Include package hashes and require hash verification, for example through `pip install --require-hashes -r requirements.txt`. - Pin transitive dependencies through a generated lock file rather than constraining only direct dependencies. - Document the expected trusted package index and avoid uncontrolled extra indexes. - Test and periodically update pinned versions through a controlled dependency-review process. - Run installation and execution in an isolated virtual environment with least privilege. - Add automated dependency vulnerability and provenance scanning to the release workflow. - Document that Whisper model loading may download model artifacts on first use and establish an integrity and caching policy for those artifacts.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (9)

Lp3

Medium
Category
MCP Least Privilege
Confidence
89% confidence
Finding
The skill documents shell commands and an output file workflow but does not declare any tool scope such as shell or file-write permissions. This creates an authorization and transparency gap: an agent or reviewer cannot easily determine what capabilities the skill expects, which can lead to overbroad execution or unsafe deployment assumptions.

Missing User Warnings

Medium
Confidence
94% confidence
Finding
The skill processes potentially sensitive audio/video content but does not warn users about privacy implications, including that media may be sent to external model services, downloaded model backends, or otherwise processed in ways that expose personal or confidential information. Users may unknowingly submit meetings, interviews, or recordings containing regulated or private data without informed consent.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Content
确保系统已安装 ffmpeg:
```bash
# Ubuntu/Debian
sudo apt-get install ffmpeg

# macOS
brew install ffmpeg
Confidence
70% confidence
Finding
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

subprocess module call

Medium
Category
Dangerous Code Execution
Content
# 检查 ffmpeg 是否安装
    try:
        subprocess.run(["ffmpeg", "-version"], capture_output=True, check=True)
    except (subprocess.CalledProcessError, FileNotFoundError):
        print("错误:ffmpeg 未安装")
        print("请安装 ffmpeg:")
Confidence
70% confidence
Finding
subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Content
except (subprocess.CalledProcessError, FileNotFoundError):
        print("错误:ffmpeg 未安装")
        print("请安装 ffmpeg:")
        print("  Ubuntu/Debian: sudo apt-get install ffmpeg")
        print("  macOS: brew install ffmpeg")
        print("  Windows: 从 https://ffmpeg.org/download.html 下载")
        sys.exit(1)
Confidence
70% confidence
Finding
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Missing User Warnings

Medium
Confidence
97% confidence
Finding
The script writes extracted audio to a predictable fixed path (/tmp/audio_extract.wav) and forces overwrite with -y. On multi-user systems, this creates a race/symlink attack surface where an attacker can pre-create or replace that path, potentially causing unintended file overwrite or exposing transcription input/output across users.

subprocess module call

Medium
Category
Dangerous Code Execution
Content
def extract_audio(input_file, temp_audio="/tmp/audio_extract.wav"):
    """从视频文件中提取音频"""
    try:
        subprocess.run([
            "ffmpeg", "-i", input_file,
            "-vn", "-acodec", "pcm_s16le",
            "-ar", "16000", "-ac", "1",
Confidence
70% confidence
Finding
subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Natural-Language Policy Violations

Low
Confidence
90% confidence
Finding
The natural-language content of the skill description and instructions is presented only in Chinese, which can amount to a language policy violation when no user opt-in or locale scoping is provided. There is no indication that this skill is intended only for a Chinese-language audience or region-specific deployment.

Natural-Language Policy Violations

Low
Confidence
96% confidence
Finding
The module docstring, CLI descriptions, and runtime messages are presented only in Chinese, with no indication that the user can select another language. This is a natural-language locale choice embedded in the skill and may violate a language/locale policy requiring user opt-in or choice.

Static analysis

No suspicious patterns detected.