Back to skill

Security audit

直播带货脚本工作台|AI-HIVE

Security checks for vulnerabilities and agentic risk

Overview

The skill is mostly aligned with live-commerce script and media workflows, but it handles API keys in a way that can send them to an untrusted custom API endpoint.

Review before installing. Use only the default AI-HIVE endpoint unless you fully trust a custom endpoint, avoid setting AI_HIVE_BASE_URL from untrusted instructions, and treat ~/.ai-hive/config.json as sensitive because it stores API credentials used for potentially chargeable media-generation actions.

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

AI-HIVE API Key Disclosure Through an Unrestricted Base URL in the Image Generation Client

Content
View full analysis

Vulnerability Details

File Location: scripts/imagegen.py, lines 94-101 and 125-143
Vulnerability Type: Credential disclosure through an attacker-controlled API 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
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 resolves its API base URL from the --base-url argument, the AI_HIVE_BASE_URL environment variable, or the persistent configuration file without validating the URL scheme or destination host. It then attaches the AI-HIVE bearer credential to every request made through that base URL.

Consequently, an attacker who can influence a generated command, process environment, or ~/.ai-hive/config.json can redirect authenticated requests to an attacker-controlled server. The code does not require HTTPS, restrict the destination to the documented AI-HIVE host, or request confirmation before forwarding the credential to a different origin.

