Back to skill

Security audit

90s魔法少女动画|AI-HIVE原创工作流

Security checks for vulnerabilities and agentic risk

Overview

The skill is a mostly disclosed AI-HIVE animation workflow, but its helper can forward AI-HIVE credentials to an environment-selected endpoint and the invocation scope is broad.

Review before installing. Use OAuth through the MCP client when possible, keep API keys in a secret store, and do not set AI_HIVE_MCP_URL unless you fully trust the endpoint. Confirm model, price, and budget before any generation call, and avoid broad implicit activation for unrelated AI image/video tasks.

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/ai_hive_mcp.py:16
Finding

Credential Exfiltration Through a User-Controlled MCP Endpoint

Content
View full analysis

Vulnerability Details

File Location: scripts/ai_hive_mcp.py, lines 16 and 52–70
Vulnerability Type: Credential disclosure through an unrestricted network endpoint override
Risk Level: High

python
MCP_URL = os.environ.get("AI_HIVE_MCP_URL", "https://ai-hive.iclip.cn/api/mcp")

def auth_headers() -> dict[str, str]:
    key = os.environ.get("AI_HIVE_API_KEY", "").strip()
    token = os.environ.get("AI_HIVE_ACCESS_TOKEN", "").strip()
    if token:
        return {"authorization": f"Bearer {token}"}
    if key:
        return {"x-ai-hive-api-key": key}
    raise SystemExit(
        "缺少凭据。OAuth 用户请在 MCP 客户端中完成登录;本脚本调用工具时需通过环境变量提供 "
        "AI_HIVE_API_KEY,或仅运行 doctor。"
    )


def post(payload: dict, session_id: str | None = None) -> tuple[dict, str | None]:
    headers = {
        "content-type": "application/json",
        "accept": "application/json, text/event-stream",
        **auth_headers(),
    }
    if session_id:
        headers["mcp-session-id"] = session_id
    request = urllib.request.Request(
        MCP_URL,
        data=json.dumps(payload, ensure_ascii=False).encode("utf-8"),
        headers=headers,
        method="POST",
    )

Technical Analysis

The MCP destination is read from the AI_HIVE_MCP_URL environment variable without validation. The same request path unconditionally adds either the AI_HIVE_ACCESS_TOKEN bearer token or the AI_HIVE_API_KEY header before sending the request.

Consequently, a process environment that sets AI_HIVE_MCP_URL can redirect authenticated requests to an arbitrary destination, including a non-HTTPS URL or an attacker-controlled HTTPS server. No scheme restriction, hostname allowlist, origin binding, or explicit custom-endpoint confirmation is applied.

The default destination, https://ai-hive.iclip.cn/api/mcp, is consistent with the Skill's declared remote AI-HIVE functionality, and transmitting credentials to that approved service is necessary for authenticated operations. Howe ...[truncated 1829 chars]

Remediation
View remediation

Remediation Suggestions

  1. Remove the endpoint override for production use. Assign the MCP URL to the fixed, documented AI-HIVE endpoint:

    python
    MCP_URL = "https://ai-hive.iclip.cn/api/mcp"
    
  2. If custom endpoints are operationally required, enforce an explicit allowlist. Parse the URL and require:

    • Scheme: https
    • Hostname: ai-hive.iclip.cn
    • Port: default HTTPS port
    • Path: /api/mcp
    • No embedded username or password
  3. Bind credentials to the approved origin. Add authentication headers only after confirming that the final request destination is the trusted AI-HIVE origin.

  4. Prevent cross-origin credential forwarding. Disable redirects for authenticated requests or validate every redirect target before following it. Reject redirects to a different scheme, hostname, or port.

  5. Separate custom-endpoint diagnostics from authenticated operation. If arbitrary MCP endpoints must be testable, do not attach AI-HIVE credentials to them. Require a separate credential explicitly scoped to the custom endpoint.

  6. Require deliberate opt-in for exceptional configurations. A custom endpoint should require an explicit command-line option and an interactive warning rather than being silently accepted from the ambient environment.

  7. Harden incident response guidance. If an untrusted endpoint may have received a credential, immediately revoke or rotate the API key, revoke the OAuth authorization where applicable, and review account task and billing activity.

Vulnerability Patterns
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Taint TrackingDirect Taint Flow, Variable-Mediated Taint Flow, Credential Exfiltration Chain
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (11)

Tainted flow: 'request' from os.environ.get (line 67, credential/environment) → urllib.request.urlopen (network output)

Critical
Category
Data Flow
Confidence
90% confidence
Finding

Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.

Content

Scanner excerpt · scripts/ai_hive_mcp.py (reported line 28)May include surrounding context.

