Back to skill

Security audit

视频生成与编辑

Security checks for vulnerabilities and agentic risk

Overview

This appears to be a real AI Hive video generation skill, but it needs review because broad activation plus unsafe URL and output-file handling could expose media or write files unexpectedly.

Review before installing. Use this only for media you are comfortable sending to AI Hive, keep the API key secret, avoid custom base URLs unless you fully trust them, and prefer a dedicated virtual environment. Be cautious with downloaded outputs because the current code does not strictly validate result URLs or constrain remote-derived filenames to the chosen output folder.

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

Error
Location
scripts/videogen.py:280
Finding

Unvalidated Server-Provided URLs and Unsafe Output Path Construction

Content
View full analysis

Vulnerability Details

File Location: scripts/videogen.py, lines 280–290 and 312–414
Vulnerability Type: Unvalidated remote URLs, server-side request forgery from the client environment, and path traversal
Risk Level: High

Vulnerable Code

python
upload_url = token["upload"]["url"]
upload_method = token["upload"].get("method", "PUT")
upload_headers = token["upload"].get("headers", {})

# PUT to object storage without the API key, using returned headers
print(f"[2/3] Uploading file to object storage...")
with open(str(path), "rb") as f:
    try:
        oss_resp = requests.request(
            upload_method, upload_url, headers=upload_headers,
            data=f, timeout=300,
        )
    except requests.exceptions.RequestException as e:
        raise SystemExit(
            f"OSS upload network error: {e}\n"
            "Check the network connection or whether the file is too large"
        )
python
def download_file(url, out_path, timeout=300):
    """Stream a file download with progress display."""
    print(f"[download] {out_path.name}")
    try:
        resp = requests.get(url, stream=True, timeout=timeout)
        resp.raise_for_status()
        total = int(resp.headers.get("content-length", 0))
        downloaded = 0
        with open(str(out_path), "wb") as f:
            for chunk in resp.iter_content(chunk_size=8192):
                if chunk:
                    f.write(chunk)
                    downloaded += len(chunk)
python
task_type = task.get("taskType", "task")
for i, item in enumerate(succeeded):
    result_url = item.get("resultUrl")
    if not result_url:
        continue
    ext = ".mp4" if "video" in task_type.lower() else ".png"
    filename = f"{task_type}_{task_id}_{i+1}{ext}"
    out_path = out_dir / filename
    download_file(result_url, out_path)

# Last frame
for item in succeeded:
    last_fram
...[truncated 3210 chars]
Remediation
View remediation

Remediation Suggestions

  1. Permit only https URLs for uploads and downloads.
  2. Maintain explicit allowlists for expected API, object-storage, and result-delivery domains.
  3. Resolve hostnames and reject loopback, link-local, private, multicast, reserved, and cloud metadata address ranges.
  4. Disable automatic redirects or validate every redirect target before following it.
  5. Restrict upload methods to the documented set, preferably only PUT or POST.
  6. Validate returned upload headers and reject sensitive or unexpected header names.
  7. Normalize taskType and task identifiers to a strict filename-safe character set, such as ASCII letters, digits, underscores, and hyphens.
  8. Construct the output path, resolve it with Path.resolve(), and verify that it remains beneath the resolved output directory before opening the file.
  9. Use exclusive file creation or an explicit overwrite policy to prevent silent replacement of existing files.
  10. Apply maximum download-size limits and verify that returned content types match the expected media type.

T08 · Insecure Dependencies

Note
Location
SKILL.md:176
Finding

Unpinned Runtime Dependency Installation

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, line 176
Vulnerability Type: Unpinned third-party dependency and non-reproducible installation
Risk Level: Low

Vulnerable Code

bash
pip3 install requests

Technical Analysis

The installation instructions request the latest available requests package from the package index configured in the user's environment. No reviewed version, lock file, index restriction, or cryptographic hash is provided.

This makes installations non-reproducible and means the code executed at installation and runtime can change without any modification to the audited project. The risk becomes exploitable if the configured package index is malicious or compromised, dependency resolution is redirected to an unsafe source, or a future package or transitive dependency release is compromised.