Attack Path

  1. The victim has a valid API key in AI_HIVE_API_KEY or ~/.ai-hive/config.json.
  2. An attacker causes the victim to set `AI_ ...[truncated 928 chars]
Remediation
View remediation

Remediation Suggestions

  1. Restrict authenticated requests to an explicit allowlist of trusted AI-HIVE origins, using exact normalized scheme, hostname, and port comparisons.
  2. Require HTTPS and reject plaintext HTTP, URL user-information components, unsupported schemes, malformed URLs, and unexpected ports.
  3. If custom endpoints are legitimately required, do not send the production AI-HIVE credential to them by default. Require a separate credential and an explicit interactive confirmation that names the destination origin.
  4. Do not persist an arbitrary base URL in the same configuration record as the API key.
  5. Normalize URLs with a standard URL parser rather than relying on rstrip("/").
  6. Disable automatic redirects for authenticated requests or verify every redirect destination before retaining the Authorization header.
  7. Add tests covering malicious environment variables, HTTP endpoints, look-alike domains, user-information URLs, and cross-origin redirects.
  8. Advise affected users to rotate their API keys if they previously used an untrusted custom base URL.

T09 · Insecure Skill Coding Practices

Error
Location
scripts/videogen.py:94
Finding

AI-HIVE API Key Disclosure Through an Unrestricted Base URL in the Video Generation Client

Content
View full analysis

Vulnerability Details

File Location: scripts/videogen.py, lines 94-101 and 125-143
Vulnerability Type: Credential disclosure through an attacker-controlled API 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
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 trusts API origins supplied through command-line arguments, environment variables, or persistent configuration. No scheme validation, hostname allowlist, or credential-origin binding is applied. The client subsequently sends the same bearer credential in the Authorization header to the selected origin.

This creates a credential exfiltration primitive: control of the base URL is sufficient to make an otherwise legitimate client operation disclose the API key. Allowing a plaintext HTTP endpoint additionally exposes the credential to network interception.

Attack Path

  1. The victim configures a valid AI-HIVE API key.
  2. An attacker influences the victim's shell environment, persistent AI-HIVE configuration, or command line so that the base URL points to an ...[truncated 752 chars]
Remediation
View remediation

Remediation Suggestions

  1. Bind the AI-HIVE API credential to the documented trusted HTTPS origin and reject unapproved hosts.
  2. Parse and normalize custom URLs before use; reject non-HTTPS schemes, embedded credentials, fragments, unexpected ports, malformed hostnames, and look-alike domains.
  3. Use a separate credential for explicitly supported custom deployments rather than forwarding the AI-HIVE production key.
  4. Require clear interactive approval before contacting a non-default endpoint and display the normalized destination.
  5. Prevent authenticated requests from following redirects to another origin, or strip credentials and validate the redirect target before continuing.
  6. Separate credential storage from endpoint configuration and protect configuration integrity.
  7. Add automated security tests for malicious --base-url values, environment poisoning, configuration tampering, plaintext HTTP, and cross-origin redirects.
  8. Rotate any key that may already have been sent to an untrusted endpoint.
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
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (24)

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The skill promises a structured live-commerce deliverable and controlled generation workflow, but the actual behavior appears to be a generic AI/media wrapper with browser/API-key setup and output generation. That discrepancy can mislead users into providing business data or authorizing paid operations under false assumptions about safeguards, review steps, and intended use.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The skill promises a structured live-commerce deliverable and controlled generation workflow, but the actual behavior appears to be a generic AI/media wrapper with browser/API-key setup and output generation. That discrepancy can mislead users into providing business data or authorizing paid operations under false assumptions about safeguards, review steps, and intended use.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding

The skill promises a structured live-commerce deliverable and controlled generation workflow, but the actual behavior appears to be a generic AI/media wrapper with browser/API-key setup and output generation. That discrepancy can mislead users into providing business data or authorizing paid operations under false assumptions about safeguards, review steps, and intended use.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The skill promises a structured live-commerce deliverable and controlled generation workflow, but the actual behavior appears to be a generic AI/media wrapper with browser/API-key setup and output generation. That discrepancy can mislead users into providing business data or authorizing paid operations under false assumptions about safeguards, review steps, and intended use.

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/imagegen.py init --skill-name live-commerce-script-studio-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/imagegen.py init --skill-name live-commerce-script-studio-ai-hive

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
python3 scripts/videogen.py init --skill-name live-commerce-script-studio-ai-hive

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
python3 scripts/videogen.py init --skill-name live-commerce-script-studio-ai-hive

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The file is presented as a live-commerce script workstation, but the implementation is a broadly capable AI-Hive client for chat, upload, model discovery, and media generation. This mismatch expands the actual capability surface beyond what reviewers or users would reasonably expect, which can enable unreviewed or unintended use under a misleading skill identity.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
91% confidence
Finding

The skill includes executable examples and implies capabilities involving environment variables, local files, network access, and shell/ffmpeg usage, yet it declares no explicit tool scope or permission boundaries. This can cause the agent runtime or reviewer to underestimate what the skill may access, increasing the chance of over-privileged execution or unsafe invocation of external resources.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The activation criteria extend beyond live-commerce scripting into broad marketing, advertising, social media, short drama, and 'stable delivery' requests. Overbroad routing can cause the skill to be invoked for loosely related tasks, exposing users to unnecessary external actions, misapplied outputs, or capabilities outside the intended trust boundary.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The skill metadata enables broad implicit invocation and describes a wide range of marketing, scripting, workflow, and runnable-command generation behavior without tight trigger boundaries. This can cause the agent to activate in contexts the user did not clearly intend, increasing the chance of unintended tool use, generation of executable AI-HIVE commands, or policy-bypassing assistance in adjacent high-risk marketing scenarios.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The default prompt hard-codes Chinese output regardless of the user's language preference, which can reduce user awareness and informed consent about what the skill is doing. In a security-sensitive workflow, forcing a language can obscure warnings, constraints, or generated executable steps, making misuse or misunderstanding 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

This Python file contains user-facing natural-language strings entirely in Chinese, including the module docstring, argument parser description, skill name, and search aliases. Because the skill does not provide any language or locale opt-in, it appears to impose a specific language on users, which matches the policy category for language/locale constraints without user choice.

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:

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The module docstring and all user-facing guidance in this file are written exclusively in Chinese, including setup instructions and operational messages. Because the skill does not offer any language selection or state that it is intentionally limited to Chinese users, it creates a natural-language locale constraint without user opt-in.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The packaged skill advertises a narrow live-commerce script workstation, but the exposed entrypoints actually provide generic image generation, arbitrary media upload, and task retrieval against a broader AI API. This mismatch weakens user and platform trust boundaries: operators may authorize or invoke the skill believing it is purpose-limited, while it can process broader prompts and content than the manifest suggests.

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 and user-facing CLI text are written exclusively in Chinese, and the skill provides no indication that users may choose another language or that the skill is intentionally region-specific. Under the policy, forcing a specific language without user opt-in is a natural-language policy violation.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

Exposing a generic user/account inspection endpoint is unrelated to the declared live-commerce scripting purpose and increases the skill's access to account metadata and balance information. Even if limited to the current user's account, this is unnecessary privileged functionality that widens the attack surface and can leak sensitive operational information through a mis-scoped skill.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

Unrestricted enumeration of TEXT, IMAGE, and VIDEO models gives this narrowly branded skill broad discovery capability over backend services outside its stated use case. That makes the skill more useful as a generic platform exploration tool, increasing the chance of misuse, accidental policy bypass, or access to capabilities that were not intended to be exposed through this workflow.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill-specific parser describes a video generation tool rather than the broader live-commerce scripting workstation claimed in metadata. This inconsistency is dangerous because it obscures the true behavior of the package and undermines trust in security review, making it easier for broader or different capabilities to be shipped under an inaccurate label.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

The manifest description defines usage entirely through Chinese trigger phrases and a Chinese-language live-commerce workflow, but it does not say the skill is China-specific or offer language/locale opt-in. Under the stated policy, forcing a specific language without user choice can be a natural-language policy violation.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
83% confidence
Finding

The top-level docstring says this file is a "通用 AI 能力调用工具" wrapping text chat, image generation, video generation, model query, media upload, and polling via argparse subcommands. However, the actual executed entrypoint is skill_main(), whose parser only exposes skill-specific generate, task, upload, and init flows centered on image generation for this named skill.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Low
Category
Not specified by scanner
Confidence
78% confidence
Finding

The module includes a get_user_info endpoint and a user-info command advertised as querying user information and wallet balance. That capability is not justified by the stated skill purpose of producing live-commerce scripts and related promotional media assets, especially since the skill-specific CLI does not need account introspection to generate outputs.

Content

No source excerpt is available for this finding.