Back to skill

Security audit

Media Processor

Security checks for vulnerabilities and agentic risk

Overview

This media skill matches its stated audio/video purpose, but it needs Review because it can overwrite user-selected files and uses an unsafe fixed temporary filename during video merges.

Install and run this only in a restricted workspace or virtual environment, review every input and output path before processing, avoid shared writable directories, and keep backups because video operations may overwrite files. Pin and audit dependencies before production use, and treat the Ubuntu sudo FFmpeg install commands as optional system administration steps that should be run only if you trust the package source.

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/video_processor.py:176
Finding

Predictable Temporary File Enables Symlink Overwrite and Race Conditions

Content
View full analysis

Vulnerability Details

File Location: scripts/video_processor.py, lines 176–194
Vulnerability Type: Predictable and insecure temporary-file handling
Risk Level: Medium

Vulnerable Code:

python
# 创建临时文件列表
list_file = 'temp_video_list.txt'
with open(list_file, 'w') as f:
    for path in input_paths:
        f.write(f"file '{os.path.abspath(path)}'\n")

args = [
    '-f', 'concat',
    '-safe', '0',
    '-i', list_file,
    '-c', 'copy',
    '-y',
    output_path
]

returncode, stdout, stderr = self._run_ffmpeg(args)

os.remove(list_file)

Technical Analysis

merge_videos() creates its FFmpeg concat list under the fixed name temp_video_list.txt in the process's current working directory. The file is opened with write-and-truncate mode, and Python's normal open() behavior follows symbolic links.

If the working directory is writable by another local user or process, an attacker can create temp_video_list.txt as a symbolic link to another file writable by the victim. Opening the predictable path then truncates and writes to the symlink target with the privileges of the media-processing process.

The fixed filename also creates a time-of-check/time-of-use and concurrency problem. Multiple merge operations running in the same directory can overwrite, consume, or delete each other's concat lists. In addition, cleanup is not placed in a finally block. Exceptions from FFmpeg invocation or file deletion may leave the temporary file and its input-path contents behind.

Attack Path

  1. The attacker identifies a shared or attacker-writable directory from which the application invokes merge_videos().
  2. The attacker creates a symbolic link named temp_video_list.txt pointing to a file that the victim process can write.
  3. The victim invokes merge_videos().
  4. open(list_file, 'w') follows the symbolic link and truncates the target file.
  5. The method writes attacker ...[truncated 956 chars]
Remediation
View remediation

Remediation Suggestions

  • Replace the fixed filename with tempfile.NamedTemporaryFile() or tempfile.mkstemp(), which creates a unique file atomically.
  • Create temporary files in a trusted directory that is not writable by untrusted users.
  • Apply restrictive permissions and avoid reopening a generated path in a way that reintroduces a race.
  • Place cleanup in a finally block so the temporary file is removed even when FFmpeg fails.
  • Escape concat-demuxer path syntax correctly, especially apostrophes and newline characters in input filenames.
  • Consider avoiding an intermediate list file where practical.

Example hardening pattern:

python
import tempfile

list_file = None
try:
    with tempfile.NamedTemporaryFile(
        mode='w',
        encoding='utf-8',
        prefix='video_concat_',
        suffix='.txt',
        delete=False
    ) as f:
        list_file = f.name
        for path in input_paths:
            absolute_path = os.path.abspath(path)
            escaped_path = absolute_path.replace("'", r"'\''")
            f.write(f"file '{escaped_path}'\n")

    args = [
        '-f', 'concat',
        '-safe', '0',
        '-i', list_file,
        '-c', 'copy',
        '-y',
        output_path
    ]
    returncode, stdout, stderr = self._run_ffmpeg(args)
finally:
    if list_file:
        try:
            os.unlink(list_file)
        except FileNotFoundError:
            pass

T08 · Insecure Dependencies

Note
Location
requirements.txt:1
Finding

Open-Ended Dependency Constraints Allow Unreviewed Future Releases

Content
View full analysis

Vulnerability Details

File Location: requirements.txt, lines 1–9
Vulnerability Type: Unpinned third-party dependencies without integrity verification
Risk Level: Low

Vulnerable Code:

text
moviepy>=1.0.3
pydub>=0.25.1
librosa>=0.10.0
openai-whisper>=20231117
numpy>=1.24.0
Pillow>=10.0.0
ffmpeg-python>=0.2.0
srt>=3.5.0
tqdm>=4.66.0

The documented installation command in SKILL.md and README.md is:

bash
pip install -r requirements.txt

Technical Analysis

Every dependency has only a minimum-version constraint. Consequently, the exact code installed depends on the package-index state and dependency resolver at installation time. Future releases that were not part of this audit may be selected automatically.

The requirements file also contains no package hashes, and the project provides no lock file. Pip therefore cannot verify that the resolved artifacts match a reviewed set of distributions.

