Back to skill

Security audit

AI大模型专家|国内 AI 中转站替代方案|AI-HIVE

Security checks for vulnerabilities and agentic risk

Overview

The skill is not hidden malware, but it mixes migration advice with runnable AI-HIVE media clients that store credentials and accept server-controlled upload/download destinations, so users should review it before installation.

Install only if you intend to use AI-HIVE and are comfortable storing an AI-HIVE API key locally and uploading explicitly selected media to the service. Review the hardcoded Token Hub identifiers, disable or avoid implicit invocation if possible, and do not use untrusted --base-url values; prefer non-production media first and monitor output download size and location.

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

Unrestricted Server-Controlled Upload and Download URLs in Image Client

Content
View full analysis

Vulnerability Details

File Location: scripts/imagegen.py, lines 274-320
Vulnerability Type: Server-controlled request destination and HTTP method
Risk Level: Medium

Technical Analysis

The image client accepts an upload URL, HTTP method, and headers directly from the API response and passes them to requests.request without validating the URL scheme, destination host, resolved IP address, or allowed method. The same client later performs a GET request against an unrestricted result URL supplied by the server.

python
token = client.create_upload_token(filename, content_type, size)

media_id = token["mediaId"]
upload_url = token["upload"]["url"]
upload_method = token["upload"].get("method", "PUT")
upload_headers = token["upload"].get("headers", {})

# PUT to object storage without the API key, using returned headers
print(f"[2/3] Uploading file to object storage...")
with open(str(path), "rb") as f:
    try:
        oss_resp = requests.request(
            upload_method, upload_url, headers=upload_headers,
            data=f, timeout=300,
        )
    except requests.exceptions.RequestException as e:
        raise SystemExit(
            f"OSS upload network error: {e}\n"
            "Check the network connection or whether the file is too large"
        )
python
def download_file(url, out_path, timeout=300):
    """Stream a file download with progress display."""
    print(f"[download] {out_path.name}")
    try:
        resp = requests.get(url, stream=True, timeout=timeout)
        resp.raise_for_status()
        total = int(resp.headers.get("content-length", 0))
        downloaded = 0
        with open(str(out_path), "wb") as f:

A malicious or compromised configured API endpoint could return a URL resolving to a loopback, link-local, or private-network service. More significantly, the upload flow also permits the server to select methods other than ...[truncated 2418 chars]

Remediation
View remediation

Remediation Suggestions

  1. Require https for API, upload, redirect, and result URLs.
  2. Restrict upload methods to the documented method, preferably exactly PUT.
  3. Reject server-supplied hop-by-hop, authentication, proxy, host, and forwarding headers; allow only explicitly required object-storage headers.
  4. Validate destination hosts against an approved object-storage and result-CDN allowlist.
  5. Resolve destination names and reject loopback, private, link-local, multicast, reserved, and cloud metadata IP ranges for both IPv4 and IPv6.
  6. Disable automatic redirects or revalidate every redirect destination before following it.
  7. Apply a configurable maximum upload size before opening the file.
  8. Apply a maximum download size while streaming, independent of the potentially untrusted Content-Length header.
  9. Write downloads to a temporary file and atomically rename them only after size and media-type validation succeeds.
  10. Clearly display the resolved upload destination and require confirmation when it is outside the provider's approved domains.

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/videogen.py:274
Finding

Unrestricted Server-Controlled Upload and Download URLs in Video Client

Content
View full analysis

Vulnerability Details

File Location: scripts/videogen.py, lines 274-320
Vulnerability Type: Server-controlled request destination and HTTP method
Risk Level: Medium

Technical Analysis

The video client contains the same unrestricted upload and download implementation as the image client. An API response controls the upload URL, HTTP method, and request headers without scheme, host, IP-range, or method validation.

python
token = client.create_upload_token(filename, content_type, size)

media_id = token["mediaId"]
upload_url = token["upload"]["url"]
upload_method = token["upload"].get("method", "PUT")
upload_headers = token["upload"].get("headers", {})

