Back to skill

Security audit

珠宝微距闪耀细节视频|AI-HIVE

Security checks for vulnerabilities and agentic risk

Overview

The skill mostly matches its AI-HIVE jewelry video purpose, but it can send the user's AI-HIVE API key to an arbitrary configured API URL.

Review this skill before installing if you use a real AI-HIVE API key. Only use the official AI-HIVE API URL, avoid setting AI_HIVE_BASE_URL or --base-url to untrusted hosts, and confirm parameters before running commands that upload media or may incur generation costs.

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

Caller-Controlled API Base URL Can Expose the AI-HIVE Bearer Credential

Content
View full analysis

Vulnerability Details

File Location: scripts/videogen.py:88-98, scripts/videogen.py:121-124, and scripts/videogen.py:134-136
Vulnerability Type: Unrestricted authenticated endpoint configuration
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",
    }
python
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 accepted without validating its scheme or hostname.

AiHiveClient subsequently attaches the AI-HIVE API key as a bearer token to every API request made against the selected base URL. Consequently, any party capable of influencing one of these configuration sources can redirect authenticated requests to a server they control.

The issue also permits an http:// endpoint, which could expose the bearer credential through plaintext network transmission. This behavior exceeds the minimum privileges necessary for the declared functionality because normal operation only requires authenticated access to the legitimate AI-HIVE API.

Attack Path

  1. An attacker influences a generated command, process environment, or ~/.ai-hive/config.json.
  2. The attacker sets t ...[truncated 1587 chars]
Remediation
View remediation

Remediation Suggestions

  1. Restrict authenticated API requests to the official origin:

    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("Untrusted API host")
        if parsed.username or parsed.password:
            raise SystemExit("Credentials are not allowed in the API URL")
        return value.rstrip("/")
    
  2. Apply validation consistently to command-line, environment, and configuration-file values.

  3. If custom endpoints are needed for development, require an explicit opt-in development mode and use a separate test credential. Do not send production credentials to custom origins.

  4. Construct authorization headers only after confirming that the destination origin is trusted. Avoid storing the bearer header as a client-wide default that can be applied to arbitrary URLs.

  5. Disable redirects for authenticated requests or validate every redirect destination before forwarding credentials:

    python
    requests.request(
        method,
        url,
        headers=self.headers,
        timeout=DEFAULT_TIMEOUT,
        allow_redirects=False,
        **kwargs,
    )
    
  6. Add automated tests confirming rejection of:

    • Non-HTTPS URLs.
    • Unapproved hostnames.
    • URLs containing embedded credentials.
    • Lookalike and subdomain-confusion hosts.
    • Configuration-file and environment-based endpoint overrides outside the allowlist.
  7. Rotate any API keys that may previously have been used with an untrusted base URL.

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

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

The declared description presents a much broader operational skill centered on producing jewelry macro sparkle videos, including handling creative inputs and integrating with AI-HIVE OpenAPI for asset upload, job routing, polling, and result download. The supplied code does none of that. Its sole behavior is to collect a few command-line fields and emit a static draft blueprint JSON file. While the blueprint is related to the same domain and could be a supporting preproduction step, the implemented primary purpose is materially narrower than the declared functionality. Therefore this is a description-behavior mismatch.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

There is a clear description-behavior mismatch. The declared purpose describes a domain-specific creative generation pipeline for luxury jewelry micro-video production, with external API orchestration and content-analysis/generation features. The actual code only exposes generic ffmpeg-based editing utilities: probe, trim, aspect conversion, mute, loudness normalization, and concat. While video editing is loosely adjacent to media workflows, the primary purpose and capabilities are materially different from the declared specialized jewelry-video generation service. Therefore this should be flagged as a mismatch.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The file markets itself as a jewelry macro video skill, but the implementation is a broad AI Hive client supporting text chat, image generation, model discovery, uploads, task polling, and account queries. This scope mismatch violates least privilege and increases the attack surface, because a caller who is allowed to use a narrow media skill can instead access unrelated capabilities through the same packaged tool.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The generic multimodal chat endpoint is unrelated to the declared jewelry video generation purpose and materially expands what the skill can do with the configured API key. This creates a capability-smuggling risk: a seemingly narrow content-production skill can be used as a general LLM interface, potentially processing arbitrary prompts and uploaded images outside the intended workflow.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
84% confidence
Finding

The skill advertises executable commands and operational flows involving environment variables, local files, networking, and shell usage, but it declares no explicit tool scope or permission boundaries. In an agent environment, that increases the chance the skill is invoked with broader-than-necessary capabilities, enabling unintended file, network, or command execution if later implemented or interpreted automatically.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The activation list includes "高端商品" as a standalone trigger, which is not specific to jewelry macro-detail video generation and could match many unrelated shopping, branding, or product-marketing requests. The file does not provide negative examples or tighter constraints for this phrase within the trigger list, increasing the risk of unintended invocation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The default prompt hard-codes Chinese output regardless of the user's language preference, which can override user intent and cause the agent to produce content in an unexpected language. In a workflow-generating skill, this increases the chance of user confusion, missed safety cues, or accidental execution of misunderstood instructions, though it is not directly a code-execution issue.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

Enabling implicit invocation without narrow trigger constraints allows the skill to activate automatically in response to broadly related requests, even when the user did not clearly intend to use it. Because this skill can generate runnable AI-HIVE commands and production workflows involving uploads, routing, polling, and downloads, unintended activation could lead to unexpected external actions, cost-incurring operations, or unsafe content-generation assistance.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The file-level docstring and argparse description specify the skill entirely in Chinese, and the generated content also uses Chinese labels. There is no indication that the user can choose a language or that the locale restriction is required for a region-specific purpose, which creates a natural-language policy concern.

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

This Python skill embeds its top-level description entirely in Chinese, and the CLI help/output strings throughout the file are likewise Chinese-only. Because the skill does not offer a language choice or document this as a justified region-specific constraint, it can force a specific locale on users in a way that violates the stated language/locale policy.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

Exposing user-info and model-listing functionality is not required to generate jewelry detail videos, yet it allows account metadata access and broad service enumeration. In a skill ecosystem, this can facilitate reconnaissance, reveal billing or capability information, and help pivot into other unsupported model uses.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

Standalone image generation goes beyond the claimed video-focused jewelry workflow and enables broader API use than users or platform reviewers may expect. While less severe than unrestricted chat, it still weakens containment by turning a specialized video skill into a more general media-generation client.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

The file consistently instructs use in Chinese and provides all trigger and workflow language only in Chinese, but it does not state that the skill is intentionally limited to Chinese-speaking users or offer an opt-in language/locale choice. Under the policy, forcing a specific language without user opt-in can be a natural-language policy violation unless clearly documented and justified.

Content

No source excerpt is available for this finding.