The dependency names observed during this audit are recognizable package names, and no evidence establishes that any currently listed package is malicious. The risk arises from mutable, unverified dependency resolution rather than a confirmed malicious dependency.

Attack Path

  1. A user follows the documented pip install -r requirements.txt instruction.
  2. Pip queries the configured package index and resolves any versions satisfying the open-ended >= constraints.
  3. A newly published vulnerable, compromised, or otherwise unsafe release may satisfy those constraints.
  4. Pip downloads and installs that unreviewed release without validating it against project-supplied hashes.
  5. Package installation hooks or imported package code execute with the installing or application user's privileges.

This path depends on an unsafe package release, a compromised package-index account or infrastructure, or an untrusted package-index configuration. ...[truncated 721 chars]

Remediation
View remediation

Remediation Suggestions

  • Pin all direct and transitive dependencies to reviewed versions using exact constraints.
  • Generate and commit a lock file appropriate to the selected dependency-management workflow.
  • Record cryptographic hashes for approved distributions and install with:
    bash
    pip install --require-hashes -r requirements.txt
    
  • Regenerate pins and hashes through a controlled dependency-update process.
  • Use a trusted or internally mirrored package index in higher-assurance deployments.
  • Scan locked dependencies for known vulnerabilities in CI.
  • Review release notes and security advisories before accepting dependency updates.
  • Separate development dependencies from runtime dependencies to minimize installed attack surface.
Vulnerability Patterns
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (32)

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

This mismatch is security-relevant because the skill omits that it invokes external executables (ffmpeg/ffprobe) and performs local filesystem writes/deletes, while presenting itself as a generic multimedia processor. Hidden operational behaviors reduce transparency and can cause operators to approve or run the skill without understanding that it spawns subprocesses and modifies local files.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
88% confidence
Finding

This mismatch is security-relevant because the skill omits that it invokes external executables (ffmpeg/ffprobe) and performs local filesystem writes/deletes, while presenting itself as a generic multimedia processor. Hidden operational behaviors reduce transparency and can cause operators to approve or run the skill without understanding that it spawns subprocesses and modifies local files.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The skill documentation is written entirely in Chinese, and there is no indication that users may choose another language or that the tool is intentionally limited to a Chinese-speaking context. Under the stated policy, forcing a specific language without user opt-in is a natural-language policy concern.

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 · README.md (reported line 20)May include surrounding context.

md
pip install -r requirements.txt

# FFmpeg 安装 (Ubuntu/Debian)
sudo apt-get update
sudo apt-get install ffmpeg

# FFmpeg 安装 (macOS)

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 · README.md (reported line 21)May include surrounding context.

md
pip install -r requirements.txt

# FFmpeg 安装 (Ubuntu/Debian)
sudo apt-get update
sudo apt-get install ffmpeg

# FFmpeg 安装 (macOS)

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
89% confidence
Finding

The skill advertises executable examples and references local scripts that are expected to perform media processing with FFmpeg, which implies shell execution and filesystem writes, but it does not declare any tool scope such as permissions or allowed-tools. This is dangerous because agents or reviewers cannot accurately bound what the skill is permitted to do, increasing the risk of unexpected command execution or file modification when the skill is invoked.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The module title is presented only in Chinese ("基本使用示例"), and the rest of the file continues with Chinese-only user-facing strings. Under the policy rule, forcing a specific language without user opt-in is a natural-language policy concern unless the locale restriction is explicitly documented and justified.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The functions and runtime output use Chinese-only natural-language strings throughout, such as demo descriptions and printed headings. Because the file does not offer a language choice or justify a Chinese-only locale, this appears to enforce a specific language policy across the example's user-facing experience.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

This code's module docstrings, method docstrings, exceptions, and console output are written in Chinese, which imposes a specific language on users without any opt-in or alternative locale support. The policy explicitly flags language or locale constraints when the skill does not offer user choice or clearly justify the restriction.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The file uses Chinese for the module description, docstrings, and user-facing print output, with no indication that language is configurable or chosen by the user. This can violate a language/locale policy when a skill forces a specific language without opt-in.

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 · scripts/video_processor.py (reported line 34)May include surrounding context.

python
def _run_ffmpeg(self, args: list) -> Tuple[int, str, str]:
        """运行 FFmpeg 命令"""
        cmd = [self.ffmpeg_path] + args
        process = subprocess.Popen(
            cmd,
            stdout=subprocess.PIPE,
            stderr=subprocess.PIPE,

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 · scripts/video_processor.py (reported line 54)May include surrounding context.

python
input_path
        ]
        
        result = subprocess.run(cmd, capture_output=True, text=True)
        data = json.loads(result.stdout)
        
        format_info = data.get('format', {})

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The conversion function forces overwrite with -y and provides no confirmation or safety check before replacing the destination file. If an attacker or mistaken caller can control output_path, existing files may be silently destroyed or replaced, causing data loss and potentially clobbering sensitive application files accessible to the process.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