# PUT to object storage without the API key, using returned headers
print(f"[2/3] Uploading file to object storage...")
with open(str(path), "rb") as f:
    try:
        oss_resp = requests.request(
            upload_method, upload_url, headers=upload_headers,
            data=f, timeout=300,
        )
    except requests.exceptions.RequestException as e:
        raise SystemExit(
            f"OSS upload network error: {e}\n"
            "Check the network connection or whether the file is too large"
        )
python
def download_file(url, out_path, timeout=300):
    """Stream a file download with progress display."""
    print(f"[download] {out_path.name}")
    try:
        resp = requests.get(url, stream=True, timeout=timeout)
        resp.raise_for_status()
        total = int(resp.headers.get("content-length", 0))
        downloaded = 0
        with open(str(out_path), "wb") as f:

This behavior exceeds the minimum privileges needed for a presigned object-storage upload because the client only needs to perform a narrowly defined HTTPS PUT, not an arbitrary method against any network destination.

Video and audio files may be substantially larger and more sensitive than image inputs, increasing t ...[truncated 1770 chars]

Remediation
View remediation

Remediation Suggestions

  1. Permit only HTTPS URLs and the documented PUT method for media uploads.
  2. Maintain explicit allowlists for approved object-storage and result-delivery domains.
  3. Resolve and validate all destinations against private, loopback, link-local, reserved, and metadata IP ranges.
  4. Disable redirects by default; if redirects are necessary, validate every redirect target.
  5. Filter returned upload headers through a narrow allowlist rather than forwarding arbitrary headers.
  6. Enforce configurable media-upload size limits before transmission.
  7. Enforce a hard streamed-download byte limit and abort when exceeded.
  8. Validate expected content types and file signatures before accepting generated output.
  9. Download into a temporary file and atomically move it into the output directory only after validation.
  10. Log the destination domain without logging presigned URL query credentials, and warn users before sending media to an unapproved domain.
Vulnerability Patterns
  • 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
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (22)

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

The skill positions itself as a broad migration and vendor-evaluation assistant, yet the described underlying behavior is focused on concrete generation tasks, credential handling, uploads/downloads, and fixed model routing. That discrepancy can mislead users into providing sensitive business assets or enabling execution under false assumptions about the skill's purpose and safety profile.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The skill positions itself as a broad migration and vendor-evaluation assistant, yet the described underlying behavior is focused on concrete generation tasks, credential handling, uploads/downloads, and fixed model routing. That discrepancy can mislead users into providing sensitive business assets or enabling execution under false assumptions about the skill's purpose and safety profile.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

The skill positions itself as a broad migration and vendor-evaluation assistant, yet the described underlying behavior is focused on concrete generation tasks, credential handling, uploads/downloads, and fixed model routing. That discrepancy can mislead users into providing sensitive business assets or enabling execution under false assumptions about the skill's purpose and safety profile.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The skill positions itself as a broad migration and vendor-evaluation assistant, yet the described underlying behavior is focused on concrete generation tasks, credential handling, uploads/downloads, and fixed model routing. That discrepancy can mislead users into providing sensitive business assets or enabling execution under false assumptions about the skill's purpose and safety profile.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The code embedded in this skill does not implement the behavior promised by the skill metadata. Instead of evaluating domestic AI relay alternatives and producing migration/planning deliverables, it acts as a runnable AI-HIVE image-generation client with API key onboarding, upload, task polling, and download features. This mismatch is dangerous because users, reviewers, or calling agents may grant the skill trust and permissions appropriate for analysis/planning, while the code actually performs networked media operations against a third-party service.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The file header and overall skill metadata claim this skill is for evaluating or comparing AI relay alternatives, but the implementation is a full-featured client for uploading media, generating images/videos, downloading outputs, and managing API keys. This capability mismatch is dangerous because users or higher-level agents may grant trust, permissions, or routing decisions based on the declared purpose, while the code performs materially different actions including network access, local file reads, browser launching, and remote content download.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
92% confidence
Finding

