Back to skill

Security audit

Seedance 商品视频工作室|AI-HIVE

Security checks for vulnerabilities and agentic risk

Overview

The skill mostly matches an AI-HIVE video-generation workflow, but it needs review because its API client can send the user's AI-HIVE token to an arbitrary configured API base URL.

Review before installing. Use only the default AI-HIVE endpoint, do not set --base-url or AI_HIVE_BASE_URL to an untrusted host, and rotate the API key if it may have been used with an unknown endpoint. Expect the skill to upload selected media and possibly incur generation charges only after confirmation.

Vulnerability Patterns
  • 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
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (1)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/videogen.py:92
Finding

Arbitrary API Base URL Can Expose the AI-HIVE Bearer Token

Content
View full analysis

Vulnerability Details

File Location: scripts/videogen.py, lines 92–143
Vulnerability Type: User-controlled authenticated request destination
Risk Level: High

Vulnerable Code

python
def _resolve_base_url(self, cli_url):
    if cli_url:
        return cli_url.rstrip("/")
    env_url = os.environ.get("AI_HIVE_BASE_URL")
    if env_url:
        return env_url.rstrip("/")
    file_config = self._read_config_file()
    if file_config.get("base_url"):
        return file_config["base_url"].rstrip("/")
    return DEFAULT_BASE_URL
python
class AiHiveClient:
    """Encapsulates AI Hive OpenAPI HTTP requests."""

    def __init__(self, config):
        self.config = config
        self.base = config.base_url
        self.headers = {
            "Authorization": f"Bearer {config.api_key}",
            "Content-Type": "application/json",
        }

    def _url(self, path):
        return f"{self.base}/openapi/v1/{path}"

    def _request(self, method, url, **kwargs):
        self.config.log(f"{method} {url}")
        try:
            resp = requests.request(
                method, url, headers=self.headers, timeout=DEFAULT_TIMEOUT, **kwargs
            )

The base URL is also exposed as a command-line option:

python
parser.add_argument("--base-url", help=f"API Base URL (default {DEFAULT_BASE_URL})")

Technical Analysis

The application resolves the API endpoint from three user-influenced sources: the --base-url command-line argument, the AI_HIVE_BASE_URL environment variable, and the local configuration file. The resolved value is accepted without validating its scheme, hostname, port, or origin.

AiHiveClient then attaches the AI-HIVE API key as a bearer token to every request made to that endpoint. Consequently, an attacker-controlled base URL receives the valid Authorization header on the initial HTTP request. The vulnerability a ...[truncated 1998 chars]

Remediation
View remediation

Remediation Suggestions

  1. Remove endpoint overrides from production use. Always use the hard-coded trusted endpoint unless a dedicated development mode is explicitly enabled.

  2. Apply an exact endpoint allowlist. Parse the configured URL with urllib.parse.urlsplit and require:

    • Scheme exactly equal to https.
    • Hostname exactly equal to ai-hive.iclip.cn.
    • No embedded username or password.
    • No unexpected port.
    • No fragments or ambiguous path components.
  3. Separate credentials by origin. Never attach an AI-HIVE bearer token to requests whose normalized origin does not match the approved API origin.

  4. Control redirects. Disable automatic redirects for authenticated requests with allow_redirects=False, or manually validate every redirect destination before following it. Never forward authorization headers to a different origin.

  5. Restrict configuration-file handling. Continue enforcing mode 0600, but reject unapproved base_url values read from the file. Prefer storing only the API key and keeping the production endpoint immutable.

  6. Avoid command-line API keys. Remove or discourage --api-key, because command-line arguments may be exposed through process listings and shell history. Prefer a protected configuration file, environment-based secret injection, or an operating-system credential store.

  7. Add security tests. Include tests confirming that HTTP endpoints, IP literals, lookalike domains, embedded credentials, unapproved ports, and cross-origin redirects are rejected before any authorization header is transmitted.

  8. Incident response guidance. Advise users who may have used an untrusted base URL to revoke and rotate the affected API key and review account task and billing history.

Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (13)

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The declared description promises a specialized e-commerce product-video workflow centered on Seedance and AI-HIVE-backed media generation/orchestration. The supplied code does not implement that workflow. Instead, it is a narrow, auditable ffmpeg wrapper for basic local video editing operations. While video editing is tangentially related to producing videos, the actual code lacks the core declared capabilities, integrations, and business logic, making the description materially inaccurate relative to the code’s true behavior.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
91% confidence
Finding

