Back to skill

Security audit

商品短视频脚本生成器|AI-HIVE

Security checks for vulnerabilities and agentic risk

Overview

The skill mostly matches an AI-HIVE product-video workflow, but it handles an API key in a way that can send the credential to a user-configurable server.

Install only if you trust the publisher and are comfortable giving it an AI-HIVE API key for product-video generation. Avoid setting custom base URLs, keep the API key low-privilege if possible, confirm parameters before any paid generation, and review uploads because selected local media files are sent to AI-HIVE or its returned storage endpoint.

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:91
Finding

Unrestricted API Base URL Can Expose the AI-HIVE Bearer Credential

Content
View full analysis

Vulnerability Details

File Location: scripts/videogen.py, lines 91–100 and 130–144
Vulnerability Type: Unrestricted credential forwarding to a configurable endpoint
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:
    """封装 AI Hive OpenAPI HTTP 调用。"""

    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 API base URL can be supplied through the --base-url command-line option, the AI_HIVE_BASE_URL environment variable, or the local configuration file. The value is used without validating its scheme or hostname.

AiHiveClient unconditionally attaches the AI-HIVE API key as an Authorization: Bearer header to requests constructed from this configurable base URL. Consequently, any party capable of influencing the command-line arguments, process environment, or configuration file can redirect authenticated requests to an arbitrary server.

The implementation also does not require HTTPS. A base URL using plain HTTP would transmit the credential without transport encryptio ...[truncated 1717 chars]

Remediation
View remediation

Remediation Suggestions

  1. Allowlist the production API origin by default. Reject URLs whose normalized hostname is not ai-hive.iclip.cn.

  2. Require HTTPS. Parse the URL with urllib.parse.urlparse and reject non-HTTPS schemes, embedded credentials, unexpected ports, fragments, and malformed hostnames.

  3. Do not automatically forward production credentials to custom origins. If custom endpoints are required for development, require a separate development credential and an explicit option such as --allow-custom-base-url.

  4. Add a high-friction confirmation for custom endpoints. Display the normalized destination origin and warn that an authorization credential will be sent. Non-interactive use should require a dedicated acknowledgement flag.

  5. Separate authentication policy from generic request handling. Attach the bearer header only after verifying that the request destination matches the approved API origin.

  6. Protect configuration integrity. Continue enforcing restrictive file permissions and additionally validate the stored base_url before using it.

  7. Prevent redirects from forwarding credentials to another origin. Disable redirects for authenticated API requests or validate every redirect target before following it.

  8. Add regression tests covering malicious HTTP URLs, deceptive subdomains, embedded user information, alternate ports, malformed URLs, and unapproved HTTPS hosts.

A hardened validation pattern could resemble:

python
from urllib.parse import urlparse

ALLOWED_API_HOSTS = {"ai-hive.iclip.cn"}

def validate_base_url(value):
    parsed = urlparse(value)
    if parsed.scheme != "https":
        raise SystemExit("The API base URL must use HTTPS")
    if parsed.hostname not in ALLOWED_API_HOSTS:
        raise SystemExit("The API base URL host is not approved")
    if parsed.username or parsed.password:
        raise SystemExit("Embedded URL credentials are not
...[truncated 138 chars]
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 (12)

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

The documented purpose is a constrained product-video script generator, but the described/code-detected behavior expands into generic account inspection, wallet balance queries, model enumeration, generic chat/image generation, media upload, polling, download, and arbitrary video generation. This capability mismatch is dangerous because users, reviewers, or orchestrators may grant trust and permissions based on the narrow description while the skill can perform materially broader actions, including potentially billable operations, data transfer, and access to account-level information.

Content

No source excerpt is available for this finding.

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 77)May include surrounding context.

md
python3 scripts/videogen.py init --skill-name product-video-script-generator-ai-hive

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 79)May include surrounding context.

md
python3 scripts/videogen.py init --skill-name product-video-script-generator-ai-hive

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The file is presented as a specialized product-video-script skill, but the code implements a broad AI Hive CLI with generic chat, model enumeration, uploads, account queries, and image/video generation. This expands the capability and trust boundary far beyond the declared purpose, enabling operators or downstream agents to use the skill as a general API wrapper rather than a constrained video-script tool.

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 workflows involving shell commands, environment variables, filesystem access, and networked API calls, but it does not declare any explicit tool scope or permissions boundaries. That creates a least-privilege failure: an agent or reviewer cannot tell what capabilities are intended, increasing the chance that the skill is run with broader access than necessary and enabling unintended file, network, or secret exposure if invoked in a permissive environment.

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 production-ready workflow without checking the user's language preference or consent. This can cause unintended behavior, reduce transparency, and make it easier for the skill to override user intent, though the direct security impact is limited compared with code execution or data exfiltration issues.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The skill enables implicit invocation with no trigger constraints, so the agent may automatically activate this workflow in situations the user did not clearly intend. Because the skill can produce runnable AI-HIVE commands and operational workflows, over-broad auto-invocation increases the risk of unauthorized generation of marketing content, external API usage, or policy-bypassing assistance in adjacent contexts.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The file embeds Chinese-only natural-language identifiers in the module docstring, argument parser description, skill name, and search aliases. Because the skill does not offer a language/locale option or state that it is intentionally limited to a Chinese-language or region-specific workflow, this appears to impose a specific language without user opt-in.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The top-level docstring and parser description explicitly present the file as a '通用 AI 能力调用工具' and '裸接口视频 Skill', while the manifest claims a specialized product video script generator with constrained ecommerce-oriented intent. This is an active documentation-level contradiction about the tool’s intended scope, not merely missing detail.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The module docstring is entirely in Chinese and frames the tool as a general-purpose skill, while the CLI help and user-facing messages throughout the file are also fixed to Chinese. For a general skill, this is a natural-language locale policy issue because users are not offered any language or locale opt-in or alternative.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

Exposing a user-info command gives the skill access to account metadata and wallet/balance information that is unrelated to product video script generation. In an agent environment, this unnecessary capability increases the blast radius of prompt misuse, tool confusion, or unauthorized reconnaissance against the connected account.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The generic chat path accepts arbitrary system and user prompts and can upload images, making the skill usable as an unrestricted multimodal LLM proxy. That is inconsistent with the advertised product-video-script purpose and could be abused to bypass policy scoping, perform unrelated tasks, or exfiltrate sensitive prompt/context through an external API.

Content

No source excerpt is available for this finding.