Back to skill

Security audit

互动分支短剧生成器|AI-HIVE

Security checks for vulnerabilities and agentic risk

Overview

The skill is a disclosed AI-HIVE media workflow helper, but its API clients can send a stored API key to a configurable server, which warrants review before installation.

Review this skill before installing. Use it only with the official AI-HIVE endpoint, avoid setting AI_HIVE_BASE_URL or stored base_url to any untrusted server, and consider using a limited or revocable API key. Confirm all billable generation parameters before running commands, and install Python dependencies in an isolated environment.

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

T09 · Insecure Skill Coding Practices

Error
Location
scripts/imagegen.py:68
Finding

AI-HIVE bearer credential can be transmitted to an arbitrary server by the image-generation client

Content
View full analysis

Vulnerability Details

File Location: scripts/imagegen.py:68-99, 132-143
Vulnerability Type: Arbitrary authenticated API destination
Risk Level: High

Vulnerable Code

python
def _resolve_api_key(self, cli_key):
    if cli_key:
        return cli_key
    env_key = os.environ.get("AI_HIVE_API_KEY")
    if env_key:
        return env_key
    file_config = self._read_config_file()
    if file_config.get("api_key"):
        return file_config["api_key"]

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 permits the API destination to be supplied through the --base-url argument, the AI_HIVE_BASE_URL environment variable, or the persistent configuration file. It does not require HTTPS or verify that the hostname belongs to AI-HIVE.

Every API request made through _request automatically includes the resolved API key in the Authorization header. Consequently, redirecting the base URL to an attacker-controlled endpoint causes the legitimate bearer credential to be disclosed. A malicious API response can also provide an attacker-controlled media upload URL, allowing user-selected reference media to be sent outsi ...[truncated 1112 chars]

Remediation
View remediation

Remediation Suggestions

  • Remove custom base-URL support from the production Skill wrapper if it is not operationally required.
  • Otherwise, require HTTPS and enforce an exact hostname allowlist for ai-hive.iclip.cn.
  • Resolve and validate the final destination before attaching the bearer credential.
  • Disable cross-origin redirects or strip the Authorization header whenever the origin changes.
  • Validate upload-token URLs against an explicit allowlist of approved object-storage domains and HTTPS schemes.
  • Do not trust a base URL loaded from a writable configuration file without validation.
  • Check that the configuration file is a regular file owned by the current user and is not a symbolic link before reading credentials from it.
  • Add automated tests confirming that credentials are never sent to unapproved hosts.
  • Rotate any API key that may previously have been used with an untrusted base URL.

T09 · Insecure Skill Coding Practices

Error
Location
scripts/videogen.py:68
Finding

AI-HIVE bearer credential can be transmitted to an arbitrary server by the video-generation client

Content
View full analysis

Vulnerability Details

File Location: scripts/videogen.py:68-99, 132-143
Vulnerability Type: Arbitrary authenticated API destination
Risk Level: High

Vulnerable Code

python
def _resolve_api_key(self, cli_key):
    if cli_key:
        return cli_key
    env_key = os.environ.get("AI_HIVE_API_KEY")
    if env_key:
        return env_key
    file_config = self._read_config_file()
    if file_config.get("api_key"):
        return file_config["api_key"]

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 client independently contains the same unsafe endpoint override as the image client. The API origin can be changed using command-line input, an environment variable, or the local configuration file, while the client continues to attach the real bearer credential to every request.

No scheme validation, hostname allowlist, certificate pinning, or trusted-origin check is performed. The upload workflow trusts the upload.url value returned by the selected endpoint and sends user-selected images, videos, or audio files to that location without validating its origin.