The description presents a specialized e-commerce 'Seedance 商品视频工作室' workflow focused on product-accurate marketing videos and associated planning outputs. The supplied code does include AI-Hive OpenAPI integration details mentioned in the description—model lookup, pricing snapshot extraction, upload-token flow, routing modes, async polling, and downloads—and it includes a Seedance-branded wrapper with fixed model IDs. However, the bulk of the implementation is a general-purpose AI-Hive command-line tool with broader capabilities: text chat, image generation, user-info retrieval, model enumeration, and arbitrary video generation. More importantly, the specialized business behavior promised in the description is not implemented: there is no logic for ingesting real selling points, target users, platform constraints, pricing/brand norms, nor any module that creates product scripts, shot lists, platform-adapted variants, or finished-video checks. So the code both overperforms in undeclared generic capabilities and underdelivers on the declared specialized workflow, making the description materially inaccurate.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
90% confidence
Finding

The skill advertises executable commands and API-driven workflows but does not declare any explicit tool scope or permissions boundaries. When a skill can plausibly use environment variables, filesystem access, shell commands, and network operations without a least-privilege declaration, reviewers and runtime policy layers cannot reliably constrain sensitive actions such as reading secrets, writing files, or making outbound requests.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The listed activation phrases include generic terms such as "电商视频", "产品广告", and scenario-based conditions like wanting stable delivery in marketing or social media contexts. These are broad enough to overlap with common user requests that may not specifically intend this skill, and the file does not provide negative trigger examples for those broad cases.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The natural-language instruction says to turn requests into a "production-ready Chinese workflow," which imposes a specific language on users by default. This is a locale/language policy concern because the file does not offer any user choice or opt-in for Chinese output.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The manifest describes a Seedance product-video studio workflow that uses AI-HIVE OpenAPI for configuration lookup, reference-material upload, pricing snapshots, routing strategies, asynchronous polling, and download of generated assets. This file instead implements only local command-line ffmpeg/ffprobe operations such as trim, aspect conversion, mute, loudness normalization, and concat, with no Seedance- or AI-HIVE-related logic.

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/edit_video.py (reported line 20)May include surrounding context.

python
def run(args: list[str]) -> None:
    print(" ".join(args))
    subprocess.run(args, check=True)


def main() -> None:

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The file implements a broad, reusable AI Hive client for chat, image generation, model enumeration, uploads, and task polling, while the manifest presents a narrowly scoped Seedance product-video studio. This capability mismatch expands what the skill can do beyond user and platform expectations, increasing the risk of misuse, policy bypass, and accidental invocation of unrelated high-risk functions.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The module docstring is entirely in Chinese and presents the tool as a general-purpose AI capability wrapper, but it does not indicate that Chinese is required or provide any language/locale opt-in. For a broadly scoped skill, hard-coding a single language in user-facing instructions can violate language-choice policy unless the locale limitation is explicitly justified.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The generic text chat endpoint allows arbitrary prompts and optional system prompts, which materially exceeds the stated Seedance product-video workflow. In a skill ecosystem, this can be abused to repurpose the tool into a general LLM interface, bypassing intended functional restrictions, audit assumptions, and content-policy boundaries tied to the advertised skill scope.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

Standalone image generation is outside the declared product-video studio scope and enables use of the skill for unrelated media synthesis. That increases abuse surface and weakens trust assumptions about what the skill can create, especially in marketplaces where declared purpose and actual media-generation capability should tightly align.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

The file hard-codes Chinese-language branding and labels in the module docstring, argument parser description, and generated JSON fields. Because there is no option to select language or locale, this can violate the policy against forcing a specific language without user opt-in.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Low
Category
Not specified by scanner
Confidence
89% confidence
Finding

The client and CLI provide a user-info endpoint that retrieves user information and wallet balance, and the parser advertises it as '查询用户信息和钱包余额'. That capability is not needed to create Seedance product videos, upload reference assets, poll generation jobs, or download outputs, so it is an unjustified extra capability for this skill's stated purpose.

Content

No source excerpt is available for this finding.