Back to skill

Security audit

Seedance 参考图生视频

Security checks for vulnerabilities and agentic risk

Overview

The skill is mostly a disclosed AI Hive video-generation helper, but it needs Review because its activation scope is overly broad and its downloaded output filenames can be controlled by the remote API.

Review this skill before installing. Only use it when you intentionally want to upload media to AI Hive and create a remote generation task, avoid using sensitive private media, prefer the default AI Hive base URL, and choose a low-risk output directory because downloaded filenames are not safely constrained.

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/videogen.py:399
Finding

Server-Controlled Path Traversal in Downloaded Output Filenames

Content
View full analysis

Vulnerability Details

File Location: scripts/videogen.py, lines 399–413
Vulnerability Type: Path traversal and arbitrary file write
Risk Level: Medium

Vulnerable Code

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)

# 尾帧
for item in succeeded:
    last_frame = item.get("lastFrameUrl")
    if last_frame:
        out_path = out_dir / f"{task_type}_{task_id}_lastframe.png"
        download_file(last_frame, out_path)

Technical Analysis

The output filenames incorporate taskType returned by the remote API and task_id without validating or removing path separators, .. components, or other filesystem metacharacters. The resulting value is joined directly to the user-selected output directory and opened for writing by download_file().

A malicious or compromised API endpoint can return a crafted taskType, such as ../../.config/target, causing the resolved output path to escape the intended output directory. The same unsafe values are reused when constructing the last-frame filename.

This risk is particularly relevant because the application supports a configurable API base URL. An attacker-controlled endpoint can therefore provide both the malicious task metadata and the content downloaded into the resulting path.

Attack Path

  1. The victim is induced to configure an attacker-controlled API base URL, or the legitimate API service is compromised.
  2. The victim submits or polls a generation task.
  3. The endpoint returns a completed task containing a traversal sequence in taskType, such as ../../target-directory/payload.
  4. The endpoint supplies an attacker-cont ...[truncated 722 chars]
Remediation
View remediation

Remediation Suggestions

  • Do not use server-provided task metadata as a filesystem name. Generate output names from locally generated random identifiers or strictly validated identifiers.

  • Reject values containing /, \, .., NUL characters, control characters, or platform-specific path syntax.

  • Resolve both the output directory and candidate path before writing, then verify that the candidate remains inside the output directory:

    python
    out_dir = Path(output_dir).resolve()
    out_dir.mkdir(parents=True, exist_ok=True)
    
    safe_task_id = "".join(
        c for c in str(task_id) if c.isalnum() or c in ("-", "_")
    )
    filename = f"video_{safe_task_id}_{i + 1}{ext}"
    out_path = (out_dir / filename).resolve()
    
    if out_dir not in out_path.parents:
        raise SystemExit("Unsafe output path")
    
  • Apply the same validation and containment check to normal results and last-frame downloads.

  • Consider opening new files in exclusive creation mode where overwriting existing files is unnecessary.

  • Add tests using values such as ../file, ../../dir/file, backslash traversal, absolute-path-like strings, and encoded separator variants.

T08 · Insecure Dependencies

Note
Location
SKILL.md:176
Finding

Unpinned Third-Party Dependency Installation

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, line 176; scripts/videogen.py, lines 7 and 19–22
Vulnerability Type: Uncontrolled third-party dependency version
Risk Level: Low

Vulnerable Code

markdown
pip3 install requests
python
依赖:requests(pip3 install requests)
python
try:
    import requests
except ImportError:
    print("缺少依赖:requests。请运行 pip3 install requests", file=sys.stderr)
    sys.exit(1)

Technical Analysis

The installation instructions retrieve requests without a pinned version, hash verification, lockfile, or explicitly trusted package index. Although requests is a legitimate package and no malicious dependency is included in the project itself, this installation method is not reproducible and automatically accepts whatever release the package source serves at installation time.

A future compromised release, compromised package-hosting account, maliciously configured package index, or incompatible update could therefore introduce unintended code into the skill's runtime. Python packages may execute code during installation and are imported directly by the application.