python
def fetch_json(url: str) -> dict:
    request = urllib.request.Request(url, headers={"accept": "application/json"})
    with urllib.request.urlopen(request, timeout=20) as response:
        return json.loads(response.read().decode("utf-8"))

Tainted flow: 'request' from os.environ.get (line 67, credential/environment) → urllib.request.urlopen (network output)

Critical
Category
Data Flow
Confidence
90% confidence
Finding

The script sends authenticated requests to MCP_URL, which is taken from the AI_HIVE_MCP_URL environment variable. If an attacker can influence that environment variable, the script may send the API key or bearer token in headers to an attacker-controlled endpoint, causing credential exfiltration and unauthorized API use.

Content

Scanner excerpt · scripts/ai_hive_mcp.py (reported line 74)May include surrounding context.

python
method="POST",
    )
    try:
        with urllib.request.urlopen(request, timeout=60) as response:
            result = parse_payload(response.read(), response.headers.get("content-type", ""))
            return result, response.headers.get("mcp-session-id") or session_id
    except urllib.error.HTTPError as error:

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The skill is presented as a narrowly scoped '90s magical girl animation' workflow, but the referenced scripts and MCP instructions amount to a general remote MCP client capable of listing tools and invoking arbitrary server-side actions. That mismatch is dangerous because users may consent to a benign creative workflow while actually enabling a much broader execution surface, including networked tool invocation, possible paid actions, and access patterns not obvious from the declared purpose.

Content

No source excerpt is available for this finding.

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · references/mcp-binding.md (reported line 63)May include surrounding context.

md
## Codex、Claude 与 ChatGPT

优先使用各客户端的远程 MCP/连接器界面;若支持 JSON 配置,使用 OAuth 最小配置。客户端必须支持 Streamable HTTP、OAuth 2.1、PKCE 和动态客户端注册。若出现 `unauthorized_client`,保留脱敏错误和客户端版本,通过 AI-HIVE 登录后的客服渠道反馈,不要把 access token 粘贴到聊天中。

## Gemini 与支持 Header 的客户端

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · references/mcp-binding.md (reported line 102)May include surrounding context.

md
## Codex、Claude 与 ChatGPT

优先使用各客户端的远程 MCP/连接器界面;若支持 JSON 配置,使用 OAuth 最小配置。客户端必须支持 Streamable HTTP、OAuth 2.1、PKCE 和动态客户端注册。若出现 `unauthorized_client`,保留脱敏错误和客户端版本,通过 AI-HIVE 登录后的客服渠道反馈,不要把 access token 粘贴到聊天中。

## Gemini 与支持 Header 的客户端

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
86% confidence
Finding

The skill documents executable capabilities involving environment variables, local file reads/writes, and outbound network access, but it does not declare any explicit tool scope or allowed-tools boundary. In practice this weakens least-privilege controls and makes it easier for the skill to be run with broader capabilities than users expect, increasing the risk of unintended file access, secret exposure, or arbitrary remote calls if the surrounding agent honors the embedded examples/scripts.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

L003 将技能适用条件扩展到“搜索90s魔法少女动画、动漫游戏、AI图片、AI视频、短视频制作时使用”,其中“动漫游戏、AI图片、AI视频、短视频制作”范围非常宽,未限定必须与该工作流目标直接相关。这会让技能在大量普通内容创作请求中被匹配,缺少明确的排除条件或负例。

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
84% confidence
Finding

L006 将 metadata.language 设为 zh-CN,且全文说明与可复制提示词均默认中文,没有看到为用户提供语言/地区选择或明确的自愿 opt-in 机制。按规则,若技能强制特定语言而无用户选择,属于自然语言层面的语言/locale 政策风险。

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The manifest sets allow_implicit_invocation: true, which permits the skill to be invoked without an explicit user request or narrowly defined trigger conditions. Because this skill can connect to an external MCP service for AI generation workflows, implicit invocation increases the chance of unintended tool activation, user confusion, and unreviewed transmission of prompts or project data to a third-party endpoint.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

This code file contains user-facing error text in Chinese, and similar hard-coded Chinese strings appear throughout the script. The file does not offer the user a language/locale option or explain that the tool is intentionally limited to a Chinese-speaking context, which violates the language/locale policy criteria.

Content

No source excerpt is available for this finding.

Vague Triggers

Low
Category
Not specified by scanner
Confidence
87% confidence
Finding

L013 的 search_tags 包含“平面设计、生活Vlog、图片生成、视频生成、内容营销、短视频、AIGC、AI工作流”等高频泛化词,容易覆盖大量与“90s魔法少女动画”无关的普通请求。该处没有说明这些标签仅用于检索扩展而非直接触发,也没有给出限制条件。

Content

No source excerpt is available for this finding.