Attack Path

  1. The user follows the documented pip3 install requests instruction.
  2. pip consults the user's configured package index and resolves a mutable package version and its dependencies.
  3. An attacker compromises or controls the configured index, package artifact, or a resolved dependency.
  4. The malicious package is installed into the user's Python environment.
  5. Malicious code executes during installation or when videogen.py imports and uses the package.

Impact Assessment

A compromised dependency executes with the permissions of the user running pip or the Skill. It could access files and credentials readable by that account, including the AI Hive API key, alter generated output, intercept uploaded media, or establish additional compromise.

The project does not instruct users to install the package with elevated privileges, so no direct privilege escalation is established. The practical scope is the invoking user's environment unless the installation is independently performed with administrative privileges.

Remediation
View remediation

Remediation Suggestions

  1. Pin requests to a reviewed version or narrowly bounded compatible range.
  2. Provide a dependency lock file with hashes, such as a hash-locked requirements.txt.
  3. Install with hash verification, for example through pip install --require-hashes -r requirements.txt.
  4. Document the trusted package index and avoid untrusted extra indexes.
  5. Use a dedicated virtual environment rather than modifying a shared Python installation.
  6. Periodically update the pinned version after vulnerability and compatibility review.
  7. Add automated dependency scanning and lock-file verification to the release process.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (10)

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
89% confidence
Finding

The skill documents capabilities that imply environment access, filesystem reads/writes, network calls, and shell execution, but it does not declare an explicit tool scope or permission boundary. That mismatch can cause the agent platform or user to underestimate what the skill may do, increasing the risk of unintended file access, command execution, or data exfiltration when user media and API keys are handled.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The description contains extremely broad trigger terms spanning many generic video, editing, ad, e-commerce, and competitor-search phrases, making the skill likely to activate for loosely related requests. Over-broad activation can steer unrelated user interactions into a workflow that uploads files, requests credentials, or triggers external API calls without the user specifically asking for this skill.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The README states that required media will be automatically uploaded and outputs automatically downloaded, but it does not prominently warn users that local files will be transmitted to a third-party service. This creates a real privacy and confidentiality risk if users provide proprietary videos, personal images, or regulated content without understanding that data leaves the local environment.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The applicability section expands activation to broad search and migration intent without clear boundaries or exclusions, which increases the chance of accidental invocation. In this skill's context, mistaken activation is more dangerous because the documented workflow includes automatic media upload, task submission, polling, and download against an external service.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
72% confidence
Finding

The applicability statement specifically targets '中文或英文用户', but the document predominantly presents instructions and interaction framing in Chinese without stating that the user can choose their preferred language. This may create an implicit language constraint without explicit opt-in or choice.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

This code embeds user-facing descriptions, prompts, and operational instructions in Chinese only, beginning with the module docstring and continuing throughout the CLI UX. Because the skill does not offer locale selection or document that it is intentionally region/language-specific, it violates the language/locale policy criterion.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
87% confidence
Finding

This markdown file contains user-facing natural language entirely in Chinese across the substantive changelog entries. Under the stated policy, forcing a specific language without user opt-in can be a natural-language policy violation, and there is no indication here of a language choice or justified locale restriction.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

The API key setup instructions explain how to obtain and store credentials but do not explicitly warn that the key is sensitive and must not be exposed in logs, screenshots, shell history, or shared files. In a skill that uses command-line flags and local config, this omission raises the chance of accidental credential leakage and subsequent unauthorized API use.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Low
Category
Not specified by scanner
Confidence
94% confidence
Finding

The module docstring states it encapsulates text chat, image generation, video generation, model queries, media upload, and task polling as a '通用 AI 能力调用工具'. However, the actual executable path at the bottom invokes skill_main(), whose parser only exposes generate/task/upload/init for the video-generation-and-editing skill and never routes to the generic chat/image commands. This creates a documentation-level mismatch about what this skill file actually provides when run as the skill.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
97% confidence
Finding

The upload command prints that the returned mediaId can be passed to the chat/image/video commands via --image or --video. In this skill's actual parser, there are no chat or image subcommands, and the generate subcommand accepts file paths rather than mediaId references for --image/--video. This is an active contradiction between user-facing guidance and the skill's real interface.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.