Back to skill

Security audit

短剧分镜故事板工作室|AI-HIVE

Security checks for vulnerabilities and agentic risk

Overview

The skill is mostly a disclosed AI-HIVE storyboard/media workflow, but it handles API credentials in a way that could send them to an untrusted custom endpoint.

Review before installing. Use only the default AI-HIVE endpoint unless you fully trust a custom deployment, and do not set AI_HIVE_BASE_URL or --base-url from untrusted instructions. Treat the stored API key as sensitive, expect uploads/downloads and possibly billable generation, and confirm parameters before any generation task.

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 (2)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/imagegen.py:94
Finding

API Credential Disclosure Through an Unrestricted Base URL

Content
View full analysis

Vulnerability Details

File Location: scripts/imagegen.py, lines 94–99 and 128–143
Vulnerability Type: Unrestricted API endpoint override with automatic bearer-token forwarding
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
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
        )

Technical Analysis

The client accepts an API base URL from the --base-url command-line option, the AI_HIVE_BASE_URL environment variable, or the persistent configuration file. It does not validate the URL scheme, hostname, port, or destination.

Every API request then unconditionally includes the user's AI-HIVE API key in the Authorization header. Consequently, redirecting the base URL to an attacker-controlled endpoint causes the application to disclose the bearer credential. This is a credential-forwarding vulnerability rather than intended credential use because the token is documented and provisioned for AI-HIVE, while the code allows it to be transmitted to an unrelated host.