Attack Path

  1. An attacker sets --base-url, ` ...[truncated 976 chars]
Remediation
View remediation

Remediation Suggestions

  • Hardcode the trusted production API origin in the Skill-facing command.
  • If endpoint customization is required for development, place it behind an explicit development-only option and never reuse production credentials with it.
  • Require HTTPS and compare the normalized destination hostname against a strict allowlist.
  • Reject URLs containing user information, nonstandard schemes, unexpected ports, or unapproved hosts.
  • Prevent authenticated redirects to a different origin.
  • Validate all object-storage upload URLs before transmitting media.
  • Separate media-upload requests from authenticated API requests and enforce destination-specific header policies.
  • Verify ownership, permissions, and file type for the persistent configuration file.
  • Add regression tests that use a mock unapproved endpoint and verify that no authorization header or media content is transmitted.

T08 · Insecure Dependencies

Note
Location
SKILL.md:67
Finding

Runtime dependency installation is unpinned and lacks integrity verification

Content
View full analysis

Vulnerability Details

File Location: SKILL.md:67
Vulnerability Type: Unpinned third-party dependency installation
Risk Level: Low

Vulnerable Installation Command

bash
pip3 install requests

Technical Analysis

The Skill directs users to install requests without specifying an exact version, dependency lockfile, package hash, isolated environment, or trusted package index. Package resolution therefore depends on the state of the configured Python package index at installation time.

The package name itself is legitimate, and the audit found no evidence that the project intentionally references a malicious package. The risk arises from non-reproducible dependency resolution and the absence of integrity controls. A future compromised release, compromised index, unexpected transitive dependency, or incompatible package update could alter network behavior or execute code during installation.

Attack Path

  1. A user follows the documented installation command.
  2. pip contacts the user's configured package index or mirror.
  3. The resolver selects the currently available package and transitive dependency versions without checking project-provided hashes.
  4. If the index, mirror, selected release, or dependency chain is compromised, malicious installation or runtime code is installed.
  5. The installed code executes with the privileges of the user running pip or the Skill.

Impact Assessment

Impact depends on the privileges of the installing user and the behavior of a compromised dependency. Potential consequences include execution of arbitrary code in the Python environment, theft of the AI-HIVE credential, manipulation of API requests or responses, and access to files available to the user. No direct package compromise was identified during this static audit, so this is a supply-chain hardening issue rather than evidence of an active malicious dependency.

Remediation
View remediation

Remediation Suggestions

  • Add a reviewed dependency file containing exact package and transitive dependency versions.
  • Generate and verify cryptographic hashes for every resolved package.
  • Document installation using an isolated virtual environment.
  • Use an integrity-enforcing command such as:
bash
python3 -m pip install --require-hashes -r requirements.txt
  • Document the approved package index and avoid untrusted mirrors.
  • Introduce automated dependency vulnerability and update scanning.
  • Review and regenerate the lockfile through a controlled update process rather than resolving the newest packages during normal Skill execution.
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 (17)

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

If the skill exposes generic chat, image generation, account retrieval, model catalog querying, pricing selection, or media upload independently of the declared branching-drama use case, then users and policy systems cannot accurately assess the real privileges and data flows. That creates security and governance risk because external actions, cost-bearing calls, and possible access to account-related data are hidden behind a misleading description.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

If the skill exposes generic chat, image generation, account retrieval, model catalog querying, pricing selection, or media upload independently of the declared branching-drama use case, then users and policy systems cannot accurately assess the real privileges and data flows. That creates security and governance risk because external actions, cost-bearing calls, and possible access to account-related data are hidden behind a misleading description.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

If the skill exposes generic chat, image generation, account retrieval, model catalog querying, pricing selection, or media upload independently of the declared branching-drama use case, then users and policy systems cannot accurately assess the real privileges and data flows. That creates security and governance risk because external actions, cost-bearing calls, and possible access to account-related data are hidden behind a misleading description.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

If the skill exposes generic chat, image generation, account retrieval, model catalog querying, pricing selection, or media upload independently of the declared branching-drama use case, then users and policy systems cannot accurately assess the real privileges and data flows. That creates security and governance risk because external actions, cost-bearing calls, and possible access to account-related data are hidden behind a misleading description.

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 skill for generating interactive branching short-drama assets, including branch trees, node scripts, scene boards, per-path video tasks, and consistency checks. However, the fixed skill configuration and entrypoint expose only image-centric commands (generate delegates to cmd_image, plus task and upload) and do not implement branch-logic validation, script/tree generation, or video generation as the skill's primary behavior.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
93% confidence
Finding

The skill advertises executable commands and operational workflows involving environment variables, local files, network access, and shell utilities, but it does not declare any explicit tool scope or permission boundaries. This increases the risk of over-privileged execution, accidental secret exposure, or unintended external actions because reviewers and runtime policy cannot clearly constrain what the skill is allowed to do.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The manifest description and title define invocation and usage entirely in Chinese, including trigger examples and task framing, with no indication that other languages are supported or that Chinese is optional. This can violate language/locale policy when a skill implicitly requires a specific language without user opt-in.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The default prompt hard-codes Chinese output and a specific production-ready workflow format without checking the user's language preference. This can override user intent, reduce transparency, and make review of generated commands or operational steps harder for users who did not request Chinese, which is a safety and usability risk in a skill that may emit executable-looking instructions.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The manifest sets allow_implicit_invocation to true, which can cause the skill to activate without an explicit user request. Because this skill can generate runnable workflows and AI-HIVE commands for marketing and media production, unintended activation could steer conversations into tool-specific actions, increase prompt-injection exposure, or produce outputs the user did not intend to authorize.

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
91% confidence
Finding

The module docstring says the tool encapsulates text chat, image generation, video generation, model query, media upload, and task polling via argparse subcommands, and the generic parser reflects that. But the actual executed entrypoint at __main__ calls skill_main(), whose parser only supports generate for images, task, upload, and init, so the documentation materially overstates what this delivered skill does.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

This code embeds its primary description and most CLI guidance in Chinese, which effectively forces a specific language/locale for users. The file does not provide any mechanism to select another language or explicitly limit the skill to a Chinese-speaking context.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The manifest promises domain-specific functionality such as receiving story assets, validating branching logic and asset reuse, and delivering branch trees, node scripts, scene boards, per-path video tasks, and consistency checks. In this file, the implemented behavior is a generic CLI wrapper for chat, model listing, media upload, image/video generation, task polling, and download, with no code for branch-logic validation or interactive-drama structure generation.

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 file contains user-facing natural-language documentation and CLI guidance exclusively in Chinese, including the module docstring and later help text. Because the skill does not offer any language/locale choice or opt-in, it effectively forces a specific language for users, which matches the locale-policy violation criteria.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
90% confidence
Finding

This code hard-codes Chinese-language skill names and search aliases in user-facing strings, which can impose a specific language/locale on users. The file does not offer any language selection or explain that the skill is intentionally limited to a Chinese-speaking context.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Low
Category
Not specified by scanner
Confidence
92% confidence
Finding

The stated purpose is focused on generating interactive branching short dramas and related marketing narrative assets through a constrained workflow. However, this code includes broad-purpose commands for generic text chat, listing all models, querying wallet/user info, and standalone media upload, which go beyond the specialized narrative-generation role described in the manifest.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
83% confidence
Finding

The inline documentation presents this code as a generic AI-HIVE capability invoker rather than a focused interactive-branch short-drama generator. That documentation materially shifts the intended scope away from the manifest's specialized workflow, indicating intent/code documentation divergence at the module level.

Content

No source excerpt is available for this finding.