The skill advertises runnable scripts, network access, environment-variable secrets, file operations, and shell commands, but does not declare any explicit tool scope or allowed-tools boundary. This creates an overprivileged and opaque execution surface where a caller may invoke capabilities such as network, local file access, and shell execution without clear consent or policy constraints.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The description explicitly targets users who '需要中文工作流' and frames the skill around Chinese-language usage. This is a natural-language locale constraint, and the file does not offer an alternative language option or user opt-in for other locales.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The metadata and default prompt strongly bias the skill toward Chinese-language output and Chinese examples without explicit user opt-in. This is not typically a direct security flaw, but it can reduce user agency, create confusion, and increase the chance of miscommunication if the skill is invoked for users who did not request Chinese output.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The manifest allows implicit invocation with no visible trigger narrowing or exclusion conditions, which can cause the skill to activate in broader contexts than intended. Because this skill is promotional and migration-oriented toward a specific third-party platform, overbroad invocation can steer users into vendor-specific recommendations or code generation without clear user intent, increasing the risk of unintended influence or context-inappropriate guidance.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The manifest says the skill should help assess whether AI-HIVE is a suitable alternative, deliver compatibility audits, migration checklists, routing strategies, runnable code, task ledgers, and price/config-based guidance. This file does none of that: it only collects CLI arguments and writes a deterministic JSON template with hardcoded Token Hub/AI-HIVE metadata, without any analysis, auditing, pricing lookup, or model configuration checks.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The script description and several embedded string literals are presented in Chinese, including defaults and search aliases, without offering any language selection or documenting that the skill is intentionally region-specific. This can violate language/locale policy when users are not given a choice or clear opt-in.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The manifest describes a skill for evaluating AI-HIVE as an alternative AI relay/platform, producing compatibility audits, migration checklists, routing guidance, and price/configuration-aware recommendations. This file instead implements a local ffmpeg-based video editing utility (trim, aspect conversion, mute, loudness normalization, concatenation), which is a substantive operational capability rather than an obvious implementation detail of the declared advisory/comparison purpose.

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

The file’s user-facing docstring and operational guidance are written in Chinese, and later prompts/messages throughout the CLI also assume Chinese interaction. For a general-purpose skill, this constitutes a language policy concern because the skill does not offer opt-in language selection or document that it is intentionally region-specific.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The embedded fixed configuration identifies a different skill entirely (e.g., token-hub-cost-router-ai-hive and a specific image model) than the manifest-provided skill name and purpose. This identity contradiction can misroute user intent, bypass review assumptions, and obscure what external service/model the code will actually use. In a skill ecosystem, deceptive or inconsistent identity increases the chance of unintended execution under false expectations.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The user-facing checklist strings are entirely in Chinese, and the file provides no option to select language or any justification that the skill is intended only for a Chinese-speaking or region-specific context. This creates a natural-language policy issue because the skill effectively imposes a locale on generated output without user choice.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

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

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The embedded SKILL_CONFIG names and markets a different skill ('token-hub-cost-router-ai-hive') than the surrounding manifest context ('china-ai-relay-alternative-ai-hive'). This inconsistency can cause confused-deputy behavior, misleading provenance, and improper invocation of a capability under the wrong business context, especially because the config drives model selection and user-facing behavior.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
85% confidence
Finding

The file's user-facing natural-language content is entirely in Chinese, and there is no indication that users can opt into another language or that the skill is intentionally limited to a Chinese-speaking context. Under the policy rule for language or locale constraints, this can be a natural-language policy issue when no choice or justification is provided.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
83% confidence
Finding

The docstring presents this script as creating a 'deterministic production brief,' which implies a substantive production-ready brief. In practice, the script only serializes a small set of user-supplied fields and hardcoded arrays into a draft JSON object, so the inline documentation overstates what is produced.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

This code writes a JSON file to a user-specified path, creating parent directories if needed, but provides no prior warning, confirmation, or explanatory comment/docstring about modifying the filesystem. Although the final print reveals the output path after completion, it does not disclose the write action before it occurs.

Content

No source excerpt is available for this finding.