Attack Path

  1. An attacker convinces a user or agent to execute imagegen.py with a malicious --base-url, set AI_HIVE_BASE_URL to an attacker-controlled URL, or modify `~/.ai-hive/co ...[truncated 1000 chars]
Remediation
View remediation

Remediation Suggestions

  1. Restrict authenticated API requests to an explicit allowlist of trusted HTTPS hosts, with ai-hive.iclip.cn as the default trusted destination.
  2. Parse URLs with a standard URL parser and reject:
    • Non-HTTPS schemes
    • Embedded user information
    • Unexpected hostnames
    • Unapproved ports
    • Malformed or ambiguous hostnames
  3. Do not attach Authorization when the destination origin differs from the approved API origin.
  4. Disable automatic cross-origin redirects for authenticated requests, or validate the destination again before following each redirect.
  5. If custom deployments are a required feature, use separate credentials scoped to each configured origin and require explicit user confirmation before storing or using them.
  6. Add automated tests confirming that credentials are never transmitted to an unapproved scheme, host, port, or redirect destination.
  7. Advise affected users to revoke and rotate API keys if they have used an untrusted custom base URL.

T09 · Insecure Skill Coding Practices

Error
Location
scripts/videogen.py:94
Finding

API Credential Disclosure Through an Unrestricted Base URL

Content
View full analysis

Vulnerability Details

File Location: scripts/videogen.py, lines 94–99 and 128–143
Vulnerability Type: Unrestricted API endpoint override with automatic bearer-token forwarding
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
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
        )

Technical Analysis

The video-generation client has the same unrestricted endpoint-selection behavior as the image-generation client. A caller can supply a base URL through the command line, environment, or configuration file, and the client does not ensure that the endpoint uses HTTPS or belongs to the intended AI-HIVE service.

The configured AI-HIVE bearer token is attached to every request made through _request(). Therefore, an attacker-controlled base URL can receive and capture that token.

Attack Path

  1. An attacker causes the victim to supply a malicious --base-url, set a hostile AI_HIVE_BASE_URL, or use a modified configuration file.
  2. The victim invokes an authenticated video-generation, task-status, or upload operation.
  3. The client accepts the untrusted endpoint and constructs an API URL beneath it.
  4. The request is sent with the victim's bearer token ...[truncated 648 chars]
Remediation
View remediation

Remediation Suggestions

  1. Enforce HTTPS and validate the API hostname against a strict allowlist before creating the client.
  2. Bind credentials to the expected origin and omit the Authorization header for every other origin.
  3. Reject URLs containing embedded credentials, unexpected ports, malformed hostnames, or unsupported schemes.
  4. Prevent authenticated requests from following redirects to a different origin.
  5. If custom API deployments must be supported, require separate origin-scoped credentials and an explicit opt-in warning.
  6. Add security tests covering command-line, environment-variable, configuration-file, and redirect-based endpoint manipulation.
  7. Rotate any API key previously used while an untrusted base URL was configured.
Vulnerability Patterns
  • 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
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (18)

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

Presenting the skill as a shot-list/storyboard studio while it functions mainly as a generic AI-Hive media-generation wrapper creates a trust and review gap. This can lead to unsafe routing, excessive permissions, or user consent based on incorrect assumptions about what the skill actually does and what data it may send externally.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

Presenting the skill as a shot-list/storyboard studio while it functions mainly as a generic AI-Hive media-generation wrapper creates a trust and review gap. This can lead to unsafe routing, excessive permissions, or user consent based on incorrect assumptions about what the skill actually does and what data it may send externally.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

Presenting the skill as a shot-list/storyboard studio while it functions mainly as a generic AI-Hive media-generation wrapper creates a trust and review gap. This can lead to unsafe routing, excessive permissions, or user consent based on incorrect assumptions about what the skill actually does and what data it may send externally.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

Presenting the skill as a shot-list/storyboard studio while it functions mainly as a generic AI-Hive media-generation wrapper creates a trust and review gap. This can lead to unsafe routing, excessive permissions, or user consent based on incorrect assumptions about what the skill actually does and what data it may send externally.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The manifest describes a domain-specific storyboard workflow for directors and writers, including structured per-shot deliverables. In this file, the generated skill wrapper fixes a single image model and only provides generate, task, upload, and init commands for image generation, with no code to parse scripts, segment shots, or emit storyboard metadata.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The implementation is a broad AI-Hive client that exposes chat, image generation, model enumeration, uploads, task polling, and account-related API operations, while the skill is advertised as a narrowly scoped storyboard studio. This scope mismatch violates least privilege and increases attack surface: a caller expecting only storyboard/video generation can invoke unrelated capabilities and potentially use the skill as a generic API proxy.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
89% confidence
Finding

The skill advertises runnable scripts that use environment variables, local files, shell tools, and networked API access, but it declares no explicit tool scope or permissions boundary. That creates an authorization and transparency gap: an agent may invoke broader capabilities than users or reviewers expect, increasing the risk of unintended file access, outbound requests, or execution of local tooling.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The activation list includes the standalone term "故事板", which is a generic word for storyboard and may appear in many ordinary creative discussions unrelated to this specific AI-HIVE skill. The file does provide several narrower examples, but this individual trigger lacks scope constraints or negative examples, increasing the chance of unintended invocation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The manifest text says requests will be turned into a "production-ready Chinese workflow," which imposes a specific language choice by default. This is a natural-language policy concern because the user is not offered a language option or asked to opt in to Chinese output.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The file presents the skill name, parser description, and search aliases entirely in Chinese, with no indication that another language can be selected or that the language restriction is intentional. This creates a natural-language policy concern because the skill appears to impose a specific locale by default rather than offering user opt-in or documenting a justified regional constraint.

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:

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The top-level docstring says this file is a '通用 AI 能力调用工具' covering text chat, image/video generation, model queries, uploads, and polling via argparse subcommands. However, if __name__ == "__main__": invokes skill_main() rather than main(), so the exposed CLI in this file is restricted to the image-skill commands and not the documented general-purpose interface.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

This Python skill presents its top-level description, setup guidance, status output, and interactive prompts exclusively in Chinese. That creates a locale policy issue because users are not offered a language choice or any opt-in to a Chinese-only experience.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The module docstring explicitly frames the file as a general-purpose AI capability tool, contradicting the manifest's storyboard-specific identity. This discrepancy is a strong indicator that the skill is acting as a disguised generic API client, which increases the chance of policy bypass, operator confusion, and unsafe overexposure of functions under a narrower trust label.

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 docstring and all user-facing CLI/help text in this file are written in Chinese, and there is no natural-language indication that other locales are supported or that the user may choose their preferred language. Under the policy for natural-language violations, forcing a specific language without opt-in is a reportable issue.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

Exposing user-info and wallet-balance retrieval is not necessary for producing storyboard/video outputs and grants access to account metadata beyond the skill's stated purpose. In a skill environment, this can leak sensitive operational or billing information to callers or downstream logs, especially if users do not expect account introspection from a creative tool.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

Generic model discovery across TEXT, IMAGE, and VIDEO enables users to probe and access platform capabilities beyond the storyboard skill's declared purpose. This broad enumeration can aid misuse, bypass business restrictions intended by the skill wrapper, and make it easier to repurpose the skill as a generic capability broker.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
86% confidence
Finding

This file presents all user-facing instructions, triggers, workflow, and output requirements only in Chinese, which can amount to forcing a specific language without explicit user opt-in. There is no statement that the skill is China-region-specific or that users may choose another language.

Content

No source excerpt is available for this finding.