Audio extraction also uses -y, so an existing output file is silently overwritten without user awareness. In automation or multi-user environments, this can lead to accidental or attacker-influenced destruction of files if paths are not tightly controlled.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The compression routine unconditionally overwrites the target file with -y, creating the same file-clobbering risk as the other write operations. This is particularly risky in services that process user-supplied paths or run with elevated filesystem permissions.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The merge function uses a predictable temp file name in the current directory and then deletes it, which creates a race/symlink attack surface in shared environments; it also overwrites the final output with -y. A local attacker could pre-create or replace temp_video_list.txt with a symlink to another file, potentially causing unintended overwrite or deletion when the process opens or removes it.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
81% confidence
Finding

This markdown file documents operations such as conversion, trimming, subtitle generation, and export/save actions that create or modify user media files. The README provides usage examples but does not warn users about output-file overwrites, data loss from edits/transcoding, or the need to verify output paths before saving.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
96% confidence
Finding

The dependency is specified with a lower bound only, so builds may resolve to different versions over time. This weakens reproducibility and can unintentionally introduce vulnerable or breaking upstream releases into the media-processing environment.

Content

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

text
moviepy>=1.0.3
pydub>=0.25.1
librosa>=0.10.0
openai-whisper>=20231117

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
96% confidence
Finding

Using an unpinned version for pydub allows dependency resolution to drift across installations. In a skill that processes untrusted media, unexpected upstream changes can increase attack surface or pull in versions with security defects.

Content

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

text
moviepy>=1.0.3
pydub>=0.25.1
librosa>=0.10.0
openai-whisper>=20231117
numpy>=1.24.0

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
96% confidence
Finding

A minimum-only constraint for librosa means the installed version is not controlled and may vary by environment or over time. This creates supply-chain and patch-verification uncertainty, especially for software handling external audio inputs.

Content

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

text
moviepy>=1.0.3
pydub>=0.25.1
librosa>=0.10.0
openai-whisper>=20231117
numpy>=1.24.0
Pillow>=10.0.0

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
96% confidence
Finding

The openai-whisper dependency is not fixed to an exact release, so future installs may pick different code than originally tested. That increases risk of supply-chain instability and makes it harder to verify exposure to known vulnerabilities.

Content

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

text
moviepy>=1.0.3
pydub>=0.25.1
librosa>=0.10.0
openai-whisper>=20231117
numpy>=1.24.0
Pillow>=10.0.0
ffmpeg-python>=0.2.0

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
98% confidence
Finding

Numpy is unpinned even though it is a core library with a long history of advisories across versions. Without exact version control, the environment may install an affected release or an untested newer one, undermining security assurance.

Content

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

text
pydub>=0.25.1
librosa>=0.10.0
openai-whisper>=20231117
numpy>=1.24.0
Pillow>=10.0.0
ffmpeg-python>=0.2.0
srt>=3.5.0

Unverifiable Dependency: numpy has 16 known advisory(ies) (CVE-2014-1859 (Numpy arbitrary file write via symlink attack); CVE-2021-41495 (NumPy NULL Pointer Dereference); CVE-2021-33430 (NumPy Buffer Overflow (Disputed)) +13 more), but the manifest does not pin a version, so it is unknown whether the installed release is affected

Low
Category
Supply Chain
Confidence
90% confidence
Finding

The manifest does not pin numpy, so it is impossible to verify whether the installed version is affected by any of the known advisories. In practice this is a real security weakness because the project cannot demonstrate that it is deploying a safe release.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
98% confidence
Finding

Pillow processes image data and has had multiple security issues in the past, so leaving it unpinned creates uncertainty about which code will run. In a multimedia skill that may handle untrusted files, this increases the chance of pulling a vulnerable build.

Content

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

text
librosa>=0.10.0
openai-whisper>=20231117
numpy>=1.24.0
Pillow>=10.0.0
ffmpeg-python>=0.2.0
srt>=3.5.0
tqdm>=4.66.0

Unverifiable Dependency: Pillow has 16 known advisory(ies) (CVE-2016-2533 (Pillow buffer overflow in ImagingPcdDecode); CVE-2023-50447 (Arbitrary Code Execution in Pillow); CVE-2021-27922 (Pillow Uncontrolled Resource Consumption) +13 more), but the manifest does not pin a version, so it is unknown whether the installed release is affected

Low
Category
Supply Chain
Confidence
92% confidence
Finding

Pillow has multiple historical vulnerabilities and the manifest leaves the installed version ambiguous. Because this skill is an image/video processor likely to consume external files, inability to verify the exact Pillow release is more concerning than in a non-media context.

Content

No source excerpt is available for this finding.