Back to skill

Security audit

AI视频穿帮检测|AI-HIVE

Security checks for vulnerabilities and agentic risk

Overview

The skill is broadly disclosed as an AI-HIVE video QA and generation workflow, but its API clients can send API keys and uploaded media to an arbitrary configured endpoint.

Review before installing. Use only the default AI-HIVE endpoint, do not set AI_HIVE_BASE_URL or --base-url from untrusted instructions, avoid passing API keys on the command line, and upload only media you are authorized to send to AI-HIVE. Expect possible charges for generation tasks and keep human review for legal, brand, product, or privacy-sensitive claims.

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

Warning
Location
scripts/imagegen.py:64
Finding

API Credential Disclosure Through an Unrestricted Custom Base URL in Image Generation Client

Content
View full analysis

Vulnerability Details

File Location: scripts/imagegen.py:64-100, scripts/imagegen.py:131-143, and scripts/imagegen.py:571-573
Vulnerability Type: Credential disclosure through an attacker-controlled API endpoint
Risk Level: Medium

Vulnerable Code

python
def __init__(self, api_key=None, base_url=None, verbose=False):
    self.verbose = verbose
    self.api_key = self._resolve_api_key(api_key)
    self.base_url = self._resolve_base_url(base_url)

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"]
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 _request(self, method, url, **kwargs):
    self.config.log(f"{method} {url}")
    try:
        resp = requests.request(
            method, url, headers=self.headers, timeout=DEFAULT_TIMEOUT, **kwargs
        )
python
parser.add_argument("--api-key", help="AI Hive API Key (sk-api-*)")
parser.add_argument("--base-url", help=f"API Base URL (default {DEFAULT_BASE_URL})")

Technical Analysis

The client obtains an AI-HIVE API key from a command-line argument, environment variable, or local configuration file. Independently, i ...[truncated 1947 chars]

Remediation
View remediation

Remediation Suggestions

  1. Restrict authenticated production requests to an explicit allowlist, preferably only https://ai-hive.iclip.cn/api.
  2. Parse the destination with a standard URL parser and reject unsupported schemes, embedded credentials, unexpected ports, malformed hosts, redirects to untrusted hosts, and non-HTTPS URLs.
  3. If custom endpoints are required for development, require a clearly named opt-in flag such as --allow-untrusted-base-url and do not automatically attach production credentials to those endpoints.
  4. Use a separate development credential for custom servers and require interactive confirmation that identifies the exact destination host.
  5. Remove or discourage --api-key; prefer an environment variable or a configuration file protected with mode 0600.
  6. Ensure redirects cannot forward the Authorization header to a different origin.
  7. Add automated tests confirming that credentials are never sent to non-allowlisted hosts or over plaintext HTTP.

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/videogen.py:64
Finding

API Credential Disclosure Through an Unrestricted Custom Base URL in Video Generation Client

Content
View full analysis

Vulnerability Details

File Location: scripts/videogen.py:64-100, scripts/videogen.py:131-143, and scripts/videogen.py:571-573
Vulnerability Type: Credential disclosure through an attacker-controlled API endpoint
Risk Level: Medium

Vulnerable Code

python
def __init__(self, api_key=None, base_url=None, verbose=False):
    self.verbose = verbose
    self.api_key = self._resolve_api_key(api_key)
    self.base_url = self._resolve_base_url(base_url)

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"]
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 _request(self, method, url, **kwargs):
    self.config.log(f"{method} {url}")
    try:
        resp = requests.request(
            method, url, headers=self.headers, timeout=DEFAULT_TIMEOUT, **kwargs
        )
python
parser.add_argument("--api-key", help="AI Hive API Key (sk-api-*)")
parser.add_argument("--base-url", help=f"API Base URL (default {DEFAULT_BASE_URL})")

Technical Analysis

The video generation client duplicates the insecure endpoint-selection and credential-forwarding design found in the image client. A pr ...[truncated 1764 chars]

Remediation
View remediation

Remediation Suggestions

  1. Enforce https://ai-hive.iclip.cn/api as the production endpoint or use a narrowly documented host allowlist.
  2. Reject plaintext HTTP, unexpected ports, URL user-information fields, malformed hosts, and redirects to different origins.
  3. Bind each credential to its intended origin and never attach the AI-HIVE bearer token to a custom endpoint.
  4. Place custom endpoint support behind an explicit development-only option using a separate credential.
  5. Avoid command-line secret input. Use a protected configuration file or environment-based secret injection instead.
  6. Display and require confirmation of the resolved destination before uploading private media when a non-default development endpoint is enabled.
  7. Add regression tests that inspect outgoing requests and verify that authorization headers cannot reach untrusted origins.
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