Attack Path

  1. An attacker compromises the package source, a relevant package-publishing account, or the package index configured on the victim's system.
  2. A malicious or altered version is made available under the expected dependency name.
  3. The victim follows the documented pip3 install requests instruction.
  4. The package manager downloads and installs the uncontrolled version.
  5. Package installation hooks or imported package code execute with the privileges of the user running the installation or skill.

Impact Assessment

Exploitation could execute arbitrary code with the privileges of the installing user. That code could access the AI Hive API key, uploaded media, generated outputs, and other resources available to the account. The practical risk is re ...[truncated 171 chars]

Remediation
View remediation

Remediation Suggestions

  • Add a reviewed, version-pinned dependency file, for example:

    text
    requests==<reviewed-version>
    
  • Prefer a hash-locked requirements file generated after reviewing the complete transitive dependency set, and install it with:

    bash
    python3 -m pip install --require-hashes -r requirements.txt
    
  • Document installation inside a dedicated virtual environment rather than the system Python environment.

  • Explicitly document the trusted package index and avoid untrusted or implicit extra indexes.

  • Use an automated dependency-update process that reviews security advisories and tests updates before changing pinned versions.

  • Keep the installation instructions and import-error message consistent with the locked dependency workflow.

Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • 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
Findings (11)

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
95% confidence
Finding

The skill advertises and instructs use of capabilities including shell execution, network access, environment/config handling, and file writes, but it declares no explicit tool scope or permission boundaries. In practice this can cause over-privileged execution: a user invoking what appears to be a media-generation skill may trigger local file reads, uploads of user media to external services, API-key handling, browser opening, and local downloads without clear sandbox constraints.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The top-level description contains extremely broad trigger terms spanning generic AI video generation, competitor products, pricing/API comparisons, and many commerce contexts. This can cause the skill to be invoked for loosely related queries where the user did not intend to upload assets or interact with this external service, increasing the chance of unintended data disclosure, unnecessary API usage, or misleading tool routing.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The description does not prominently warn, at the entry point, that provided media will be automatically uploaded to an external service and that outputs will be downloaded and written locally. Because the skill is framed as a broad video-tool/comparison result, users may provide sensitive images, videos, or audio without understanding the data flow, creating privacy, confidentiality, and compliance risks.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The README further expands applicability to broad competitor, platform, and e-commerce search intents without clear limits, making over-triggering even more likely. In this skill's context, over-triggering is more dangerous because use of the workflow entails external media upload, task creation, polling, and local download, so an imprecise match can lead to unintended handling of user assets and paid operations.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The file-level docstring says the program wraps broad AI Hive capabilities including text chat, image generation, video generation, model querying, media upload, and task polling. However, the manifest for this skill claims a much narrower purpose centered on Seedance reference-image-to-video generation, so the code documentation materially overstates the intended scope of this skill artifact.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The manifest describes a Seedance reference-image-to-video workflow, with adjacent support for video-related generation and task handling. This file still implements generic chat and image generation API operations, which are not justified by the stated purpose of a dedicated Seedance video skill and broaden the available capability surface unnecessarily.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
90% confidence
Finding

This markdown file contains user-facing natural language exclusively in Chinese across the substantive changelog entries. Under the policy rule, forcing a specific language without opt-in can be a locale/language policy violation when no alternative language or choice is provided.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

The placeholder string on L2 uses Chinese ('请替换为你的APIKey') as the only language, which is a natural-language locale choice embedded in the file. This can violate language/locale policy because it does not offer an opt-in or alternative for users who expect another language.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

This Python skill’s natural-language interface is written entirely in Chinese, including the module docstring and later user-facing prompts/errors, with no indication that other languages are supported. Under the policy rule, forcing a specific language without user opt-in is a natural-language policy violation.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Low
Category
Not specified by scanner
Confidence
83% confidence
Finding

The code includes endpoints to fetch user account information and list all available models. While these can be useful for a generic CLI, they are not part of the manifest's stated user-facing purpose of performing Seedance reference-image-to-video generation with upload, task submission, polling, and download.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
76% confidence
Finding

The comment says the browser is opened with a query parameter 'for backend attribution reservation', which suggests a future or passive purpose. In reality, the code already sends the skill name in the URL query string when opening the browser, so the comment understates the active behavior of transmitting skill-identifying metadata.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.