Back to skill

Security audit

游戏买量广告创意|AI-HIVE

Security checks for vulnerabilities and agentic risk

Overview

The skill is mostly coherent for AI-HIVE video-ad workflows, but it lets a configurable API endpoint receive the user's bearer API key without host or HTTPS validation.

Review this skill before installing if you will use a real AI-HIVE API key. Only use the official endpoint, avoid setting --base-url or AI_HIVE_BASE_URL from untrusted instructions, inspect ~/.ai-hive/config.json before use, and revoke the key if it may have been sent to a non-official host.

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

Configurable API Endpoint Can Exfiltrate the Bearer API Key

Content
View full analysis

Vulnerability Details

File Location: scripts/videogen.py, lines 91–100 and 130–143
Vulnerability Type: Unrestricted credential forwarding to a configurable endpoint
Risk Level: High

Complete Code Snippet

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 calls."""

    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 custom endpoint is exposed through the CLI at line 587:

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

Technical Analysis

The client permits its API base URL to be controlled through a command-line argument, the AI_HIVE_BASE_URL environment variable, or the local configuration file. It does not require HTTPS and does not validate the destination against an approved hostname list.

The client independently constructs an Authorization header containing the resolved AI-HIVE API key and attaches it to every API request. Consequently, selecting an attacker-controlled base URL causes the legitimate bearer credential to be transmitted directly to that server.

Supporting custom deployments can be l ...[truncated 1660 chars]

Remediation
View remediation

Remediation Suggestions

  1. Allow only https:// endpoints and reject URLs containing user information, fragments, unexpected ports, or non-HTTP(S) schemes.
  2. Permit the default production hostname through an explicit allowlist. If additional official hosts are required, enumerate them rather than accepting arbitrary destinations.
  3. Disable custom base URLs by default. Place development endpoints behind a conspicuous option such as --allow-custom-endpoint.
  4. Do not reuse a production API key when the destination host differs from the official service. Require a separately supplied credential after displaying the exact destination.
  5. Reject redirects to different origins, or remove the authorization header before any cross-origin redirect.
  6. Validate configuration-file ownership and reject files writable by other users, in addition to tightening read permissions.
  7. Display a warning and require confirmation before sending credentials to a non-default endpoint.
  8. Add automated tests verifying that HTTP URLs, unapproved hosts, cross-origin redirects, and malformed URLs cannot receive the bearer token.
  9. If exposure is suspected, revoke the affected key, issue a replacement, and review account usage and billing records.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • 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 (10)

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

This finding indicates the skill exposes additional undeclared capabilities such as generic chat/image generation, account or wallet data retrieval, model enumeration, browser-based API-key setup, and local credential storage, while failing to implement the specialized ad-safety and authorization logic it claims as central. In a skill handling paid API operations and media assets, hidden credential flows and undeclared account access materially increase the risk of secret leakage, unintended billing, privacy exposure, and misuse beyond the user's expectations.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

This finding indicates the skill exposes additional undeclared capabilities such as generic chat/image generation, account or wallet data retrieval, model enumeration, browser-based API-key setup, and local credential storage, while failing to implement the specialized ad-safety and authorization logic it claims as central. In a skill handling paid API operations and media assets, hidden credential flows and undeclared account access materially increase the risk of secret leakage, unintended billing, privacy exposure, and misuse beyond the user's expectations.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
94% confidence
Finding

The skill advertises executable code paths involving environment variables, filesystem access, network calls, and shell-based local video processing, but does not declare any explicit tool scope or permissions boundary. This creates an authorization and review gap: downstream systems or users cannot easily tell what capabilities the skill may invoke, which increases the chance of over-privileged execution, unsafe secret handling, or unintended local command execution.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The default prompt hard-codes Chinese output ('production-ready Chinese workflow') without any indication that the user's language preference should be respected. This can override user intent, reduce transparency, and cause misleading or inaccessible responses for users expecting another language, though it does not directly enable code execution or data exfiltration.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

This code embeds Chinese-only natural-language identifiers and search aliases in the docstring, CLI description, skill name, and metadata. That creates a language/locale constraint without any visible opt-in, fallback, or explanation that the skill is intended only for a Chinese-language audience.

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 file presents itself and functions as a general-purpose AI Hive client rather than a narrowly scoped game UA ad-creative skill. That capability mismatch increases the attack surface and can let callers invoke unrelated functions such as chat, model enumeration, account lookup, and media operations that are outside the declared business purpose, undermining least-privilege and user expectations.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

Describing the module as a universal AI capability tool while advertising the skill as a specialized UA-creative workflow is a scope deception issue. Users and orchestrators may trust the manifest-level constraints, but the code exposes broader behaviors than promised, which makes misuse and accidental overreach more likely.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The module docstring and user-facing guidance are written entirely in Chinese, and the CLI help and runtime prompts throughout the file assume Chinese-language output. For a general-purpose skill, this imposes a locale/language constraint without documenting an opt-in or presenting alternatives.

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 endpoint that returns account details and wallet balance is not necessary for generating game acquisition creatives and can disclose sensitive account metadata to anyone able to invoke the skill. In a skill context, unnecessary account introspection is dangerous because it enables information gathering and violates the principle of minimal data access.

Content

No source excerpt is available for this finding.