A declared review-only skill that actually performs generation, browser/API-key setup, or other operational tasks can create both billing and data-handling risks beyond user expectations. In this business context, that mismatch is more dangerous because users may rely on the skill for compliance-sensitive ad/video QA while the actual functions could alter content, incur costs, or process secrets without clearly bounded authority.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

A declared review-only skill that actually performs generation, browser/API-key setup, or other operational tasks can create both billing and data-handling risks beyond user expectations. In this business context, that mismatch is more dangerous because users may rely on the skill for compliance-sensitive ad/video QA while the actual functions could alter content, incur costs, or process secrets without clearly bounded authority.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

A declared review-only skill that actually performs generation, browser/API-key setup, or other operational tasks can create both billing and data-handling risks beyond user expectations. In this business context, that mismatch is more dangerous because users may rely on the skill for compliance-sensitive ad/video QA while the actual functions could alter content, incur costs, or process secrets without clearly bounded authority.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

A declared review-only skill that actually performs generation, browser/API-key setup, or other operational tasks can create both billing and data-handling risks beyond user expectations. In this business context, that mismatch is more dangerous because users may rely on the skill for compliance-sensitive ad/video QA while the actual functions could alter content, incur costs, or process secrets without clearly bounded authority.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The advertised skill is for AI video continuity checking, but the implemented entrypoint only exposes image generation, upload, and task polling flows. This mismatch can cause users to upload sensitive review assets under false expectations and may lead an orchestrating agent to invoke generation capabilities when it intended analysis-only behavior, creating integrity and misuse risks.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The file advertises a video continuity/QC skill, but the implementation is a generic AI Hive client plus media generation tooling, including video generation and upload flows. This capability mismatch is dangerous because users or higher-level agents may invoke the skill expecting constrained analysis, while it can instead create or transform media, expanding the operational scope into content generation and potential misuse.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The embedded skill configuration labels the tool as 'AI视频穿帮检测', but the main generate path selects video-generation models and submits generation tasks rather than detecting continuity issues. In skill ecosystems, this kind of deceptive or inaccurate labeling is security-relevant because it can bypass human and automated review based on declared purpose, leading to unauthorized media creation under the guise of QA.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
95% confidence
Finding

The skill advertises executable workflows and includes commands that imply use of environment variables, filesystem access, network calls, and shell execution, but it declares no explicit tool scope or permissions boundary. In an agent setting, this can cause over-broad runtime authority, weak reviewability, and accidental exposure of sensitive capabilities such as API keys, local files, or external network access.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The manifest description defines use of the skill entirely through Chinese trigger phrases and Chinese-language task framing, which imposes a language constraint in natural-language instructions. The file does not explicitly offer multilingual use or user opt-in, and it does not justify the restriction as region-specific compliance or a locale-bounded tool.

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 prompt explicitly requires a "production-ready Chinese workflow," which imposes a language choice by default. This is a locale/language policy concern because the file does not indicate that the user can choose another language or opt into 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 natural-language strings in the docstring, argument description, and skill metadata are all fixed in Chinese, including the skill name 'AI视频穿帮检测|AI-HIVE' and default platform value '待确认'. This indicates a language-specific experience without any user choice, opt-in, or documented region-specific justification, which violates the language/locale policy criteria.

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

The skill is described as a continuity-check and audit tool, but this script performs active media modification operations such as trim, aspect conversion, muting, loudness normalization, and concatenation. That capability expansion increases the risk that the skill can be used to alter marketing or product videos in ways outside the declared review role, undermining least privilege and making misuse easier in a context that explicitly warns against deceptive content.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The file-level documentation presents the module as a general AI/video-capable OpenAPI tool, while the actual skill entrypoint is image-only. In an agent setting, this kind of capability confusion can result in unsafe tool selection, overbroad trust, and accidental processing of data or tasks the user did not intend to authorize.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

This Python skill contains user-facing natural-language descriptions, prompts, and help text in Chinese, beginning with the module docstring and continuing throughout the CLI. Under the stated policy, forcing a specific language without user opt-in is a natural-language policy violation unless the locale constraint is explicitly justified, which is not present here.

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 and all user-facing guidance are written exclusively in Chinese, presenting the skill as a general-purpose tool rather than a region-specific or Chinese-only skill. Because the file does not offer any user language choice or explain a justified locale restriction, this creates a natural-language locale policy concern.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The skill exposes text chat and image generation commands unrelated to a continuity-checking function. Extra undocumented capabilities increase attack surface and make it easier for an orchestrator or user to use the skill for tasks outside its stated authorization boundary, especially in environments that rely on metadata-based trust and least-privilege routing.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
78% confidence
Finding

The inline documentation presents this module as an editing utility, which diverges from the skill's stated purpose of video continuity checking and quality review. While not unsafe by itself, this documentation signals a different developer intent than the manifest and reinforces that the code is oriented toward transformation rather than inspection.

Content

No source excerpt is available for this finding.